Title: [BUG Report] &#8216;reference&#8217; shortcode
Last modified: November 7, 2023

---

# [BUG Report] ‘reference’ shortcode

 *  Resolved [Cheon, YoungMin](https://wordpress.org/support/users/082net/)
 * (@082net)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/bug-report-reference-shortcode/)
 *     ```wp-block-code
       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!!
 *     ```wp-block-code
       if( !has_shortcode( $ezd_content, 'reference' ) ) {
           return $ezd_content;
       }
       ```
   

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

 *  Plugin Author [Spider Themes](https://wordpress.org/support/users/spiderdevs/)
 * (@spiderdevs)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/bug-report-reference-shortcode/#post-17180842)
 * Thanks for noticing it. You’ll get it fixed in the next version of the plugin.
 *  Thread Starter [Cheon, YoungMin](https://wordpress.org/support/users/082net/)
 * (@082net)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/bug-report-reference-shortcode/#post-17558772)
 * 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`)
 *     ```wp-block-code
       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.
 *     ```wp-block-code
       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](https://wordpress.org/support/users/codersajjad/)
 * (@codersajjad)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/bug-report-reference-shortcode/#post-17682879)
 * 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](https://wordpress.org/support/users/codersajjad/)
 * (@codersajjad)
 * [2 years ago](https://wordpress.org/support/topic/bug-report-reference-shortcode/#post-17723778)
 * Hello [@082net](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/eazydocs/assets/icon-128x128.png?rev=3510212)
 * [EazyDocs - AI Powered Knowledge Base, Wiki, Documentation & FAQ Builder](https://wordpress.org/plugins/eazydocs/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/eazydocs/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/eazydocs/)
 * [Active Topics](https://wordpress.org/support/plugin/eazydocs/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/eazydocs/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/eazydocs/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Sajjad Hossain](https://wordpress.org/support/users/codersajjad/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/bug-report-reference-shortcode/#post-17723778)
 * Status: resolved