نظرة عامة على المشكلة
إذا كنت تستخدم إضافة The Events Calendar وميزة دمج الأحداث في حلقة المدونة الرئيسية الخاصة بها، فستواجه مشكلة ظهور الصفحة الجذرية فارغة عند إضافة أي معلمة إلى عنوان URL (example.com?foo=bar). تحدث هذه المشكلة تحديداً عند تمكين إعداد استخدام الدليل للغة الافتراضية في WPML أيضاً.
حل بديل مؤقت
تم إصلاح هذه المشكلة في WPML 5.2.0. يحل التحديث المشكلة على موقعك، لذا لا تحتاج إلى هذا الحل البديل المؤقت إلا إذا لم تتمكن من التحديث بعد.
يرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.
- افتح الملف …/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; }