Support » Localhost Installs » Warning: Creating default object from empty value in C:\wamp\www\wordpress\wp-ad

  • Guys plz help m new to making website and wordpress using wamp local host. Suddenly getting error message when i try to click on new post. The Error is as Follows

    1. Warning: Creating default object from empty value in C:\wamp\www\wordpress\wp-admin\includes\post.php on line 641

    2. Warning: Invalid argument supplied for foreach() in C:\wamp\www\wordpress\wp-content\plugins\wordpress-seo\admin\metabox\class-metabox.php on line 1067

    can someone plz let me know what should i do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • By any chance are you using the release candidate of PHP 7.2? I can’t speak for (2) since I neither use nor recommend Yoast SEO, but the error in (1) could be due to some changes in PHP 7.2.

    The errors could also be caused by your not loading all the core DLL files for PHP. That would be a WAMP installation/setup error, so if you’re not using PHP 7.2, then you might want to check the WAMP support site.

    Dear Dion thanx for the reply, Let me descirbe the errors in detail

    PHP Warning: Creating default object from empty value in C:\wamp\www\wordpress\wp-admin\includes\post.php on line 641
    Stack trace:
    1. {main}() C:\wamp\www\wordpress\wp-admin\post-new.php:0
    2. get_default_post_to_edit() C:\wamp\www\wordpress\wp-admin\post-new.php:83

    PHP Warning: Invalid argument supplied for foreach() in C:\wamp\www\wordpress\wp-content\plugins\wordpress-seo\admin\metabox\class-metabox.php on line 1067
    Stack trace:
    1. {main}() C:\wamp\www\wordpress\wp-admin\post-new.php:0
    2. include() C:\wamp\www\wordpress\wp-admin\post-new.php:85
    3. require_once() C:\wamp\www\wordpress\wp-admin\edit-form-advanced.php:472
    4. do_action() C:\wamp\www\wordpress\wp-admin\admin-header.php:97
    5. WP_Hook->do_action() C:\wamp\www\wordpress\wp-includes\plugin.php:453
    6. WP_Hook->apply_filters() C:\wamp\www\wordpress\wp-includes\class-wp-hook.php:323
    7. call_user_func_array:{C:\wamp\www\wordpress\wp-includes\class-wp-hook.php:298}() C:\wamp\www\wordpress\wp-includes\class-wp-hook.php:298
    8. WPSEO_Metabox->enqueue() C:\wamp\www\wordpress\wp-includes\class-wp-hook.php:298
    9. WPSEO_Metabox->localize_replace_vars_script() C:\wamp\www\wordpress\wp-content\plugins\wordpress-seo\admin\metabox\class-metabox.php:908
    10. WPSEO_Metabox->get_replace_vars() C:\wamp\www\wordpress\wp-content\plugins\wordpress-seo\admin\metabox\class-metabox.php:259
    11. WPSEO_Metabox->get_custom_replace_vars() C:\wamp\www\wordpress\wp-content\plugins\wordpress-seo\admin\metabox\class-metabox.php:1002
    12. WPSEO_Metabox->get_custom_fields_replace_vars() C:\wamp\www\wordpress\wp-content\plugins\wordpress-seo\admin\metabox\class-metabox.php:1014
    Ignore
    Sep 27, 12:15:11
    WordPress database error Duplicate entry ’92’ for key ‘PRIMARY’ for query INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid) VALUES (1, ‘2017-09-27 12:15:11’, ‘0000-00-00 00:00:00’, ”, ”, ‘Auto Draft’, ”, ‘auto-draft’, ‘post’, ‘open’, ‘open’, ”, ”, ”, ”, ‘2017-09-27 12:15:11’, ‘0000-00-00 00:00:00’, 0, 0, ”, ”) made by get_default_post_to_edit, wp_insert_post

    The Second error got resolved, it was due to SEO plugin. But the First error as listed below remains the same.

    PHP Warning: Creating default object from empty value in C:\wamp\www\wordpress\wp-admin\includes\post.php on line 641
    Stack trace:
    1. {main}() C:\wamp\www\wordpress\wp-admin\post-new.php:0
    2. get_default_post_to_edit() C:\wamp\www\wordpress\wp-admin\post-new.php:83

    The code on line 641 say:

    $post->post_content = apply_filters( ‘default_content’, $post_content, $post );

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.