Support » Plugin: Secondary Title » PHP Notice: Trying to get property of non-object on line 471

  • Resolved brit77

    (@brit77)


    Hi,
    I noticed that this notice appears in my error log whenever I view “Inbound Messages” via the Flamingo plugin in the dashboard:
    Notice: Trying to get property ‘ID’ of non-object in /home/site/public_html/wp-content/plugins/secondary-title/includes/functions.php on line 471

    This same notice, but on line 457, was reported in this thread:
    https://wordpress.org/support/topic/php-notice-trying-to-get-property-of-non-object-22/

    with the following code change suggestion:

    if(!isset($post->ID) || !$post->ID) {
             return false;
          }

    I opened the file (wp-content/plugins/secondary-title/includes/functions.php) and found at line 471: if(!$post->ID) {

    I changed this to the above-suggested code, and it has resolved the issue.

    Any chance this can be included in the next plugin update?

    Thanks!
    Sarah

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author thaikolja

    (@thaikolja)

    Thanks, I’ll change it for the next version 🙂

    Thread Starter brit77

    (@brit77)

    Hi @thaikolja,
    Thanks for addressing this so quickly. I see it was included in version 2.0.4.
    I tested it upon update, and unfortunately, the same error occurred but this time at line 475. I used the same fix to resolve it.

    -Sarah

    Plugin Author thaikolja

    (@thaikolja)

    Thanks for reporting, @brit77. I’ll have it in the next version.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Notice: Trying to get property of non-object on line 471’ is closed to new replies.