WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: diggZ-Et] Doesn't cooperate well with other filters... (3 posts)

  1. Dougal Campbell
    Member
    Posted 5 years ago #

    Don't use 'echo' in filters. You need to build the string up in a variable, and return the modified content. The way your filter function is coded, it kills other filters.

    As one major example, with your plugin active, the 'gallery' shortcode can break. Since you aren't passing the post content along to the next filter in the chain, the image gallery is never built.

    http://wordpress.org/extend/plugins/diggz-et/

  2. Ryan Christenson
    Member
    Posted 5 years ago #

    Thanks for that info Dougal. This is my first WordPress Plugin and I'm still learning the system. I updated the plugin today. I forgot to rid the echos and replace them with _e(). Also I see what your saying about passing it through a variable. I tested the new code with the gallery shortcode and it no longer breaks it.

    Although I notice now it reports some errors when using error reporting. Only when using the gallery shortcode. Small background errors, but I still want to fix that also.

  3. Ryan Christenson
    Member
    Posted 5 years ago #

    Like to note that all the errors are fixed and nothing gets broken anymore from this plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic