wp_parse_args( string|array|object $args, array $defaults = '' )
Merge user defined arguments into defaults array.
Description
This function is used throughout ClassicPress to allow for both string or array to be merged into another array.
Parameters
- $args
-
(Required) Value to merge with $defaults.
- $defaults
-
(Optional) Array that serves as the defaults.
Default value: ''
Return
(array) Merged user defined values with defaults.
Source
File: wp-includes/functions.php
function wp_parse_args( $args, $defaults = '' ) {
if ( is_object( $args ) )
$r = get_object_vars( $args );
elseif ( is_array( $args ) )
$r =& $args;
else
wp_parse_str( $args, $r );
if ( is_array( $defaults ) )
return array_merge( $defaults, $r );
return $r;
}
Related
Uses
Uses | Description |
---|---|
wp-includes/formatting.php: wp_parse_str() |
Parses a string into variables to be stored in an array. |
Used By
Used By | Description |
---|---|
wp-includes/author-template.php: wp_list_authors() |
List all the authors of the site, with several options available. |
wp-includes/deprecated.php: wp_get_links() |
Gets the links associated with category. |
wp-includes/deprecated.php: wp_list_cats() |
Lists categories. |
wp-includes/deprecated.php: wp_get_linksbyname() |
Gets the links associated with the named category. |
wp-includes/customize/class-wp-customize-media-control.php: WP_Customize_Media_Control::__construct() |
Constructor. |
wp-includes/general-template.php: paginate_links() |
Retrieve paginated link for archive post pages. |
wp-includes/general-template.php: feed_links() |
Display the links to the general feeds. |
wp-includes/general-template.php: feed_links_extra() |
Display the links to the extra feeds such as category feeds. |
wp-includes/general-template.php: wp_get_archives() |
Display archive links based on type and format. |
wp-includes/general-template.php: wp_login_form() |
Provides a simple login form for use anywhere within ClassicPress. |
wp-includes/class-wp-user-query.php: WP_User_Query::fill_query_vars() |
Fills in missing query variables with default values. |
wp-includes/rest-api/class-wp-rest-server.php: WP_REST_Server::get_routes() |
Retrieves the route map. |
wp-includes/widgets/class-wp-widget-calendar.php: WP_Widget_Calendar::form() |
Outputs the settings form for the Calendar widget. |
wp-includes/widgets/class-wp-widget-text.php: WP_Widget_Text::update() |
Handles updating settings for the current Text widget instance. |
wp-includes/widgets/class-wp-widget-text.php: WP_Widget_Text::form() |
Outputs the Text widget settings form. |
wp-includes/widgets/class-wp-widget-links.php: WP_Widget_Links::form() |
Outputs the settings form for the Links widget. |
wp-includes/widgets/class-wp-widget-search.php: WP_Widget_Search::form() |
Outputs the settings form for the Search widget. |
wp-includes/widgets/class-wp-widget-search.php: WP_Widget_Search::update() |
Handles updating settings for the current Search widget instance. |
wp-includes/widgets/class-wp-widget-pages.php: WP_Widget_Pages::form() |
Outputs the settings form for the Pages widget. |
wp-includes/widgets/class-wp-widget-custom-html.php: WP_Widget_Custom_HTML::form() |
Outputs the Custom HTML widget settings form. |
wp-includes/widgets/class-wp-widget-categories.php: WP_Widget_Categories::form() |
Outputs the settings form for the Categories widget. |
wp-includes/widgets/class-wp-widget-media-image.php: WP_Widget_Media_Image::render_media() |
Render the media on the frontend. |
wp-includes/widgets/class-wp-widget-archives.php: WP_Widget_Archives::update() |
Handles updating settings for the current Archives widget instance. |
wp-includes/widgets/class-wp-widget-archives.php: WP_Widget_Archives::form() |
Outputs the settings form for the Archives widget. |
wp-includes/widgets/class-wp-widget-meta.php: WP_Widget_Meta::form() |
Outputs the settings form for the Meta widget. |
wp-includes/widgets/class-wp-widget-media.php: WP_Widget_Media::__construct() |
Constructor. |
wp-includes/widgets/class-wp-widget-media.php: WP_Widget_Media::widget() |
Displays the widget on the front-end. |
wp-includes/widgets/class-wp-widget-media.php: WP_Widget_Media::form() |
Outputs the settings update form. |
wp-includes/class-wp-taxonomy.php: WP_Taxonomy::set_props() |
Sets taxonomy properties. |
wp-includes/class-wp-post-type.php: WP_Post_Type::set_props() |
Sets post type properties. |
wp-includes/class-wp-http-streams.php: WP_Http_Streams::request() |
Send a HTTP request to a URI using PHP Streams. |
wp-includes/media.php: wp_enqueue_media() |
Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
wp-includes/media.php: wp_get_attachment_image() |
Get an HTML img element representing an image attachment |
wp-includes/l10n.php: wp_dropdown_languages() |
Language selector. |
wp-includes/class-wp-query.php: WP_Query::query() |
Sets up the ClassicPress query by parsing query string. |
wp-includes/class-wp-query.php: WP_Query::parse_query() |
Parse a query string and set query type booleans. |
wp-includes/class-wp-http-curl.php: WP_Http_Curl::request() |
Send a HTTP request to a URI using cURL extension. |
wp-includes/pluggable.php: get_avatar() |
Retrieve the avatar |
wp-includes/pluggable.php: wp_text_diff() |
Displays a human readable HTML representation of the difference between two strings. |
wp-includes/class-wp-widget.php: WP_Widget::__construct() |
PHP5 constructor. |
wp-includes/class-wp-widget.php: WP_Widget::display_callback() |
Generates the actual widget content (Do NOT override). |
wp-includes/class-wp-widget.php: WP_Widget::form_callback() |
Generates the widget control form (Do NOT override). |
wp-includes/bookmark-template.php: _walk_bookmarks() |
The formatted output of a list of bookmarks. |
wp-includes/bookmark-template.php: wp_list_bookmarks() |
Retrieve or echo all of the bookmarks. |
wp-includes/class-wp-comment.php: WP_Comment::get_children() |
Get the children of a comment. |
wp-includes/class-wp-network-query.php: WP_Network_Query::parse_query() |
Parses arguments passed to the network query with default query parameters. |
wp-includes/class-wp-network-query.php: WP_Network_Query::query() |
Sets up the ClassicPress query for retrieving networks. |
wp-includes/nav-menu.php: wp_update_nav_menu_item() |
Save the properties of a menu item or create a new one. |
wp-includes/nav-menu.php: wp_get_nav_menus() |
Returns all navigation menu objects. |
wp-includes/nav-menu.php: wp_get_nav_menu_items() |
Retrieves all menu items of a navigation menu. |
wp-includes/comment.php: get_page_of_comment() |
Calculate what page number a comment will appear on for comment paging. |
wp-includes/class-wp-ajax-response.php: WP_Ajax_Response::add() |
Appends data to an XML response based on given arguments. |
wp-includes/nav-menu-template.php: wp_nav_menu() |
Displays a navigation menu. |
wp-includes/comment.php: get_approved_comments() |
Retrieve the approved comments for post $post_id. |
wp-includes/bookmark.php: get_bookmarks() |
Retrieves the list of bookmarks |
wp-includes/class-wp-embed.php: WP_Embed::shortcode() |
The do_shortcode() callback function. |
wp-includes/embed.php: wp_filter_pre_oembed_result() |
Filters the oEmbed result before any HTTP requests are made. |
wp-includes/class-wp-admin-bar.php: WP_Admin_Bar::add_node() |
Adds a node to the menu. |
wp-includes/link-template.php: get_avatar_data() |
Retrieves default data about the avatar. |
wp-includes/link-template.php: paginate_comments_links() |
Displays or retrieves pagination links for the comments on the current post. |
wp-includes/link-template.php: get_the_comments_navigation() |
Retrieves navigation to next/previous set of comments, when applicable. |
wp-includes/link-template.php: get_the_comments_pagination() |
Retrieves a paginated navigation to next/previous set of comments, when applicable. |
wp-includes/link-template.php: get_posts_nav_link() |
Retrieves the post pages link navigation for previous and next pages. |
wp-includes/link-template.php: get_the_post_navigation() |
Retrieves the navigation to next/previous post, when applicable. |
wp-includes/link-template.php: get_the_posts_navigation() |
Returns the navigation to next/previous set of posts, when applicable. |
wp-includes/link-template.php: get_the_posts_pagination() |
Retrieves a paginated navigation to next/previous set of posts, when applicable. |
wp-includes/ms-deprecated.php: wp_get_sites() |
Return an array of sites for a network or networks. |
wp-includes/class-http.php: WP_Http::request() |
Send an HTTP request to a URI. |
wp-includes/class-http.php: WP_Http::post() |
Uses the POST HTTP method. |
wp-includes/class-http.php: WP_Http::get() |
Uses the GET HTTP method. |
wp-includes/class-http.php: WP_Http::head() |
Uses the HEAD HTTP method. |
wp-includes/meta.php: register_meta() |
Registers a meta key. |
wp-includes/user.php: wp_dropdown_users() |
Create dropdown HTML content of users. |
wp-includes/user.php: get_users() |
Retrieve list of users matching criteria. |
wp-includes/theme.php: add_theme_support() |
Registers theme support for a given feature. |
wp-includes/theme.php: wp_update_custom_css_post() |
Update the |
wp-includes/theme.php: get_header_image_tag() |
Create image tag markup for a custom header image. |
wp-includes/theme.php: get_custom_header() |
Get the header image data. |
wp-includes/theme.php: wp_get_themes() |
Returns an array of WP_Theme objects based on the arguments. |
wp-includes/class-wp-xmlrpc-server.php: wp_xmlrpc_server::_insert_post() |
Helper method for wp_newPost() and wp_editPost(), containing shared logic. |
wp-includes/category-template.php: get_term_parents_list() |
Retrieve term parents with separator. |
wp-includes/category-template.php: wp_tag_cloud() |
Display tag cloud. |
wp-includes/category-template.php: wp_generate_tag_cloud() |
Generates a tag cloud (heatmap) from provided data. |
wp-includes/category-template.php: wp_dropdown_categories() |
Display or retrieve the HTML dropdown list of categories. |
wp-includes/category-template.php: wp_list_categories() |
Display or retrieve the HTML list of categories. |
wp-includes/option.php: register_setting() |
Register a setting and its data. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::validate_setting_values() |
Validates setting values. |
wp-includes/post-template.php: wp_dropdown_pages() |
Retrieve or display list of pages as a dropdown (select list). |
wp-includes/post-template.php: wp_list_pages() |
Retrieve or display list of pages (or hierarchical post type items) in list (li) format. |
wp-includes/post-template.php: wp_page_menu() |
Displays or retrieves a list of pages with an optional home link. |
wp-includes/post-template.php: wp_link_pages() |
The formatted output of a list of pages. |
wp-includes/post-template.php: the_title_attribute() |
Sanitize the current title when retrieving or displaying. |
wp-includes/class-wp-rewrite.php: WP_Rewrite::add_permastruct() |
Adds a new permalink structure. |
wp-includes/class-wp-term-query.php: WP_Term_Query::parse_query() |
Parse arguments passed to the term query with default query parameters. |
wp-includes/class-wp-term-query.php: WP_Term_Query::query() |
Sets up the query for retrieving terms. |
wp-includes/rest-api.php: register_rest_field() |
Registers a new field on an existing ClassicPress object type. |
wp-includes/post.php: get_pages() |
Retrieve a list of pages (or hierarchical post type items). |
wp-includes/post.php: wp_insert_attachment() |
Insert an attachment. |
wp-includes/post.php: wp_get_post_categories() |
Retrieve the list of categories for a post. |
wp-includes/post.php: wp_get_post_terms() |
Retrieves the terms for a post. |
wp-includes/post.php: wp_get_recent_posts() |
Retrieve a number of recent posts. |
wp-includes/post.php: wp_insert_post() |
Insert or update a post. |
wp-includes/post.php: get_posts() |
Retrieve list of latest posts or posts matching criteria. |
wp-includes/post.php: register_post_status() |
Register a post status. Do not use before init. |
wp-includes/post.php: get_children() |
Retrieve all children of the post parent ID. |
wp-includes/class-wp-site-query.php: WP_Site_Query::parse_query() |
Parses arguments passed to the site query with default query parameters. |
wp-includes/class-wp-site-query.php: WP_Site_Query::query() |
Sets up the ClassicPress query for retrieving sites. |
wp-includes/ms-functions.php: wpmu_create_blog() |
Create a site. |
wp-includes/class-wp-editor.php: _WP_Editors::parse_settings() |
Parse default arguments for the editor instance. |
wp-includes/class-wp-comment-query.php: WP_Comment_Query::parse_query() |
Parse arguments passed to the comment query with default query parameters. |
wp-includes/class-wp-comment-query.php: WP_Comment_Query::query() |
Sets up the ClassicPress query for retrieving comments. |
wp-includes/category.php: get_categories() |
Retrieve list of category objects. |
wp-includes/taxonomy.php: get_the_taxonomies() |
Retrieve all taxonomies associated with a post. |
wp-includes/taxonomy.php: the_taxonomies() |
Display the taxonomies of a post with available options. |
wp-includes/taxonomy.php: wp_update_term() |
Update term based on arguments provided. |
wp-includes/taxonomy.php: wp_count_terms() |
Count how many terms are in Taxonomy. |
wp-includes/taxonomy.php: wp_delete_term() |
Removes a term from the database. |
wp-includes/taxonomy.php: wp_get_object_terms() |
Retrieves the terms associated with the given object(s), in the supplied taxonomies. |
wp-includes/taxonomy.php: wp_insert_term() |
Add a new term to the database. |
wp-includes/taxonomy.php: get_objects_in_term() |
Retrieve object_ids of valid taxonomy and term. |
wp-includes/taxonomy.php: get_terms() |
Retrieve the terms in a given taxonomy or list of taxonomies. |
wp-includes/revision.php: wp_get_post_revisions() |
Returns all revisions of specified post. |
wp-includes/taxonomy.php: register_taxonomy() |
Creates or modifies a taxonomy object. |
wp-includes/comment-template.php: wp_list_comments() |
List comments. |
wp-includes/comment-template.php: comment_form() |
Outputs a complete commenting form for use within a template. |
wp-includes/comment-template.php: get_comment_reply_link() |
Retrieve HTML content for reply to comment link. |
wp-includes/comment-template.php: get_post_reply_link() |
Retrieve HTML content for reply to post link. |
wp-includes/comment-template.php: get_comment_link() |
Retrieve the link to a given comment. |
wp-includes/class-oembed.php: WP_oEmbed::get_provider() |
Takes a URL and returns the corresponding oEmbed provider’s URL, if there is one. |
wp-includes/class-oembed.php: WP_oEmbed::get_data() |
Takes a URL and attempts to return the oEmbed data. |
wp-includes/class-oembed.php: WP_oEmbed::fetch() |
Connects to a oEmbed provider and returns the result. |
wp-includes/widgets.php: the_widget() |
Output an arbitrary widget as a template tag. |
wp-includes/widgets.php: wp_widget_rss_output() |
Display the RSS entries in a list. |
wp-includes/widgets.php: wp_widget_rss_form() |
Display RSS widget options form. |
wp-includes/widgets.php: wp_register_widget_control() |
Registers widget control callback for customizing options. |
wp-includes/widgets.php: _register_widget_form_callback() |
Registers the form callback for a widget. |
wp-includes/widgets.php: register_sidebar() |
Builds the definition for a single sidebar and returns the ID. |
wp-includes/widgets.php: wp_register_sidebar_widget() |
Register an instance of a widget. |
wp-includes/functions.php: _ajax_wp_die_handler() |
Kill ClassicPress ajax execution. |
wp-includes/functions.php: _default_wp_die_handler() |
Kills ClassicPress execution and display HTML message with error message. |
wp-includes/functions.php: _xmlrpc_wp_die_handler() |
Kill ClassicPress execution and display XML message with error message. |
wp-admin/includes/class-wp-screen.php: WP_Screen::add_help_tab() |
Add a help tab to the contextual help for the screen. |
wp-admin/includes/class-wp-screen.php: WP_Screen::set_screen_reader_content() |
Add accessible hidden headings and text for the screen. |
wp-admin/includes/class-wp-screen.php: WP_Screen::render_screen_options() |
Render the screen options tab. |
wp-admin/includes/class-theme-upgrader-skin.php: Theme_Upgrader_Skin::__construct() | |
wp-admin/includes/class-wp-list-table.php: WP_List_Table::__construct() |
Constructor. |
wp-admin/includes/class-wp-list-table.php: WP_List_Table::set_pagination_args() |
An internal method that sets all the necessary pagination arguments |
wp-admin/includes/media.php: get_media_item() |
Retrieve HTML form for modifying the image attachment. |
wp-admin/includes/media.php: get_compat_media_markup() | |
wp-admin/includes/template.php: wp_star_rating() |
Output a HTML element with a star rating for a given rating. |
wp-admin/includes/class-bulk-upgrader-skin.php: Bulk_Upgrader_Skin::__construct() | |
wp-admin/includes/template.php: wp_terms_checklist() |
Output an unordered list of checkbox input elements labelled with term names. |
wp-admin/includes/class-wp-upgrader-skin.php: WP_Upgrader_Skin::__construct() | |
wp-admin/includes/class-theme-upgrader.php: Theme_Upgrader::install() |
Install a theme package. |
wp-admin/includes/class-theme-upgrader.php: Theme_Upgrader::upgrade() |
Upgrade a theme. |
wp-admin/includes/class-theme-upgrader.php: Theme_Upgrader::bulk_upgrade() |
Upgrade several themes at once. |
wp-admin/includes/class-core-upgrader.php: Core_Upgrader::upgrade() |
Upgrade ClassicPress core. |
wp-admin/includes/bookmark.php: wp_insert_link() |
Inserts/updates links into/in the database. |
wp-admin/includes/ajax-actions.php: wp_ajax_query_themes() |
Ajax handler for getting themes from themes_api(). |
wp-admin/includes/class-wp-upgrader.php: WP_Upgrader::install_package() |
Install a package. |
wp-admin/includes/class-wp-upgrader.php: WP_Upgrader::run() |
Run an upgrade/installation. |
wp-admin/includes/meta-boxes.php: post_tags_meta_box() |
Display post tags form fields. |
wp-admin/includes/meta-boxes.php: post_categories_meta_box() |
Display post categories form fields. |
wp-admin/includes/class-plugin-upgrader-skin.php: Plugin_Upgrader_Skin::__construct() | |
wp-admin/includes/class-theme-installer-skin.php: Theme_Installer_Skin::__construct() | |
wp-admin/includes/export.php: export_wp() |
Generates the WXR export file for download. |
wp-admin/includes/class-language-pack-upgrader-skin.php: Language_Pack_Upgrader_Skin::__construct() | |
wp-admin/includes/class-language-pack-upgrader.php: Language_Pack_Upgrader::bulk_upgrade() |
Bulk upgrade language packs. |
wp-admin/includes/class-plugin-installer-skin.php: Plugin_Installer_Skin::__construct() | |
wp-admin/includes/class-plugin-upgrader.php: Plugin_Upgrader::upgrade() |
Upgrade a plugin. |
wp-admin/includes/class-plugin-upgrader.php: Plugin_Upgrader::bulk_upgrade() |
Bulk upgrade several plugins at once. |
wp-admin/includes/class-plugin-upgrader.php: Plugin_Upgrader::install() |
Install a plugin package. |
wp-admin/includes/ms.php: network_edit_site_nav() |
Outputs the HTML for a network’s “Edit Site” tabular interface. |
wp-admin/includes/taxonomy.php: wp_insert_category() |
Updates an existing Category or creates a new Category. |
wp-admin/includes/class-wp-terms-list-table.php: WP_Terms_List_Table::display_rows_or_placeholder() |
Changelog
Version | Description |
---|---|
WP-2.3.0 | $args can now also be an object. |
WP-2.2.0 | Introduced. |