2
votes

im creating a wordpress plugin that have users to login and upload the file and in the back-end admin user can login and set permissions and etc

here is the php file generate front end right now im add this as template and create the front end thing i want do is put this code also in to plugin..,is there any hooks related but i did't find proper one....

1
Why can't you copy the frontend page code to any plugin's script?Felipe Alameda A
because i did't find a proper hook to add with wordpress that's why i put it as new template page and add it to current themewordpresrox

1 Answers

1
votes

If I understood right, you could add the page like this:

function MyPluginPage() {
  $SettingsPath = MyPlugin_DIRNAME . '/mynewpage.php';
  add_menu_page( 'MyPlugin', 'MyPlugin', 'administrator', $SettingsPath, '', plugins_url( '/' . MyPlugin_DIRNAME . '/myplugin.png' ) );
}
add_action( 'admin_menu', 'MyPluginPage'); // Register Menus.