• NoticeUndefined variable: user+

    1. wp-content/themes/sacconicase/functions.php:699

    1TemaNoticeTrying to get property ‘ID’ of non-object+

    1. wp-content/themes/sacconicase/functions.php:699

    1Tema

    NoticeUndefined variable: user+

    1. wp-content/themes/sacconicase/functions.php:703

    1TemaNoticeTrying to get property ‘ID’ of non-object+

    1. wp-content/themes/sacconicase/functions.php:703

    Line 699 is:$german = get_the_author_meta('periodo_affitti_de', $user->ID );

    inside

    add_shortcode('periodo_affitti', 'translate_rent');
    function translate_rent() {
      global $post;
      $german = get_the_author_meta('periodo_affitti_de', $user->ID );
      if ( 'de_DE' == get_locale() && ! empty( $german )){
         return $german;
      } else {
         return get_the_author_meta( 'periodo_affitti', $user->ID ) ;
      }
    }
    

    Line 703 is inside the same function

    When I have “return” I dont know how to fix the function

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You would need to assign a WP_User object to $user. It should be the post’s author, right? If so, instead of getting a WP_User object, replace $user->ID with $post->post_author

Viewing 1 replies (of 1 total)

The topic ‘Query monitors alerts about 2 PHP errors’ is closed to new replies.