Uses
Uses | Description |
---|---|
wp-includes/class-wp-object-cache.php: WP_Object_Cache::set() | Sets the data contents into the cache. |
Saves the data to the cache.
Differs from wp_cache_add() and wp_cache_replace() in that it will always write data.
(int|string) (Required) The cache key to use for retrieval later.
(mixed) (Required) The contents to store in the cache.
(string) (Optional) Where to group the cache contents. Enables the same key to be used across groups.
Default value: ''
(int) (Optional) When to expire the cache contents, in seconds. Default 0 (no expiration).
(bool) True on success, false on failure.
File: wp-includes/cache.php
function wp_cache_set( $key, $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->set( $key, $data, $group, (int) $expire ); }
Uses | Description |
---|---|
wp-includes/class-wp-object-cache.php: WP_Object_Cache::set() | Sets the data contents into the cache. |
Used By | Description |
---|---|
wp-includes/ms-site.php: wp_cache_set_sites_last_changed() | Sets the last changed time for the ‘sites’ cache group. |
wp-includes/taxonomy.php: wp_cache_set_terms_last_changed() | Sets the last changed time for the ‘terms’ cache group. |
wp-includes/comment.php: wp_cache_set_comments_last_changed() | Sets the last changed time for the ‘comment’ cache group. |
wp-includes/post.php: wp_cache_set_posts_last_changed() | Sets the last changed time for the ‘posts’ cache group. |
wp-admin/includes/class-wp-privacy-requests-table.php: WP_Privacy_Requests_Table::get_request_counts() | Count number of requests for each status. |
wp-includes/class-wp-embed.php: WP_Embed::find_oembed_post_id() | Find the oEmbed cache post ID for a given cache key. |
wp-includes/class-wp-customize-manager.php: WP_Customize_Manager::find_changeset_post_id() | Find the changeset post ID for a given changeset UUID. |
wp-includes/functions.php: wp_cache_get_last_changed() | Gets last changed date for the specified cache group. |
wp-includes/class-wp-term-query.php: WP_Term_Query::get_terms() | Get terms, based on query_vars. |
wp-includes/ms-network.php: clean_network_cache() | Removes a network from the object cache. |
wp-includes/class-wp-site.php: WP_Site::get_details() | Retrieves the details for this site. |
wp-includes/class-wp-comment-query.php: WP_Comment_Query::fill_descendants() | Fetch descendants for located comments. |
wp-includes/option.php: update_network_option() | Updates the value of a network option that was already added. |
wp-includes/option.php: add_network_option() | Adds a new network option. |
wp-includes/option.php: get_network_option() | Retrieves a network’s option value based on the option name. |
wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::column_users() | Handles the users column output. |
wp-admin/includes/plugin.php: get_plugins() | Check the plugins directory and retrieve all plugin files with plugin data. |
wp-includes/general-template.php: wp_get_archives() | Display archive links based on type and format. |
wp-includes/general-template.php: get_calendar() | Display calendar with days that have posts as links. |
wp-includes/functions.php: is_blog_installed() | Determines whether WordPress is already installed. |
wp-includes/taxonomy.php: is_object_in_term() | Determine if the given object is associated with any of the given terms. |
wp-includes/taxonomy.php: clean_term_cache() | Will remove all of the term IDs from the cache. |
wp-includes/taxonomy.php: get_objects_in_term() | Retrieve object_ids of valid taxonomy and term. |
wp-includes/link-template.php: get_adjacent_post() | Retrieves the adjacent post. |
wp-includes/option.php: set_site_transient() | Sets/updates the value of a site transient. |
wp-includes/option.php: set_transient() | Sets/updates the value of a transient. |
wp-includes/option.php: wp_load_core_site_options() | Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used. |
wp-includes/option.php: update_option() | Updates the value of an option that was already added. |
wp-includes/option.php: add_option() | Adds a new option. |
wp-includes/option.php: delete_option() | Removes option by name. Prevents removal of protected WordPress options. |
wp-includes/option.php: get_option() | Retrieves an option value based on an option name. |
wp-includes/post.php: clean_post_cache() | Will clean the post in the cache. |
wp-includes/post.php: _get_last_post_time() | Gets the timestamp of the last time any post was modified or published. |
wp-includes/post.php: get_page_by_path() | Retrieves a page given its path. |
wp-includes/post.php: get_pages() | Retrieve a list of pages (or hierarchical post type items). |
wp-includes/post.php: wp_count_posts() | Count number of posts of a post type and if user has permissions to view. |
wp-includes/ms-functions.php: wpmu_create_blog() | Create a site. |
wp-includes/ms-functions.php: get_blog_id_from_url() | Get a blog’s numeric ID from its URL. |
wp-includes/bookmark.php: get_bookmarks() | Retrieves the list of bookmarks |
wp-includes/ms-site.php: clean_blog_cache() | Clean the blog cache |
wp-includes/ms-blogs.php: get_blog_details() | Retrieve the details for a blog from the blogs table and blog options. |
wp-includes/comment.php: clean_comment_cache() | Removes a comment from the object cache. |
wp-includes/comment.php: wp_count_comments() | Retrieves the total comment counts for the whole site or a single post. |
wp-includes/comment.php: get_lastcommentmodified() | The date the last comment was modified. |
Version | Description |
---|---|
2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_cache_set