• Resolved Cheon, YoungMin

    (@082net)


    easydocs/shortcodes/reference.php

    I’m using EasyDocs Pro version, and had some issues after installing the plugin

    Finally found the code from above file

    ‘the_content’ filter applied to all posts on site without ‘reference’ shortcode ??

    And the filter applied with closure function and even developer cannot exclude that filter

    The code should applied ONLY when the ‘reference’ code is included and the filter function must have function name not closure!!

    if( !has_shortcode( $ezd_content, 'reference' ) ) {
        return $ezd_content;
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Spider Themes

    (@spiderdevs)

    Thanks for noticing it. You’ll get it fixed in the next version of the plugin.

    Thread Starter Cheon, YoungMin

    (@082net)

    This issue still not fixed after 5 months ??

    The code below is having a huge impact on the site’s performance!

    It filters all content of all post types and do all shortcodes to that contents (easydocs/shortcodes/reference.php)

    add_filter( 'the_content', function ( $ezd_content ) {
    	$ezd_options      = get_option( 'eazydocs_settings' );
    	$is_notes_title   = $ezd_options['is_footnotes_heading'] ?? '1';
    	$notes_title_text = $ezd_options['footnotes_heading_text'] ?? __( 'Footnotes', 'eazydocs' );
    	$footnotes_column = $ezd_options['footnotes_column'] ?? '1';
    
    	$all_shortcodes = ezd_all_shortcodes( $ezd_content );
    	$all_shortcoded = '';
    	foreach ( $all_shortcodes as $all_shortcode ) {
    		$all_shortcoded .= '<span>' . do_shortcode( $all_shortcode[0] ) . '</span>';
    	}
    
    	$ezd_footnote_title = '';
    	if ( ! empty( $notes_title_text ) && $is_notes_title == '1' && has_shortcode( $ezd_content, 'reference' ) ) {
    		$ezd_footnote_title = sprintf( '<div class="ezd-footnote-title">%s</div>', $notes_title_text );
    	}
    
    	$footnotes_contents = '';
    	if ( has_shortcode( $ezd_content, 'reference' ) ) {
    		$footnotes_contents = $ezd_footnote_title . "<div ezd-data-column='" . $footnotes_column . "' class='ezd-footnote-footer'>" . $all_shortcoded
    		                      . "</div>";
    	}
    
    	return $ezd_content . $footnotes_contents;
    } );

    You should apply this filter to certain post types ONLY

    And ONLY when the content has ‘reference’ shortcode

    Or at least provide a function name so we can remove the filter.

    function ezd_reference_content_filter($content) {
        $types = apply_filters('ezd_xxxx', ['doc']);
        if ( !in_array( get_post_type(), $types ) || !has_shortcode( $content, 'reference' ) ) {
            return $content;
        }
        xxxxxx
        xxxxxx
        return $content;
    }
    add_filter( 'the_content', 'ezd_reference_content_filter' );

    Thanks in advance

    Plugin Author Sajjad Hossain

    (@codersajjad)

    Hello,

    We sincerely apologize for the delay and the inconvenience. Rest assured, we’ve taken note of this and it will be fixed ASAP. Once the issue has been addressed, we will promptly notify you of the resolution.

    Thank you for your patience and understanding.

    Best regards,
    spider-themes

    Plugin Author Sajjad Hossain

    (@codersajjad)

    Hello @082net,
    I am pleased to inform you that we have resolved this issue. The fix will be included in our upcoming version.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[BUG Report] ‘reference’ shortcode’ is closed to new replies.