WordPress.org

Support

Support » Plugins and Hacks » Front-end Editor » Attachment image appends after description saving

Attachment image appends after description saving

  • Hi.
    I have a custom page for image attachments in my theme. When I go to any page with image attachment, edit attachment description (the same as post content) and save the description there is attachment image appears before the attachment description.
    I have solved this bug and want you to solve it in your plugin.

    When page loads it there is script includes – wp-include/template-loader.php. On line 29 it removes ‘prepend_attachment’ filter which add attachment image before the description.
    But when your plugin send AJAX request to plugin – template-loader.php script doesn’t include.
    In my case I just added the same remove_filter to my theme setup action.

    What do you think about this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author scribu

    @scribu

    Posting the relevant code would help.

    Also, what version of FEE are you using?

    Version: 2.1.2.
    wp-include/template-loader.php, line 29:
    remove_filter('the_content', 'prepend_attachment');
    core.php in your plugin, line 221:
    $result = @apply_filters( $filter, $result ); // TODO: remove, since additional arguments aren't passed
    on this line the_content filter applies and prepend_attachment filter applies too by the_content filter.

    Plugin Author scribu

    @scribu

    elseif ( is_attachment() && $template = get_attachment_template() ) :
    	remove_filter('the_content', 'prepend_attachment');

    That’s such a hack.

    Thanks for bringing this to my attention, but I will not add this to my plugin.

    Users will just have to fix it in their theme’s functions.php until WP Core decides to do it properly.

    Plugin Author scribu

    @scribu

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Attachment image appends after description saving’ is closed to new replies.
Skip to toolbar