Title: wordpress core file says error template.php
Last modified: January 9, 2024

---

# wordpress core file says error template.php

 *  [kazskater99](https://wordpress.org/support/users/kazskater99/)
 * (@kazskater99)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/)
 * > **Notice**: Trying to get property ‘post_status’ of non-object in **/home/kaztokyo/
   > www/wordpress/wp-admin/includes/template.php** on line **2298**
   > **Notice**: Trying to get property ‘post_status’ of non-object in **/home/kaztokyo/
   > www/wordpress/wp-admin/includes/template.php** on line **2302**
   > **Notice**: Trying to get property ‘post_status’ of non-object in **/home/kaztokyo/
   > www/wordpress/wp-admin/includes/template.php** on line **2308**
   > **Notice**: Trying to get property ‘post_status’ of non-object in **/home/kaztokyo/
   > www/wordpress/wp-admin/includes/template.php** on line **2312**
   > **Notice**: Trying to get property ‘ID’ of non-object in **/home/kaztokyo/www/
   > wordpress/wp-admin/includes/template.php** on line **2316**
   > **Notice**: Trying to get property ‘post_status’ of non-object in **/home/kaztokyo/
   > www/wordpress/wp-admin/includes/template.php** on line **2320**
   > **Notice**: Trying to get property ‘ID’ of non-object in **/home/kaztokyo/www/
   > wordpress/wp-admin/includes/template.php** on line

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [kazskater99](https://wordpress.org/support/users/kazskater99/)
 * (@kazskater99)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17329752)
 * General Things to do
    - Deactive all plugin
    - Debug error
    - check drbug log file
    - Chnage Theme such as Twenty Twenty One
 * Above lists Still Error shown in Customimazie Appearance in Theme
 * DO you know how to take out all massage or fix?
 * Thanks
 *  Thread Starter [kazskater99](https://wordpress.org/support/users/kazskater99/)
 * (@kazskater99)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17329933)
 * Above error code is here
 * **I can not edit post page** right now!!! Edit Post Page Screen is ALL white.
 *     ```wp-block-code
       /**
        * Retrieves an array of post states from a post.
        *
        * @since 5.3.0
        *
        * @param WP_Post $post The post to retrieve states for.
        * @return string[] Array of post state labels keyed by their state.
        */
       function get_post_states( $post ) {
       	$post_states = array();
   
       	if ( isset( $_REQUEST['post_status'] ) ) {
       		$post_status = $_REQUEST['post_status'];
       	} else {
       		$post_status = '';
       	}
   
       	if ( ! empty( $post->post_password ) ) {
       		$post_states['protected'] = _x( 'Password protected', 'post status' );
       	}
   
       	if ( 'private' === $post->post_status && 'private' !== $post_status ) {
       		$post_states['private'] = _x( 'Private', 'post status' );
       	}
   
       	if ( 'draft' === $post->post_status ) {
       		if ( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
       			$post_states[] = __( 'Customization Draft' );
       		} elseif ( 'draft' !== $post_status ) {
       			$post_states['draft'] = _x( 'Draft', 'post status' );
       		}
       	} elseif ( 'trash' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) {
       		$post_states[] = _x( 'Customization Draft', 'post status' );
       	}
   
       	if ( 'pending' === $post->post_status && 'pending' !== $post_status ) {
       		$post_states['pending'] = _x( 'Pending', 'post status' );
       	}
   
       	if ( is_sticky( $post->ID ) ) {
       		$post_states['sticky'] = _x( 'Sticky', 'post status' );
       	}
   
       	if ( 'future' === $post->post_status ) {
       		$post_states['scheduled'] = _x( 'Scheduled', 'post status' );
       	}
   
       	if ( 'page' === get_option( 'show_on_front' ) ) {
       		if ( (int) get_option( 'page_on_front' ) === $post->ID ) {
       			$post_states['page_on_front'] = _x( 'Front Page', 'page label' );
       		}
   
       		if ( (int) get_option( 'page_for_posts' ) === $post->ID ) {
       			$post_states['page_for_posts'] = _x( 'Posts Page', 'page label' );
       		}
       	}
   
       	if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) {
       		$post_states['page_for_privacy_policy'] = _x( 'Privacy Policy Page', 'page label' );
       	}
       Trying to get property 'post_status' of non-object　
       ```
   
    -  This reply was modified 2 years, 5 months ago by [kazskater99](https://wordpress.org/support/users/kazskater99/).
    -  This reply was modified 2 years, 5 months ago by [kazskater99](https://wordpress.org/support/users/kazskater99/).
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17330498)
 * If all plugins are deactivated and a standard theme is activated, the message
   is probably caused by an incomplete and/or incorrect data record in the database.
   It is difficult to say which one this is. You could take a look at which data
   records you can edit in the backend (pages, posts) and whether anything is displayed
   incorrectly there.
 * Since the messages are “only” notices and not real errors, you could also ignore
   them by deactivating the error output in wp-config.php.
 *  Thread Starter [kazskater99](https://wordpress.org/support/users/kazskater99/)
 * (@kazskater99)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17330940)
 * I just backed up date so i can edit post　no white page come up.
 * but still template error shown hopefully wait for proper wordpress version
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17331338)
 * There will be no update for this, as this is a bug in your data that was probably
   caused by the theme or plugin you used previously. You are welcome to try to 
   report this as a bug: [https://core.trac.wordpress.org/](https://core.trac.wordpress.org/)–
   but you will probably get the same answer there as here.
 *  [Stephen Bernhardt](https://wordpress.org/support/users/sabernhardt/)
 * (@sabernhardt)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17345411)
 * If your issue is related to [Trac 51565](https://core.trac.wordpress.org/ticket/51565),
   you could:
    1. Go to Appearance and then Menus.
    2. Check each menu item in the selected menu to ensure that it is **complete** 
       and that it **does not include any removed** posts.
    3. Click the “Save Menu” button after you have verified the menu’s accuracy.
    4. If you have more than one menu, switch to the others, verify their accuracy 
       and save changes.
    5. Return to Customize to find out if the `post_status` notices still print.
 * If that still does not remove the notices, I recommend changing `WP_DEBUG` to`
   false` in `wp-config.php` to hide notices and errors.
    -  This reply was modified 2 years, 4 months ago by [Stephen Bernhardt](https://wordpress.org/support/users/sabernhardt/).
 *  Thread Starter [kazskater99](https://wordpress.org/support/users/kazskater99/)
 * (@kazskater99)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17357998)
 * Ok I try thank you!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘wordpress core file says error template.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [kazskater99](https://wordpress.org/support/users/kazskater99/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/wordpress-core-file-says-error-template-php/#post-17357998)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
