Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /***************************************************************************/
- /* Plugin Name: WPS Poll */
- /* URI: ../wp-content/plugins/wps-poll */
- /* Description: This plugin is a test plugin for learning purpose. */
- /* Version: 0.1 Author: Nyle Davis */
- /* Author URI: http://URI_Of_The_Plugin_Author */
- /* License: GPL2 - most WordPress plugins are released under GPL2 */
- /***************************************************************************/
- function wps_poll_options_page () {
- ?>
- <div class=”wrap”>
- <h2>WPS Poll Admin</h2>
- <p>Here comes the options page content.</p>
- </div>
- <?php
- }
- function wps_poll_new_page () {
- ?>
- <div class=”wrap”>
- <h2>WPS Poll New Page</h2>
- <p>Here is the new page contents.</p>
- </div>
- <?php
- }
- function wps_poll_menu () {
- // Works
- add_menu_page('WPS Poll', __('WPS Poll'),'manage_options',basename(__FILE__), 'wps_poll_options_page');
- $parent_slug = 'wps-poll.php';
- $page_title = 'WPS Poll';
- $menu_title = 'WPS Poll';
- $capability = 'manage_options';
- $menu_slug = basename(__FILE__);
- $function = 'wps_poll_new_page';
- // Doesn't Work
- //add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function);
- // Test writing a submenu to Events manger
- // Doesn't Work
- $parent_slug = ABSPATH.'/wp-content/plugins/events-manager/events-manager.php';
- add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function);
- }
- add_action('admin_menu','wps_poll_menu');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement