I am new in WordPress.I want to create a plugin.This plugin have admin panel for some settings and view page for the end users.Now for end user my page link is like
www.mysite.com/wp-content/plugins/plugin_name/my_page.php
This url looks ugly.Is there any way that i can found the page id of my plugin view page when plugin will be activated and gives url link like this?
http://mysite.com/?page_id=$my_page_id
or is there any way when plugin will activated then i use single_template to show my view pages??
i want to show plugin view pages like template pages to end user. Any kind of help (provide useful resources,tricks,steps to do it) would be useful for me.
Another issues
I want create a shortcode for this plugin view page. I have googling and see some examples. I have done this so far in my plugin file:
function xx_footer_menu_link(){
return "ADD TO FOOTER";
}
add_shortcode('my_plugin_xx',"xx_footer_menu_link" );
And I have added it to template footer like this:
<?php echo do_shortcode([my_plugin_xx]); ?>
I also tried this with out PHP tag. It shows Array
in footer as output. No link is appear in the footer. What am I missing here?
Shortcode is now working fine.a little bit of change in calling shortcode like that
<?php echo do_shortcode('[my_plugin_xx]Booking[/my_plugin_xx]'); ?>
Has done the issues.About first problem i have move my view page for front end users from the plugin directory to template directory as a template. Now After activate plugin admin need to create a blank page with my view page template.In my view page i put all my code and it works like a template page.In admin panel admin can add this tamplate to anywhere in the menu.