Tag: php

How to Show Admin Notice on Plugin Activation?

1. Add the code in the Notice Class like Below –

Read More “How to Show Admin Notice on Plugin Activation?”

WPCS with Visual Studio Code

Installation

The easiest way to get started with PHP_CodeSniffer is to download the Phar files for each of the commands:

# Or download using wget
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar

# Then test the downloaded PHARs
php phpcs.phar -h
php phpcbf.phar -h

Composer Read More “WPCS with Visual Studio Code”

Change Custom Post Type Name Safely.

Just replace the second line’s post type names:

 

Source: https://wordpress.stackexchange.com/questions/97026/how-do-i-safely-change-the-name-of-a-custom-post-type

Conditional Script Loading for Shotcode

In the functions.php file or in your plugin file write the code below –

How to Set a default Title for the custom post?

Now use the function

How to a Add Custom Meta Box for Multiple Post Type

See: Stackexchange , Codex

How to get Category Slug by Category ID in WordPress?

I have got the category id list with the variable $my_cats_id.

So now I have used my own trick to get the slug –

 

How to show image from CodeStar Metabox

The non-repeatable image field creation:

02. Calling the image on front-end: