WordPress.org

Ready to get started?Download WordPress

Forums

Multiple content blocks
[resolved] crashes out in WordPress Importer (3 posts)

  1. Cowboy_X
    Member
    Posted 1 year ago #

    I encountered an error when using the WordPress Importer to suck in some content from an XML file. (http://wordpress.org/extend/plugins/wordpress-importer/)

    On line 64 of class.MCB.php…
    if(!wp_is_post_revision($post_id) && !wp_is_post_autosave($post_id) && (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest')) :
    … the $_SERVER['HTTP_X_REQUESTED_WITH'] doesn't make sense. You can't evaluate a variable that isn't set.

    I imagine it should read…

    if(!wp_is_post_revision($post_id) && !wp_is_post_autosave($post_id) && (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest')) :

    Thank you for a great tool, I've built countless sites with it.

    http://wordpress.org/extend/plugins/multiple-content-blocks/

  2. Trendwerk
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for your work. I've changed it (with some extra brackets around the final two conditions):
    https://github.com/trendwerk/multiple-content-blocks/commit/72a2bf8101002655506ba45eef46280d35b58823

    Does this work for you? If so, I'll commit it to the WP repo.

  3. Trendwerk
    Member
    Plugin Author

    Posted 11 months ago #

    This has been committed. Hope it works for you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.