wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
_wp_remove_unregistered_widgets › WordPress Function
Da4.9.0
Deprecaton/a
› _wp_remove_unregistered_widgets ( $sidebars_widgets, $allowed_widget_ids = array() )
Parametri: (2) |
|
Ritorna: |
|
Definito a: |
|
Codex: |
Compares a list of sidebars with their widgets against an allowed list.
Sorgenti
function _wp_remove_unregistered_widgets( $sidebars_widgets, $allowed_widget_ids = array() ) { if ( empty( $allowed_widget_ids ) ) { $allowed_widget_ids = array_keys( $GLOBALS['wp_registered_widgets'] ); } foreach ( $sidebars_widgets as $sidebar => $widgets ) { if ( is_array( $widgets ) ) { $sidebars_widgets[ $sidebar ] = array_intersect( $widgets, $allowed_widget_ids ); } } return $sidebars_widgets; }