php - WordPress Plugin: How to create a new subpage? -


i have write wordpress plugin should provide new subpage kind of contact form. plugins i've made yet changed in existing files using hooks , don't know how create new subpage embedded main wordpress layout. plugin should add link subpage main navigation of blog.

i know it's pretty annoying but... can't make page on actual blog in plugin make. can however, make shortcode [contact-form] output form. user needs put shortcode on page , put form there. reference shortcodes can found here: shortcode api. main syntax creating shortcode this:

//[foobar] function foobar_func( $atts ){ return "foo , bar"; } add_shortcode( 'foobar', 'foobar_func' ); 

just put form code inside function , change name. don't need attributes though. case need this:

function contact_form(){ //code process form //actual code outputs form } 

and there go! thanks!

ethan brouwer


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -