Last active
September 19, 2024 11:35
-
-
Save XTechnology-TR/055be110bb5066f6f4a3abdf7494be9e to your computer and use it in GitHub Desktop.
PHP Uyarısı: Tanımsız dizi anahtarı (seo-by-rank-math-pro)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Şu dosyada ki _/wp-content/plugins/seo-by-rank-math-pro/includes/modules/analytics/class-posts.php_ | |
ranking_keyword_array_sort Fonksiyonu aşağıdakilerle güncelledim: | |
``` | |
public function ranking_keyword_array_sort( $arr, $arr_order, $arr_orderby ) { | |
if ( 'DESC' === $arr_order ) { | |
uasort( | |
$arr, | |
function( $a, $b ) use ( $arr_orderby ) { | |
$a_total = isset($a[$arr_orderby]) && is_array($a[$arr_orderby]) && isset($a[$arr_orderby]['total']) ? $a[$arr_orderby]['total'] : 0; | |
$b_total = isset($b[$arr_orderby]) && is_array($b[$arr_orderby]) && isset($b[$arr_orderby]['total']) ? $b[$arr_orderby]['total'] : 0; | |
return $a_total < $b_total; | |
} | |
); | |
} | |
if ( 'ASC' === $arr_order ) { | |
uasort( | |
$arr, | |
function( $a, $b ) use ( $arr_orderby ) { | |
$a_total = isset($a[$arr_orderby]) && is_array($a[$arr_orderby]) && isset($a[$arr_orderby]['total']) ? $a[$arr_orderby]['total'] : 0; | |
$b_total = isset($b[$arr_orderby]) && is_array($b[$arr_orderby]) && isset($b[$arr_orderby]['total']) ? $b[$arr_orderby]['total'] : 0; | |
return $a_total > $b_total; | |
} | |
); | |
} | |
return $arr; | |
} | |
``` | |
Şimdilik hatalar çözülmüş gibi görünüyor, eminim Rankmath Pro'nun bu sorun için bir düzeltme yayınlaması gerekecektir. | |
Güncellediğim fonksiyonda sadece dizi içerisinde değer olup olmadığını kontrol ediyor, böylece uyarı vermiyor. | |
Umarım yardımcı olur! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment