- 상태
- 개발자가 해결함
- 관련 플러그인/테마
- 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