탐색 건너뛰기

Open

Topic Tags: Compatibility

Overview of the issue

When using the Astra theme with WPML, PHP warnings related to undefined properties (menu_id) are displayed in the WPML > Languages section. These warnings appear when a main menu is assigned, and WPML’s “Menu Language Switcher” is enabled.

Warning: Undefined property: stdClass::$menu_id in .../wp-content/themes/astra/inc/extras.php on line 513
Warning: Undefined property: stdClass::$menu_id in .../wp-content/themes/astra/inc/extras.php on line 546

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open …/wp-content/themes/astra/inc/extras.php file.
  • Look for line 513.
  • Replace:
    		if ( in_array( $args->menu_id, $astra_menu_locations ) ) {
    
  • With:
    		if ( isset( $args->menu_id ) && in_array( $args->menu_id, $astra_menu_locations ) ) {
    
  • In the same file, move to line 546.
  • Replace:
    	$is_special_menu = in_array( $args->menu_id, $special_menu_ids );
    
  • With:
    	if ( isset( $args->menu_id ) && in_array( $args->menu_id, $astra_menu_locations ) ) {
    

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>