Blog

Advertisement

Setup WP CLI (WordPress Command Line Interface) on Windows Operating System

Follow below steps to install the WP CLI on your Windows operating system. Step 1 Create folder wp-cli in C drive. Step 2 Download wp-cli.phar from https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar Step 3 Move downloaded wp-cli.phar file in C:\wp-cli\ Step 4 Create wp.bat file in C:\wp-cli\ and write below code in it. Or Download file from below Gist Step

Fix: WooCommerce – Sorry, this file type is not permitted for security reasons.

Solution: Add below filter to fix the file permission issue of WooCommerce. The reason of this issue is: Getting different REAL MIME type from function finfo_file. The issue maybe the different Operating Systems or due to Different PHP versions. But, While debugging the issue, When I try to upload the XML on localhost I got the text/xml as

Alignment Package in Sublime Text 3

We are going to see how to use the Alignment package into the Sublime Text 3. Table of Content Introduction While development it is nice to see the code with well-aligned or with good indentation. Most of the users may use the PHPStrom, VSCode, or something else. They have some extensions which do the same

Advertisement

Using absint() in WordPress

It convert a value to non-negative integer. Internally this function used abs( intval( $maybeint ) ). You can try below examples yourself. Examples Output var_dump absint( 0 ) 0 int(0) absint( ‘0’ ) 0 int(0) absint( 1 ) 1 int(1) absint( ‘8’ ) 8 int(8) absint( -27 ) 27 int(27) absint( ‘-8’ ) 8 int(8) absint(

Finally plugin Sample Data approved!

You can now download the Theme Unit Test for testing your theme or import the WooCommerce, bbPress plugin sample data with simple ONE click using WordPress plugin Sample Data. Note: Use Sample Data plugin on your testing/staging environment. Quick Start: Follow below simple steps to import the dummy content: Install & Activate plugin. Click on Get Started » from plugin/theme. It read the

Advertisement

Find Broken Links with WGET

In this article we are going to see how to use Wget to find the broken links from the website. Try below example command which generate the wget.log it list all the broken links. Download & Install wget Add the installation directory to PATH:C:\Program Files (x86)\GnuWin32\bin Syntax: wget -o wget.log -r -l 10 –spider http://example.com Usage: wget

WordPress Rest API parameters mappings

This array defines mappings between public API query parameters whose values are accepted as-passed, and their internal WP_Query parameter name equivalents (some are the same). Only values which are also present in registered will be set. Below is the list of all the endpoints which have query parameters mapping: wp/v2/comments wp/v2/<post-type> wp/v2/<taxonomy> wp/v2/<term> wp/v2/<users> Check below

Advertisement

WordPress Rest API Get specific posts by IDs by using `include` parameter

With the Rest API we get all the posts. But, Sometimes we want to get only specific posts by post ids. WordPress have rest API parameter include which return only requested posts by post ids. Syntax https://example.org/wp-json/wp/v2/posts?include=<post-ids> Example https://example.org/wp-json/wp/v2/posts?include=11,12 It return only 2 posts whose ids are 11 & 12. Note: By default it return 10

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. Table of content Overview We have Rest API endpoints for the post &