Ticket #17201: revision.diff
File revision.diff, 1.0 KB (added by , 13 years ago) |
---|
-
widgets.php
841 841 function dynamic_sidebar($index = 1) { 842 842 global $wp_registered_sidebars, $wp_registered_widgets; 843 843 844 $sidebars_widgets = wp_get_sidebars_widgets(); 845 844 846 if ( is_int($index) ) { 845 847 $index = "sidebar-$index"; 846 } else { 848 } 849 //Lavinia: optimització rendiment 850 elseif ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) ) { 847 851 $index = sanitize_title($index); 848 852 foreach ( (array) $wp_registered_sidebars as $key => $value ) { 849 853 if ( sanitize_title($value['name']) == $index ) { … … 853 857 } 854 858 } 855 859 856 $sidebars_widgets = wp_get_sidebars_widgets();857 858 860 if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) ) 859 861 return false; 860 862