• Resolved grecoair

    (@grecoair)


    Hello. I receive the error messages below in a blank webpage when I try to create a new post.

    Warning: Creating default object from empty value in /home/customer/www/andygreco.com/public_html/wp-admin/includes/post.php on line 787

    Warning: Cannot modify header information – headers already sent by (output started at /home/customer/www/andygreco.com/public_html/wp-admin/includes/post.php:787) in /home/customer/www/andygreco.com/public_html/wp-admin/admin-header.php on line 9

    The steps I have tried: verify all updates are current. Disable all plugins and try again. Try in a different browser. I’ve spent a few days searching the forums and reading up on the two files listed in the warnings but I do not have a good idea of what to attempt. Any additional troubleshooting steps would be greatly appreciated. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    when you try to create Post and IF your post is created successfully with this Warnings , then you should just make debug FALSE like below in wp-config.php root file , so with this warnings will be OFF.

    define( 'WP_DEBUG', false );
    Thread Starter grecoair

    (@grecoair)

    Thank you. The new post is not created. When I click New>Post or Add New, the page reloads blank with those two warnings printed.

    Hello @grecoair

    Try to disable plugins , may be some plugins conflicting and then check if post is working or not .

    Try clearing the site’s cookies from your browser (you’ll have to log in again) and clearing the browser cache. 

    Thread Starter grecoair

    (@grecoair)

    Hello. I’ve disabled all my plugins, deleted the browser cache and the site’s cookies. Now when I try to log back in to wordpress, there is a blank page with the text “Sorry, you are not allowed to access this page.”. It appears some of the steps I have taken has locked me out of my wordpress account.

    edit: I was able to find a way to log back into my account. The original condition persists.

    The error code points to these lines of code in the associated files:

    wp-admin/includes/post.php Line 787: $post->post_content = (string) apply_filters( ‘default_content’, $post_content, $post );

    wp-admin/admin-header.php Line 9: header( ‘Content-Type: ‘ . get_option( ‘html_type’ ) . ‘; charset=’ . get_option( ‘blog_charset’ ) );

    • This reply was modified 11 months, 2 weeks ago by grecoair.
    • This reply was modified 11 months, 2 weeks ago by grecoair.
    Thread Starter grecoair

    (@grecoair)

    @mayuripatel I was able to solve this. I was not able to locate the error within line 787, but I reverted to an earlier backup, the problem remained with the earlier backup, and when I restored the current version, the condition no longer existed.

    The cause is unknown, which is frustrating, but it was not caused by editing any of the files. If anyone can shed light on this recurring issue, it would be greatly appreciated.

    We have the same error on a site, we don’t know how to solve it, we have tried absolutely everything.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Warnings from php file errors’ is closed to new replies.