Advertisement

WP CLI Commands

WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installs, and much more, without using a web browser. Below is the complete list of WP CLI commands generated with WP CLI Commands Cheat Sheet (Complete List of WP CLI Commands) Cache wp cache add Docs | Git wp cache decr Docs | Git

Search Post by Post Meta in Rest API

WordPress provides the Rest API support for post, pages and custom post types which have set the show_in_rest parameter as true. We have also the Rest API support for the tags, categories and custom taxonomies which have same show_in_rest parameter as true. Overview We have Rest API endpoints for the post & pages as below:

mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files

While I have started the XAMPP after a long break up to 1/2 months and I got the error ‘mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files’. To fix this error I have deleted the file¬†aria_log.00000001 from location D:\xampp\mysql\data\ MySql errors: 2018-05-07 19:36:12 1f84 InnoDB: Warning:

Advertisement

Create a simple shortcode in WordPress

Use code snippet to create a simple WordPress shortcode. I have created a sample shortcode prefix-portfolio¬†with 2 attributes. Before use change: Change the Prefix with your own unique prefix. Change the prefix with your own unique prefix. How to use? Create a new page and add shortcode. Open the page. It’ll show the¬†output of the

Individual site upload limit notice

Show individual site upload limit notice on media page WordPress (Only for Multisite) Eg. Snippet <?php /** * [ONLY FOR MULTISITE] * * Show individual site upload limit notice. * * E.g. * * 1. Max upload limit 1024 MB and available limit 258 MB. * 2. Max upload limit 1024 MB and available limit

Advertisement

Add post meta in post (custom post type) endpoint with Rest API

Add post meta in post (custom post type) endpoint with Rest API. Todo: Change post-type with your post type slug. Change prefix-meta-key with your post meta key which you want to include in Rest API Response. Output: Visit https://<mysite>/wp-json/wp/v2/<post-type>/ it show the stored data from meta key  prefix-meta-key in the Rest API response. Code: <?php /** * Add

Get logged in user roles in WordPress

Get logged in user assigned roles. Use function  wp_get_current_user() to get the current/logged in user info. Output: print_r( prefix_get_current_user_roles() ); // Output: // Array // ( // [0] => administrator // ) Code: <?php if( ! function_exists( 'prefix_get_current_user_roles' ) ) : /** * Get current user roles * * E.g. print_r( prefix_get_current_user_roles() ); * *

Bhari WordPress theme for the bloggers

Created ‘Bhari‘ (ŗ§≠ŗ§ĺŗ§įŗ•Ä) WordPress theme for the bloggers, Who love to write articles, share awesome stuff etc. and which is hosted on wp.org. Useful¬†links: Home Blog Common Customizations Debugging Features Hooks ( Actions & Filters ) Screenshots Theme Customizer Translation Ready Video Tutorials Contribute Bhari on GitHub. Special Thanks: Pratik Chaskar¬†– CSS Ninja – (@pratikchaskar19)

Advertisement