• I keep getting this error after migrating to PHP 8

    Warning: Undefined property: stdClass::$desc
    Here is the line it’s referencing

    function be_header_menu_desc( $item_output, $item, $depth, $args ) {
     
    	if( 'show' == $args->desc && $item->description != '' )
    		$item_output = str_replace( '</a>', '<span class="nav-description">' . $item->description . '</span></a>', $item_output );
    		
    	return $item_output;
    }

    And here is the Call stack

    Call Stack
    #	Time	Memory	Function	Location
    1	16791436901.4053	379464	{main}( )	.../index.php:0
    2	16791436901.4053	379776	require( '/Users/jasonsprague/Local Sites/multimarket/app/public/wp-blog-header.php )	.../index.php:17
    3	16791436901.4053	13756136	require_once( '/Users/jasonsprague/Local Sites/multimarket/app/public/wp-includes/template-loader.php )	.../wp-blog-header.php:19
    4	16791436901.4053	13792384	include( '/Users/jasonsprague/Local Sites/multimarket/app/public/wp-content/themes/imarketsmart/template-flex-page.php )	.../template-loader.php:106
    5	16791436901.4053	13792384	get_header( )	.../template-flex-page.php:5
    6	16791436901.4053	13792760	locate_template( )	.../general-template.php:48
    7	16791436901.4053	13792888	load_template( )	.../template.php:716
    8	16791436901.4053	13793448	require_once( '/Users/jasonsprague/Local Sites/multimarket/app/public/wp-content/themes/imarketsmart/header.php )	.../template.php:770
    9	16791436901.4053	14686176	wp_nav_menu( )	.../header.php:61
    10	16791436901.4053	15254128	walk_nav_menu_tree( )	.../nav-menu-template.php:228
    11	16791436901.4053	15254288	Walker_Nav_Menu->walk( )	.../nav-menu-template.php:608
    12	16791436901.4053	15292768	Walker_Nav_Menu->display_element( )	.../class-wp-walker.php:246
    13	16791436901.4053	15292768	Walker_Nav_Menu->start_el( )	.../class-wp-walker.php:146
    14	16791436901.4053	15294120	apply_filters( )	.../class-walker-nav-menu.php:252
    15	16791436901.4053	15294528	WP_Hook->apply_filters( )	.../plugin.php:191
    16	16791436901.4053	15295280	be_header_menu_desc( )	.../class-wp-hook.php:307
    • This topic was modified 3 years, 11 months ago by o3world.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Warnings are not errors they are warnings and should not normally be displayed on a production site, the fact you have a stack trace indicates that you are in debug mode.

    the property desc is not defined in $args

    Whos code is it? Yours or someone else’s?

    p.s.

    Sorry looking at the trace it is being called from the theme imarketsmart I am unfamiliar with the theme but in any case if you want a resolution you will need to raise the issue with the developer

    Thread Starter o3world

    (@o3world)

    @alanfuller It is an original theme

    • This reply was modified 3 years, 11 months ago by o3world.

    You will need to identify the theme author and contact them.

    If you go to Appearance>Themes and click on the theme image it should give you some details.

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

The topic ‘Warning: Undefined property: stdClass::$desc’ is closed to new replies.