How to Make Or Generate ShortCode Of any Function

How to Make Or Generate ShortCode Of any Function

Add Hooks for shortcodes

<?  // syntax
php add_shortcode( $tag , $func ); 
?>


<?php 

function Form_Create( $atts ) { 

?>
<form name='frm' method='post' action='#'>
 <input type='text' name='fname'>
 <input type='text' name='lname'>
 <input type='submit' name='sb'>
</form>

<?php
 } 

add_shortcode( 'xyztag', 'Form_Create' );

?>

 Now you can call to any page or new post bycalling 
function

<?php

do_shortcode('[xyztag]');

?>

insert into any post or insert into any template pages to add simple form speedy


 

Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment