Migrate Specific Posts or Attachments With a Third WordPress Install Duplicate the Site and Delete Posts That Won’t Move The Built-in Tools > Export Feature Preserves Post IDs An easy way to move WordPress content from one site to another is with the built-in XML import and export scripts located under the Tools menu. This… Continue reading Migrate Specific WordPress Posts or Attachments
Category: WordPress
Use Gravity Forms Merge Tags in HTML Fields
I wrote and released a small WordPress plugin. It’s an add-on for Gravity Forms that enables Merge Tags in HTML Fields. When I build complex forms, it’s nice to make the last page of the form show the user the most critical values they provided and ask them to confirm there are no mistakes. I… Continue reading Use Gravity Forms Merge Tags in HTML Fields
Show Attachments on The Events Calendar
Out of the box, The Events Calendar plugin for WordPress is amazing and a pleasure to work with as a developer. However, it does not show users Media Library uploads that are attached to event posts. I made a plugin to bring this functionality to the Single Event view, it’s free and open-source, and you… Continue reading Show Attachments on The Events Calendar
How to Delete Meta Fields with the WordPress REST API
As of this writing, it is not possible to delete a meta value using the WordPress REST API. Post meta updates must be communicated while inserting and updating post objects, and the only way to “remove” meta fields is to write blank values over their current values. I wrote a free and open-source plugin to… Continue reading How to Delete Meta Fields with the WordPress REST API
Hiding Specific Terms When Creating or Editing Posts
The WordPress block editor uses the REST API to manipulate all information in the post object, so hiding terms from the category, tags, or a custom taxonomy meta box can be achieved by removing those terms from REST API responses. One hook that makes this easy is the rest_{taxonomy}_collection_params filter. Here is an example that… Continue reading Hiding Specific Terms When Creating or Editing Posts
WordPress Memes
This is the collection of all the WordPress memes I’ve created. You Should Make Plugins Is This a PHP File? But Her Editors
Why Elementor Disobeys is_admin()
I was surprised to learn that when editing a page using Elementor‘s page builder, is_admin() returns false. The reason for this is that Elementor is loading the page in an <iframe> element as if it were being viewed on the front-end. Use code like this to detect when posts or pages are being edited in… Continue reading Why Elementor Disobeys is_admin()
Using register_setting() and the REST API
Here is a comment I just requested be added to the bottom of the register_setting() page. If you plan to use your setting in the REST API, use both the rest_api_init and admin_init hooks when calling register_setting() instead of just admin_init. The show_in_rest argument is ineffective when hooked into admin_init alone. Corey Salzano Someday, when my comment is approved, you’ll be able to see it on… Continue reading Using register_setting() and the REST API
The Events Calendar List Widget Replacement
I wrote a plugin to customize the Events List widget that ships with Modern Tribe’s The Events Calendar Pro plugin. The widget has an option to hide completely when there are no upcoming events. The alternative displays the dreaded “There are no upcoming events at this time” in an otherwise empty Events List widget. I… Continue reading The Events Calendar List Widget Replacement
Editing Terms & Term Meta with the WordPress REST API
Here are some JavaScript snippets to manipulate WP_Term objects in WordPress using the REST API and the Backbone JavaScript client library. Insert a term Delete a term This next example assumes you’ve used wp_localize_script() to make the REST API endpoint and a nonce available in an object myplugin. If you need help doing this, please… Continue reading Editing Terms & Term Meta with the WordPress REST API
Disable tooltips on The Events Calendar month view
Here is a file you could save in wp-content/your-theme/tribe-events/month/content.php that will disable tooltips on the month view calendar produced by The Events Calendar plugin. This is a template override for the month view that adds a few lines of JavaScript to remove some event handlers, and it removes a call loading the tooltip template. The… Continue reading Disable tooltips on The Events Calendar month view
What is $posted_data passed to Contact Form 7’s wpcf7_posted_data hook
For a ContactForm7 form that has this source: <div class=”wpcf7-lead-widget”>[text* contact-name maxlength:50 placeholder “Your Name (required)”] [email* email maxlength:50 placeholder “Email (required)”] [text phone maxlength:15 placeholder “Phone”] [vehicle_form_field] [textarea comments x3 placeholder “Questions and Comments”] [submit class:_button class:_button-small “Check Availability”] [hidden context id:context “contact”] [hidden do-not-send-mail]</div> The $posted_data that is passed via the wpcf7_posted_data hook… Continue reading What is $posted_data passed to Contact Form 7’s wpcf7_posted_data hook