Restrict access to post if it is currently being edited

Posted by Prem Tiwari | Updated on | in WordPress.


In this post, you will learn how to restrict access to post if it is currently being edited in your WordPress site. The warning notice gets dispatched by the function wp_check_post_lock. The following redirects the …

How to rewrite URI of custom post type in WordPress?

Posted by Prem Tiwari | Updated on | in WordPress, WordPress Core.


In this post, I will share how to rewrite URI of custom post type in WordPress. This is what I use to rewrite custom post type URLs with the post ID. You need a rewrite …

How to add item to media library from blob or dataUrl?

Posted by Prem Tiwari | Updated on | in WordPress.


There is no direct way to pass pure binary data to the WP upload object. Only File based objects will be processed. I had to create a separate XmlHttpRequest. (Simply using $.ajax() did not work …

List of WordPress CLI commands with description

Posted by Editorial Staff | Updated on | in WordPress.


In this tutorial, we will learn about the list of WordPress CLI commands with description. WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installations and much more, without using a …

WooCommerce | woocommerce_content() Function

Posted by Editorial Staff | Updated on | in WordPress Functions.


The woocommerce_content() is a builtin WooCommerce function which allows you to create a new template page within your theme that is used for all WooCommerce taxonomy and post type displays. While an easy catch-all solution, …

WordPress | get_registered_nav_menus() function

Posted by Editorial Staff | Updated on | in WordPress Functions.


The get_registered_nav_menus() is the WordPress builtin function to retrieves all registered navigation menu locations in a theme. WordPress get_registered_nav_menus() function example 2. WordPress get_registered_nav_menus() function example 3. WordPress get_registered_nav_menus() function example

WordPress | clean_post_cache() function

Posted by Editorial Staff | Updated on | in WordPress Functions.


The check_and_publish_future_post() is the WordPress builtin function to clean the post in the cache. This function not run if $_wp_suspend_cache_invalidation is not empty. Cleaning means delete from the cache of the post. Will call to …

WordPress | check_and_publish_future_post() function

Posted by Editorial Staff | Updated on | in WordPress Functions.


The check_and_publish_future_post() is the WordPress builtin function to publish future post and make sure post ID has future post status. WordPress check_and_publish_future_post() function invoked by cron ‘publish_future_post’ event. This safeguard prevents cron from publishing drafts, …

WordPress get_lastpostmodified() Function

Posted by Prem Tiwari | Updated on | in WordPress Functions.


The get_lastpostmodified() is a WordPress builtin function to get the most recent time that a post on the site was modified. It will return the timestamp in ‘Y-m-d H:i:s’ format. The server timezone is the …

WordPress add_meta_box() Function

Posted by Prem Tiwari | Updated on | in WordPress Functions.


The add_meta_box() is a WordPress builtin function which adds a meta box to one or more screens. Syntax: Parameters 1. $id: (string) (Required) Meta box ID (used in the ‘id’ attribute for the meta box). …

How To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts

Posted by Prem Tiwari | Updated on | in WordPress, WordPress Functions.


After this tutorial, You know how To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts. The WP_Posts_List_Table class extends WP_List_Table and within the WP_List_Table::views() method we have the following dynamic views filter: …

Complete WordPress Function Reference

Posted by Prem Tiwari | Updated on | in WordPress Functions.


Want to know what’s going on inside WordPress? Search the Code Reference for more information about WordPress’ functions, classes, methods, and hooks. In this document, I am sharing the complete WordPress function reference. Below are …

WordPress User and Author Functions

Posted by Prem Tiwari | Updated on | in WordPress Functions.


Below are the lists of WordPress user and author function This list also includes the deprecated functions. Function with red colour is deprecated in new version of WordPress. WordPress User and Author Functions Below are …

WordPress Comment, Ping, and Trackback Functions

Posted by Prem Tiwari | Updated on | in WordPress Functions.


Below are the list of WordPress comment, ping, and trackback functions. WordPress Comment, Ping, and Trackback Functions Below are the list of WordPress comment, ping, and trackback functions list: add_ping add_comment_meta check_comment comment_text comment_form comments_number …

WordPress Admin Menu Functions

Posted by Prem Tiwari | Updated on | in WordPress Functions.


Below are the lists of WordPress admin menu functions. You can use the below functions while developing a new Theme or Plugins. WordPress Admin Menu Functions List Below are the list of WordPress admin menu …