WPML
סטטוס
פתוח
תוסף/ערכת עיצוב קשורים
The Events Calendar
תגיות נושא
Compatibility

סקירה כללית של התקלה

אם אתה משתמש בתוסף The Events Calendar ובתכונה Integrate events in main blog loop שלו, תיתקל במצב שבו עמוד השורש מופיע ריק כאשר מתווסף פרמטר כלשהו ל־URL (example.com?foo=bar). בעיה זו מתרחשת ספציפית כאשר ההגדרה השתמש בספרייה עבור שפת ברירת מחדל של WPML מופעלת גם כן.

פתרון עוקף

אנא ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.


  • פתח את הקובץ …/wp-content/plugins/the-events-calendar/src/Tribe/Query.php.

  • חפש את שורה 577.

  • החלף את:
    	protected static function add_post_type_to_query( WP_Query $query, string ...$post_types ): void {
    		
    		$query_post_types = self::get_query_post_types( $query );
    
    		$updated_post_types = array_unique( array_merge( $post_types, $query_post_types ) );
    
    		$query->set( 'post_type', $updated_post_types );
    		$query->query['post_type'] = $updated_post_types;
    	}

  • ב:
    	protected static function add_post_type_to_query( WP_Query $query, string ...$post_types ): void {
    		
    		$query_post_types = self::get_query_post_types( $query );
    
    		// WPML Workaround for compsupp-7426
    		if ( class_exists('Sitepress') ) {
    			$is_root_enabled = apply_filters( 'wpml_sub_setting', false, 'urls', 'directory_for_default_language' );
    			
    			if ( $is_root_enabled && is_home() ) {
    				return;
    			}
    		}
    
    		$updated_post_types = array_unique( array_merge( $post_types, $query_post_types ) );
    
    		$query->set( 'post_type', $updated_post_types );
    		$query->query['post_type'] = $updated_post_types;
    	}

כל התקלות הידועות →