• Resolved basdebruin

    (@basdebruin)


    I am getting a lot (one per page view) of these PHP Notices in my error log.

    PHP Notice: Undefined index: title in /var/www/vhosts/106/322540/webspace/siteapps/WordPress-595371/htdocs/staging/wp-content/plugins/translatepress-multilingual/includes/compatibility-functions.php on line 45

    Can this be related to a setting or is it something that needs a fix? For what it is worth: I am using Elementor page builder and my page titles are hidden.

    • This topic was modified 6 years ago by basdebruin.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Denis

    (@sdenis)

    Hello,

    Can you give me the link to a site to better analyze the issue?

    Thanks,
    Denis

    Thread Starter basdebruin

    (@basdebruin)

    Hi Dennis,

    Sure, I just opened the site (staging) at: https://excellent-team.nl/staging/

    Thanks,
    Bas

    Thread Starter basdebruin

    (@basdebruin)

    Hi @sdenis

    Any news on this one. I had a look int your code and includes/compatibility-functions.php line 45 contains indeed a reference to ‘title’ within the array. Code is:

    add_filter( 'nav_menu_link_attributes', 'trp_remove_html_from_menu_title', 10, 3);
    function trp_remove_html_from_menu_title( $atts, $item, $args ){
        write_log($atts);
    	$atts['title'] = wp_strip_all_tags($atts['title']);
        return $atts;
    }

    I added a write)log to check the array $atts, and indeed this array does not contain an element ‘title’, see dump:

    [18-May-2020 19:20:18 UTC] Array
    (
        [target] => 
        [rel] => 
        [href] => https://excellent-team.nl/staging/nl/blog/category/monday/
        [class] => nav-link
    )

    Can you please resolve this so I get rid of the 100’s of PHP Notices in the error log.

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

The topic ‘PHP Notice in error log’ is closed to new replies.