Plugin throwing error | WordPress.org

[ad_1]

Hey guys, I’ve installed the plugin in a different website and it threw a strange error that I haven’t seen before:

Warning: Attempt to read property “term_id” on int in /plugins/wpc-ajax-search/wpc-ajax-search.php on line 1128

This is the function inside the plugin that throws the error:

function nav_menu_items( $items, $args ) {

                    $saved_menus = self::get_setting( ‘menus’, [] );

                    if ( is_array( $saved_menus ) && in_array( $args->menu->term_id, $saved_menus ) ) {

                        $items .= ‘<li class=”menu-item wpcas-menu-item menu-item-type-wpcas”><a href=”#”>’ . self::localization( ‘menu’, esc_html__( ‘Search’, ‘wpc-ajax-search’ ) ) . ‘</a></li>’;

                    }

                    return $items;

                }

It seems that the array with the menus is not building property or for some reason it can’t read the ID of my menu, the weird thing is that I have this plugin on another website and it works perfectly.

Any ideas what this could be or how I can work around it, maybe by hard coding the header menu ID? Thanks!

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

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer