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

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -