wordpress

List of parameters that can be pass through wp_query constructor to create a new query object in wordpress

<?php /** * WordPress Query Comprehensive Reference * Compiled by luetkemj - luetkemj.com * * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php * Source: https://gist.github.com/luetkemj/2023628 */ $args = array( //////Author Parameters - Show posts associated with certain author. 'author' => 1,2,3, //(int) - use author id [use minus (-) to exclude authors by ID ex. 'author' => -1,-2,-3,] 'author_name' => 'luetkemj', //(strin

wordpress

create plugin by wordpress cli

By using scaffold command we can create plugin and custom post type https://youtu.be/rFKK2vHRGWM For plugin command is following wp scaffold plugin <slug> --plugin_name="<plugin name" --plugin_description="<plugin description>" --plugin_author="<author>" --plugin_author_uri="<author uri>" --plugin_uri="<plugin url>" if you want to skip test then following command wp scaffold plugin <slug> --plugin_name="<plugin name" --plugin_description="<plugin description>" --plugin_author="<author>" --plu

wordpress

How to Install and Setup WordPress Multisite Network

You need to add the following code to your wp-config.php file just before the /* That’s all, stop editing! Happy blogging. */ line. /* Multisite */ define( 'WP_ALLOW_MULTISITE', true ); Go inside tool and click on Network setup menu. At there you will get some code for update wp-config and .htaccess Remove below code from config define( 'WP_ALLOW_MULTISITE', true ); Login again and create sub sites

wordpress

Add Bearer Authentication in swagger plugin

We can add swagger by plugin https://wordpress.org/plugins/wp-api-swaggerui/ . As now a days hacking of api is very popular so reduce it we can use JWT Plugin for it . After implemented jwt for api no api is available without token . We can get token by route wp-json/jwt-auth/v1/token. But in swagger how can we add this token part as in swagger plugin only basic authentication is available . For JWT both authentication required basic +token . So For it we can use one filter of swagger plugin swagger_api_security_definitions /** * Append JW

wordpress

Change block icon and filtering keyword in Gutenberg blocks

https://www.youtube.com/watch?v=SaKZdYQGguY dummy-blocks.php <?php /** * Plugin Name: Dummy Blocks * Plugin URI: https://github.com/sandeepjain2015/gutunburg-dummy-blocks.git * Plugin Description: Dummy Blocks is a plugin that allows you to add dummy blocks to your site. * Plugin Version: 1.0 * Plugin Date: 2013-10-10 * Plugin Author: Sandeep Jain * Plugin Author URI: https://sandeepjain.me/ * */ add_action( 'init', 'dummy_blocks_init' ); function dummy_blocks_init() { wp_enqueue_script( 'dummy-block-editor-js', plugins_url( 'blocks/firstblock/i