• Resolved ilovemetal

    (@ilovemetal)


    Hi Bro. It’s amazing plugin, very handy.. and I have one big trouble!

    I have installed some review plugin that add some form to the end of page it’s look like that:

    look

    And trouble that your plugin READ all headings from this div block.. and i don’t have way to exclude this form coz headings of this form some times very different.

    Can U add ability to your plugin exclude reading heading by DIV class?
    Or can you tell me how I can avoid reading the title in the current version with my situation?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Steven

    (@shazahm1hotmailcom)

    @ilovemetal

    Can you share a link to a page so I can take a look? Maybe there is a way but I need to be able to see it.

    Thread Starter ilovemetal

    (@ilovemetal)

    at this moment i develop my site on local hosting so there is no way to share.

    I make some “Crutch” to exclude my div block. And now all work fine.

    	//MY TOC FILTER
    require_once(get_stylesheet_directory().'/simple_html_dom.php');
    			$allhtml = str_get_html($content);
    			if ($allhtml->find('div[class=review_wrap]', 0)) {
    				$allhtml->find('div[class=review_wrap]', 0)->outertext='';
    				$sss=$allhtml->save();
    				$content=$sss;
    			}
    
    			//

    and I add this in top line of
    public static function extract_headings( &$find, &$replace, $content = ” ) {

    Can you tell me how I can implement this code with filters (to functions.php)? To be friendly for future updates?

    Steven

    (@shazahm1hotmailcom)

    @ilovemetal

    Basically you’re removing the rating dov from the post content before it is parsed for headings. Is that correct?

    I support I could add a new filter for you too hook into.

    Thread Starter ilovemetal

    (@ilovemetal)

    Yes! exactly you are right.
    If you add new filter it would be very useful!

    Big thnx for support and amazing handy plugin.

    Steven

    (@shazahm1hotmailcom)

    @ilovemetal

    Add this line:

    $content = apply_filters( 'ez_toc_extract_headings_content', $content );

    Right before this line:

    if ( is_array( $find ) && is_array( $replace ) && $content ) {

    in the extract_headings() method.

    Use this filter to be update safe. I do not know when an update will be released, but if you use this filter, you change will be update safe as I already added the filter which will be included when I do release the update.

    Hope this helps

    Thread Starter ilovemetal

    (@ilovemetal)

    Big thnx bro!. It’s helps).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Exclude by class DIV or something?’ is closed to new replies.