Undefined property: stdClass::$post_type when adding a Link

12. elokuuta 2018 klo 18.18
Sijainti: Vianhallintajärjestelmät: Github
Avainsanat: WordPress

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

  1. Set WP_DEBUG on (define as true)
  2. Enable WordPress’ link manager (add_filter( 'pre_option_link_manager_enabled', '__return_true' );),
  3. 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

Vastaa viestiin sen kontekstissa (Github)