Articles of transient

Storing temporary data for a custom post type

I’ve created a Rental custom post type to a rental site I’m developing for a client. I’d like to add an ajax availability calendar in the backend so the client can mark/unmark unavailable dates clicking on them, such as this: I need to temporary store the marked dates somewhere so they don’t get lost […]

Workflow for new importer plugin – your advices?

I’m building a new plugin to import Pinterest Pins from a user into WordPress. It will NOT work using the Pinterest API (which is too limited for what I want to do) and requires the user login and password (so it can retrieve the user’s secret boards). I would like to know what you think […]

Transients with dynamic WP_Query

I have a <form> with about 20 inputs (mostly select and number) which each is an argument in WP_Query if filled. I learned today that I could use transients to store results which seems like a good opportunity to ease the blow on server, after all: this is rather complicated query. My plan is: User […]

Transients are not expiring as expected in simple custom plugin

I have developed a simple shortcode plugin that essentially gets txt files from the url provided in the shortcode and parses a specific piece of data from them (date the file was last modified). I am trying to use WP transients to cache the parsed data for 24-48 hours before re-fetching the txt file again. […]

Reset all transients on post or page save

How can I set WordPress to delete transients when a post or a page has been updated or published?

How to write update query in WordPress to expire transients

I want to write update query to expire transients . I will upadte their time to 1 in wordpress option table. My query for update is $wpdb->update( ‘options’, array( ‘option_value’ => ‘1’, // string ), array( ‘option_name’ => ‘%re_compare%’ ) ); Its not working . Basically I want to remove / Expire already existing transients. […]

Storing product price data in the database

I am writing a WordPress plugin to store product data that is pulled from the Amazon Affiliates API. My goal is to have an admin page where I can add new products and view/edit/remove existing products. Essentially I will assign each product a custom slug such as “amazon-miter-saw-blade”, then I can use a shortcode such […]

Custom Plugin Options Won't Update

We wrote a small custom plugin for a client to pull some custom options (set in the WP dashboard) to be used to calculate custom shipping costs in Woocommerce. The issue right now is that changes to the options from the admin panel don’t seem to be reflected in the checkout. The “old” (previous) values […]

Compare transient data with a meta box value

So I’m not sure what would be the best way to go about this in terms of best practices and optimization. Scenario: I have query that parses an external XML feed and stores the data using the transient API every 24 hours. This is stored in wp_options and the whole feed is stored in the […]

passing markup thought a shortcode attribute

Happy holidays everyone. Hope someone can help me in thinking about a problem I’ve run into. I have a plugin Im building that allows the user to pull address data from the maps API – ie it validates an address and if it is a business, pulls the marker icon, address details, web link etc. […]