WPML
الحالة
محلولة بواسطة المطور
الإضافة/القالب ذو الصلة
Royal Elementor Addons
وسوم الموضوع
Compatibility

نظرة عامة على المشكلة

قد يواجه مستخدمو إضافة Royal Elementor Addons رسالة خطأ تفيد بوجود دالة مهملة عند التشغيل على إصدارات PHP 8.1 الأحدث وما فوق:


Deprecated: urldecode(): Passing null to parameter #1 ($string) of type string is deprecated in .../wp-includes/post.php on line 5864

حل بديل مؤقت

يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.


  • افتح ملف …/wp-content/plugins/royal-elementor-addons/classes/utilities.php.

  • ابحث عن السطر 396.

  • استبدل:
    		// tmp remove after 2 months
    		$templates_loop = new \WP_Query([
    			'post_type' => 'wpr_templates',
    			'name' => $template,
    			'posts_per_page' => 1,
    		]);
    		
    		if ( ! $templates_loop->have_posts() ) {
    			if ( defined('ICL_LANGUAGE_CODE') ) {
    				$original_post = get_page_by_path($template, OBJECT, 'wpr_templates');
    				if ( $original_post ) {
    					$original_post_id = $original_post->ID;
    					$language_code = ICL_LANGUAGE_CODE;
    				
    					$translated_post_id = icl_object_id($original_post_id, 'wpr_templates', false, $language_code);
    					
    					if ( $translated_post_id ) {
    						$translated_post = get_post($translated_post_id);
    						$translated_slug = $translated_post->post_name;
    					
    						if ( $translated_slug ) {
    							$template = $translated_slug;
    						} else {
    							$template = null;
    						}
    					}
    				}
    			} else {
    				$template = null;
    			}
    		} else {
    			$template = $template;
    		}

  • بـ:
    		// Ensure template is not null or empty before querying the database
    		// compsupp-7576 fix
    		if (!empty($template)) {		
    			// tmp remove after 2 months
    			$templates_loop = new \WP_Query([
    				'post_type' => 'wpr_templates',
    				'name' => $template,
    				'posts_per_page' => 1,
    			]);
    			
    			if ( ! $templates_loop->have_posts() ) {
    				if ( defined('ICL_LANGUAGE_CODE') ) {
    					$original_post = get_page_by_path($template, OBJECT, 'wpr_templates');
    					if ( $original_post ) {
    						$original_post_id = $original_post->ID;
    						$language_code = ICL_LANGUAGE_CODE;
    					
    						$translated_post_id = icl_object_id($original_post_id, 'wpr_templates', false, $language_code);
    						
    						if ( $translated_post_id ) {
    							$translated_post = get_post($translated_post_id);
    							$translated_slug = $translated_post->post_name;
    						
    							if ( $translated_slug ) {
    								$template = $translated_slug;
    							} else {
    								$template = null;
    							}
    						}
    					}
    				} else {
    					$template = null;
    				}
    			} else {
    				$template = $template;
    			}
    
    		} // compsupp-7576 fix

جميع المشاكل المعروفة →