wp_array_slice_assoc( array $array, array $keys )
Extract a slice of an array, given a list of keys.
Description #Description
Parameters #Parameters
- $array
-
(array) (Required) The original array.
- $keys
-
(array) (Required) The list of keys.
Return #Return
(array) The array slice.
Source #Source
File: wp-includes/functions.php
function wp_array_slice_assoc( $array, $keys ) { $slice = array(); foreach ( $keys as $key ) { if ( isset( $array[ $key ] ) ) { $slice[ $key ] = $array[ $key ]; } } return $slice; }
Expand full source code Collapse full source code View on Trac
Changelog #Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |
Related #Related
Used By #Used By
Used By | Description |
---|---|
wp-includes/general-template.php: wp_get_code_editor_settings() |
Generate and return code editor settings. |
wp-includes/widgets/class-wp-widget-media-gallery.php: WP_Widget_Media_Gallery::enqueue_admin_scripts() |
Loads the required media files for the media manager and scripts for media widgets. |
wp-includes/widgets/class-wp-widget-media-audio.php: WP_Widget_Media_Audio::enqueue_admin_scripts() |
Loads the required media files for the media manager and scripts for media widgets. |
wp-includes/widgets/class-wp-widget-media-video.php: WP_Widget_Media_Video::enqueue_admin_scripts() |
Loads the required scripts and styles for the widget control. |
wp-includes/widgets/class-wp-widget-media.php: WP_Widget_Media::form() |
Outputs the settings update form. |
wp-includes/widgets/class-wp-widget-media-image.php: WP_Widget_Media_Image::enqueue_admin_scripts() |
Loads the required media files for the media manager and scripts for media widgets. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::import_theme_starter_content() |
Import theme starter content into the customized state. |
wp-includes/theme.php: get_theme_starter_content() |
Expand a theme’s starter content configuration using core-provided data. |
wp-includes/class-wp-term-query.php: WP_Term_Query::get_terms() |
Get terms, based on query_vars. |
wp-includes/class-wp-network-query.php: WP_Network_Query::get_networks() |
Gets a list of networks matching the query vars. |
wp-includes/class-wp-site-query.php: WP_Site_Query::get_sites() |
Retrieves a list of sites matching the query vars. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::set_autofocus() |
Set the autofocused constructs. |
wp-includes/class-wp-comment-query.php: WP_Comment_Query::get_comment_ids() |
Used internally to get a list of comment IDs matching the query vars. |
wp-includes/class-wp-comment-query.php: WP_Comment_Query::fill_descendants() |
Fetch descendants for located comments. |
wp-includes/customize/class-wp-customize-nav-menu-setting.php: WP_Customize_Nav_Menu_Setting::sanitize() |
Sanitize an input. |
wp-includes/customize/class-wp-customize-nav-menu-setting.php: WP_Customize_Nav_Menu_Setting::update() |
Create/update the nav_menu term for this setting. |
wp-includes/customize/class-wp-customize-nav-menu-setting.php: WP_Customize_Nav_Menu_Setting::value() |
Get the instance data for a given widget setting. |
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php: WP_Customize_Nav_Menu_Item_Setting::sanitize() |
Sanitize an input. |
wp-includes/class-wp-comment-query.php: WP_Comment_Query::get_comments() |
Get a list of comments matching the query vars. |
wp-includes/class-wp-customize-panel.php: WP_Customize_Panel::json() |
Gather the parameters passed to client JavaScript via JSON. |
wp-includes/class-wp-customize-section.php: WP_Customize_Section::json() |
Gather the parameters passed to client JavaScript via JSON. |
wp-includes/theme.php: _wp_customize_include() |
Includes and instantiates the WP_Customize_Manager class. |
wp-includes/user.php: wp_dropdown_users() |
Create dropdown HTML content of users. |
wp-includes/post.php: get_pages() |
Retrieve a list of pages (or hierarchical post type items). |
wp-includes/author-template.php: wp_list_authors() |
List all the authors of the site, with several options available. |
wp-includes/comment.php: wp_update_comment() |
Updates an existing comment in the database. |
User Contributed Notes #User Contributed Notes
You must log in before being able to contribute a note or feedback.
This will return an associative array with only the key/value pairs that you need.