• Resolved jordanmc

    (@jordanmc)


    Hello,
    IS there a way to get the TOC in my functions.php file?

    Specifically, in the save_post WordPress hook. I have tried this but $toc is “” even though I have 4 H1’s in my post. $ezPost.hasTOCItems is equal to false.
    hasTOCItems:false

    $toc = $ezPost->getTOC();
    $myObj->toc = $toc;

    So either my PHP code is wrong or the plugin is not doing something correctly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jordanmc

    (@jordanmc)

    Figured it out. I only had 3 not 4 H1s. I changed it to minimum of 1 H1 and it worked.

    Steven

    (@shazahm1hotmailcom)

    Great to hear.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Getting TOC in functions.php / save_post’ is closed to new replies.