You want the Transients API: get_transient and set_transient (and get/set_site_transient).
These store values in the wp_options table with a namespace and expiry date, so they do persist through page reloads. (As does anything stored in the database, unless you explicitly create per-connection temporary tables.)
Related Posts:
- Write to / remove from default .htaccess file from plugin?
- WordPress Cache delete on plugin uninstall
- WordPress logout appends cache/all/index.php to the site_url()
- Caching of combined CSS and JS fails because of losing MIME types through combining by PHP
- How to get the active theme’s slug?
- Preserve custom URL parameter on more pages
- if plugin is active? check if plugin is enabled or not?
- How to store ACF custom fields data in a custom table
- Errors while using ajax from external wordpress page
- shortcode doesn’t work
- Setting up widgets in wordpress with a unique ID for the after_title argument
- post expire after x days
- How to get all events from ‘All in one Events calender’ plugin in JSON format?
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- Make specific products accessible only to a user role in WooCommerce
- Self deactivate plugins after an action occurs
- wp_redirect() not working in Insert PHP plugin in WordPress
- Avoid class name collision when using third party libraries in plugins?
- How to sanitize uploaded file filename from a plugin?
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- wordpress site | All-in-one-cufon IE Issue
- How to get the element ID from new menu list that added with add_filter()?
- Replacing a plugin function with a custom renamed function doesn’t work
- How to output CMB2 select options from repeated groups select elements?
- How to deal with WordPress and Pocket API to automate content curation on my hosted wordpress blog? [closed]
- WP All Import – Execute Imports
- External RSS feed to WordPress Portfolio
- How to insert HTML/JavaScript form into WordPress page? [closed]
- Create Gallery using Custom Post Type and add sum gallery as sub gallery of Main Gallery
- Notify comment author upon reply
- WordPress get_avatar function not correct working
- Caching RSS plugin data
- w3 Total Cache not Caching – Requested URI is rejected [closed]
- How to Create a shortcode to this php function
- My single.php page does not show the related data to the post which is clicked
- Creating a CSV with PHP inside the plugin directory
- pagination on data fetched using SQL query
- How to check if a taxonomy not exists in a plugin
- Check if variable is set in filter
- Access a particular field in an array
- How to show the number of website visitors in my theme
- JQuery prepend a function
- How to create plugin/ page that reads from database
- I am trying to make a field show and save from quickedit screen
- Send email with list of active plugins upon activation/deactivation
- How to display registered customer list as dropdown in WooCommerce checkout?
- Error When Trying To Login [closed]
- Add the_post_thumbnail_url to a shortcode in function.php
- Adding a Tag Parameter / Filter to My Shortcode
- Cache plugin for medium traffic news blog
- Modify pages widget and make a plugin?
- W3 Total Cache plugin chronic message
- Ajax call not working in wordpress through a plugin
- Strange admin-ajax / CSS / $_SESSION issue
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- Redirect unloggedin users
- How to add custom plugin data to the cart in woocommerce using custom button on product page?
- How to create admin setting for this small plugin
- WP Function does not trigger on Webhook API Call
- Cookie value changes back to previous value after changing
- Allowed memory size of 134217728 … wp-includes/wp-db.php on line 1989
- Undefined offset: 0 in WordPress after latest version upgrade [closed]
- How to fix caching issue in PHP data from database
- Post source link plugin – small modification
- In a plugin, How to update a json file using ajax
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- How to create algorithm for ordering posts in WordPress?
- How to use WordPress header function and footer function and not load word press database
- wp-admin/admin-ajax.php 400 (Bad Request) plugin
- How to echo a PHP Code After the Content
- How to find out programmatically whether any cache plugin is installed in the WordPress website?
- Show custom taxonomy in theme
- Flexslider empty slide
- Conditional Fields depending on checkboxes
- Soflyy WP All Import Custom File Download Issue
- Update (a function) post’s featured image as soon as $image_url changes
- Social sharing plugin directing to blank page after post sharing
- How to order users alphabetically by name? in plugin UPME
- Displaying friend’s posts only
- using href when creating wordpress plugin calls empty page instead of php file
- Media Playlist Plugin
- How to add php stylesheet to admin section instead of admin_head hook
- WordPress Background Audio – Continous AutoPlay
- Replace Dash (-) and Underscore ( _ ) with Space
- How use Dynamic hyperlink on each wordpress post?
- File permissions for wp-minify plugin
- How to execute init or woocommerce_init only for checkout page
- how to restore wordpress backup(.rar) manually?
- White Screen When Includding A Folder With PHP Files
- WordPress create permalink structure for custom post type with userid
- wordpress jquery is not defined because the head tag is empty
- Two sites one PC
- PHP if url extension action=discussion condition use [closed]
- wp_handle_upload – specified file failed upload test
- How to change all the urls of the WordPress site?
- How do I remove the filter from the orders and add custom status in Dokan?
- How to make a Template page to show the information of different things Shop and Product page?
- Split Million WordPress Post’s Into Multiple Database Server
- public custom posts not showing in my wordpress plugin