Undefined property: stdClass::$post_type when adding a Link
The plugin refers to $post->post_type
before testing it exists, which triggers an error for WP’s built-in (though hidden-by-default since forever) ”link” post type. The error appears quite harmless, as it doesn’t seem to interfere with the link editor’s functionality in any way.
Setup
- Simple Tags version 2.4.7
- WP version 4.9.8
- PHP version 5.6.33
Steps to reproduce
- Set
WP_DEBUG
on (define astrue
) - Enable WordPress’ link manager (
add_filter( 'pre_option_link_manager_enabled', '__return_true' );
), - Go to
Links > Add New
What happens
Simple Tags’ Settings box in the sidebar shows the following notices:
Notice: Undefined property: stdClass::$post_type in [path to wp]/wp-content/plugins/simple-tags/inc/class.admin.post.php on line 46
Notice: Undefined property: stdClass::$post_type in [path to wp]/wp-content/plugins/simple-tags/inc/class.admin.post.php on line 54