WPML
Estado
Abierto
Plugin/tema relacionado
The Events Calendar
Etiquetas de temática
Compatibility

Resumen del problema

Si utiliza el plugin The Events Calendar y su función Integrate events in main blog loop, verá que la página raíz aparece en blanco cuando se añade cualquier parámetro a la URL (example.com?foo=bar). Este problema ocurre específicamente cuando la configuración Usar directorio para el idioma por defecto de WPML también está activada.

Solución alternativa

Por favor, asegúrese de tener una copia de seguridad completa de su sitio antes de continuar.


  • Abra el archivo …/wp-content/plugins/the-events-calendar/src/Tribe/Query.php.

  • Busque la línea 577.

  • Reemplace:
    	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;
    	}

  • Por:
    	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;
    	}

Todos los problemas conocidos →