If you have created a PHP function within a plugin or widget created by you, or even directly in functions.php, you can add another default WordPress function called add_shortcode immediately after it is closed. The add_shortcode function has two parameters:
- The name you want to use in the shortcode and
- The name depending on the content you want to download.
Code example:
functiion_create_by_you() {
//the content of the function will be entered here
}
add_shortcode ( 'name' , 'functiion_create_by_you' );