当前位置: 首页>>代码示例>>PHP>>正文


PHP add_options_page函数代码示例

本文整理汇总了PHP中add_options_page函数的典型用法代码示例。如果您正苦于以下问题:PHP add_options_page函数的具体用法?PHP add_options_page怎么用?PHP add_options_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了add_options_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: admin_menu

 function admin_menu()
 {
     if (current_user_can('administrator')) {
         $menu = add_options_page(__('Search and Replace', 'pressbooks'), __('Search and Replace', 'pressbooks'), 'administrator', 'search-and-replace', array(&$this, 'admin_screen'));
         add_action('admin_print_scripts-' . $menu, array(&$this, 'js'));
     }
 }
开发者ID:jflowers45,项目名称:pressbooks,代码行数:7,代码来源:search-regex.php

示例2: saludo_add_menu

function saludo_add_menu()
{
    if (function_exists('add_options_page')) {
        //add_menu_page
        add_options_page('saludo', 'saludo', 8, basename(__FILE__), 'saludo_panel');
    }
}
开发者ID:enlacee,项目名称:anb.platicom.com.pe,代码行数:7,代码来源:saludo.php

示例3: add_pages

 /**
  * Add options page
  */
 public function add_pages()
 {
     $admin_page = add_options_page(__('TYPO3 Importer Settings', 'typo3-importer'), __('TYPO3 Importer', 'typo3-importer'), 'manage_options', 't3i-options', array(&$this, 'display_page'));
     add_action('admin_print_scripts-' . $admin_page, array(&$this, 'scripts'));
     add_action('admin_print_styles-' . $admin_page, array(&$this, 'styles'));
     add_screen_meta_link('typo3-importer-link', __('TYPO3 Importer', 'typo3-importer'), admin_url('tools.php?page=typo3-importer'), $admin_page, array('style' => 'font-weight: bold;'));
 }
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:10,代码来源:class.options.php

示例4: plugin_page

 public function plugin_page()
 {
     global $admin_klikbayi;
     $this->tabs = array('overview' => array('title' => __('Overview', 'klikbayi'), 'content' => __('This plugin is especially designed to give KlikBayi.com&#39;s affiliates freedom to place the order button/form order (with its affiliate ID included) so the customer can order from their wordpress blog directly and they don&#39;t need to open KlikBayi.com main site anymore.<br>There are many option to place the order button/ form order from single/specific post to widget sidebar. Just make sure you give the necessary description needed for KlikBayi.com product&#39;s.', 'klikbayi')), 'troubleshooting' => array('title' => __('Troubleshooting', 'klikbayi'), 'content' => __('If you get an error, try to deactivate or uninstall the plugin and activate it again.', 'klikbayi')), 'faq' => array('title' => __('FAQ', 'klikbayi'), 'content' => sprintf(__('<h3>How do I setup my WordPress theme to work with Klik Bayi plugin?</h3><p>You can use php code &lt;?php do_action(&#39;klikbayi&#39;); ?&gt; and add this single line code after the_content code. Single or sitewide pages is welcome. More advance code is available.</p>', 'klikbayi'))));
     $admin_klikbayi = add_options_page(esc_attr($this->plugin_title), esc_attr($this->plugin_menu_title), 'manage_options', esc_attr($this->setting_slug), array($this, 'create_page'));
     add_action('load-' . $admin_klikbayi, array($this, 'help_tab'), 20);
 }
开发者ID:extremelyanca,项目名称:klikbayi,代码行数:7,代码来源:class-klikbayi-admin.php

示例5: menus

 /**
  * menus()
  *
  * Adds menus to admin area
  */
 function menus()
 {
     if (!is_super_admin()) {
         return;
     }
     add_options_page(__('Courseware Options', 'bpsp'), __('Courseware', 'bpsp'), 'manage_options', 'bp-courseware', array(__CLASS__, "screen"));
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:12,代码来源:wordpress.class.php

示例6: cimy_admin_menu_custom

function cimy_admin_menu_custom()
{
    global $cimy_uef_name, $cimy_uef_domain, $cimy_top_menu;
    $aue_page = "";
    if (isset($cimy_top_menu) && !is_multisite()) {
        add_submenu_page('cimy_series.php', $cimy_uef_name . ": " . __("Options"), "UEF: " . __("Options"), 'manage_options', "user_extra_fields_options", 'cimy_show_options_notembedded');
        add_submenu_page('cimy_series.php', $cimy_uef_name . ": " . __("Fields", $cimy_uef_domain), "UEF: " . __("Fields", $cimy_uef_domain), 'manage_options', "user_extra_fields", 'cimy_admin_define_extra_fields');
        $aue_page = add_submenu_page('profile.php', __('Users Extended', $cimy_uef_domain), __('Users Extended', $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
    } else {
        if (cimy_uef_is_multisite_unique_installation()) {
            // 			$aue_page = add_submenu_page('wpmu-admin.php', __("Users Extended", $cimy_uef_domain), __("Users Extended", $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
            // 			add_submenu_page('wpmu-admin.php', $cimy_uef_name, $cimy_uef_name, 'manage_options', "user_extra_fields", 'cimy_admin_define_extra_fields');
            // Since WP 3.1 we have network admin and everything seems changed
            $aue_page = add_submenu_page('users.php', __("Users Extended", $cimy_uef_domain), __("Users Extended", $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
            $admin = add_submenu_page('settings.php', $cimy_uef_name, $cimy_uef_name, 'manage_options', "user_extra_fields", 'cimy_admin_define_extra_fields');
        } else {
            $admin = add_options_page($cimy_uef_name, $cimy_uef_name, 'manage_options', "user_extra_fields", 'cimy_admin_define_extra_fields');
            $aue_page = add_submenu_page('profile.php', __('Users Extended', $cimy_uef_domain), __('Users Extended', $cimy_uef_domain), 'list_users', "users_extended", 'cimy_admin_users_list_page');
        }
    }
    if (!empty($aue_page)) {
        add_action('admin_print_scripts-' . $aue_page, 'cimy_uef_admin_ajax_edit');
    }
    if (!empty($admin)) {
        add_action('admin_print_scripts-' . $admin, 'cimy_uef_admin_init_js');
    }
}
开发者ID:johangas,项目名称:moped,代码行数:27,代码来源:cimy_uef_init.php

示例7: test_menu_page_url

	function test_menu_page_url() {
		$current_user = get_current_user_id();
		wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
		update_option( 'siteurl', 'http://example.com' );

		// add some pages
		add_options_page( 'Test Settings', 'Test Settings', 'manage_options', 'testsettings', 'mt_settings_page' );
		add_management_page( 'Test Tools', 'Test Tools', 'manage_options', 'testtools', 'mt_tools_page' );
		add_menu_page( 'Test Toplevel', 'Test Toplevel', 'manage_options', 'mt-top-level-handle', 'mt_toplevel_page' );
		add_submenu_page( 'mt-top-level-handle', 'Test Sublevel', 'Test Sublevel', 'manage_options', 'sub-page', 'mt_sublevel_page' );
		add_submenu_page( 'mt-top-level-handle', 'Test Sublevel 2', 'Test Sublevel 2', 'manage_options', 'sub-page2', 'mt_sublevel_page2' );
		add_theme_page( 'With Spaces', 'With Spaces', 'manage_options', 'With Spaces', 'mt_tools_page' );
		add_pages_page( 'Appending Query Arg', 'Test Pages', 'edit_pages', 'testpages', 'mt_pages_page' );

		$expected['testsettings'] = 'http://example.com/wp-admin/options-general.php?page=testsettings';
		$expected['testtools'] = 'http://example.com/wp-admin/tools.php?page=testtools';
		$expected['mt-top-level-handle'] = 'http://example.com/wp-admin/admin.php?page=mt-top-level-handle';
		$expected['sub-page'] = 'http://example.com/wp-admin/admin.php?page=sub-page';
		$expected['sub-page2'] = 'http://example.com/wp-admin/admin.php?page=sub-page2';
		$expected['not_registered'] = '';
		$expected['With Spaces'] = 'http://example.com/wp-admin/themes.php?page=WithSpaces';
		$expected['testpages'] = 'http://example.com/wp-admin/edit.php?post_type=page&#038;page=testpages';

		foreach ($expected as $name => $value) {
			$this->assertEquals( $value, menu_page_url( $name, false ) );
		}

		wp_set_current_user( $current_user );
	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:29,代码来源:includesPlugin.php

示例8: admin_actions

 /**
  * setup the admin hooks
  */
 public static function admin_actions()
 {
     add_action('admin_init', '\\Sitepoint\\RandomHelloBar::admin_init');
     add_action('admin_menu', function () {
         add_options_page('SP Random Hello Bar', 'SP Random Hello Bar', 'manage_options', self::PLUGIN_NAME, '\\SitePoint\\RandomHelloBar::options_page');
     });
 }
开发者ID:sitepoint,项目名称:sp-random-hello-bar,代码行数:10,代码来源:RandomHelloBar.php

示例9: init

 /**
  * Initialise menu items, notices, etc.
  */
 function init()
 {
     global $wp_version;
     if (version_compare($wp_version, "2.7-alpha", '>')) {
         add_object_page(__('Ads', 'advman'), __('Ads', 'advman'), 8, 'advman-manage', array('Advman_Admin', 'process'));
         add_submenu_page('advman-manage', __('Edit Ads', 'advman'), __('Edit', 'advman'), 8, 'advman-manage', array('Advman_Admin', 'process'));
         add_submenu_page('advman-manage', __('Create New Ad', 'advman'), __('Create New', 'advman'), 8, 'advman-create', array('Advman_Admin', 'create'));
         add_options_page(__('Ads', 'advman'), __('Ads', 'advman'), 8, 'advman-settings', array('Advman_Admin', 'settings'));
     } else {
         add_menu_page(__('Ads', 'advman'), __('Ads', 'advman'), 8, 'advman-manage', array('Advman_Admin', 'process'));
         add_submenu_page('advman-manage', __('Edit Ads', 'advman'), __('Edit', 'advman'), 8, 'advman-manage', array('Advman_Admin', 'process'));
         add_submenu_page('advman-manage', __('Create New Ad', 'advman'), __('Create New', 'advman'), 8, 'advman-create', array('Advman_Admin', 'create'));
         add_options_page(__('Ads', 'advman'), __('Ads', 'advman'), 8, 'advman-settings', array('Advman_Admin', 'settings'));
     }
     add_action('admin_print_scripts', array('Advman_Admin', 'add_scripts'));
     add_action('admin_notices', array('Advman_Admin', 'display_notices'), 1);
     add_action('admin_footer', array('Advman_Admin', 'display_editor'));
     $mode = OX_Tools::sanitize_post_var('advman-mode');
     if ($mode == 'notice') {
         $action = OX_Tools::sanitize_post_var('advman-action');
         $yes = OX_Tools::sanitize_post_var('advman-notice-confirm-yes');
         switch ($action) {
             case 'optimise':
                 Advman_Admin::set_auto_optimise(!empty($yes));
                 Advman_Admin::remove_notice('optimise');
                 break;
             case 'activate advertising-manager':
                 Advman_Admin::remove_notice('activate advertising-manager');
                 break;
         }
     }
 }
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:35,代码来源:Admin.php

示例10: jr_mt_admin_hook

/**
 * Add Admin Menu item for plugin
 * 
 * Plugin needs its own Page in the Settings section of the Admin menu.
 *
 */
function jr_mt_admin_hook()
{
    //  Add Settings Page for this Plugin
    global $jr_mt_plugin_data;
    add_theme_page($jr_mt_plugin_data['Name'], 'Multiple Themes plugin', 'switch_themes', 'jr_mt_settings', 'jr_mt_settings_page');
    add_options_page($jr_mt_plugin_data['Name'], 'Multiple Themes plugin', 'switch_themes', 'jr_mt_settings', 'jr_mt_settings_page');
}
开发者ID:brittbec13,项目名称:citizenmodern,代码行数:13,代码来源:admin.php

示例11: wp_sh_register_menu_item

function wp_sh_register_menu_item()
{
    global $wp_sh_setting_opt;
    // Register setting panel
    $wp_sh_page_hook = add_options_page('WP SyntaxHighlighter Options', 'WP SyntaxHighlighter', 'manage_options', 'wp-syntaxhighlighter-options', 'wp_sh_options_panel');
    // CSS and scripts for setting panel
    if ($wp_sh_page_hook != null) {
        $wp_sh_page_hook = '-' . $wp_sh_page_hook;
    }
    add_action('admin_print_scripts' . $wp_sh_page_hook, 'wp_sh_load_jscript_for_admin');
    add_action('admin_print_styles' . $wp_sh_page_hook, 'wp_sh_load_style');
    if (isset($_POST['WP_SH_Setting_submit']) && $_POST['wp_sh_hidden_value'] == "true") {
        if ($_POST['addl_style_enable'] == 1) {
            add_action('admin_head' . $wp_sh_page_hook, 'wp_sh_load_addl_style');
        }
    } else {
        if ($wp_sh_setting_opt['addl_style_enable'] == 1) {
            add_action('admin_head' . $wp_sh_page_hook, 'wp_sh_load_addl_style');
        }
    }
    // Show messages for admin
    $updated = get_option('wp_sh_updated');
    if (($updated == "true" || $updated == "migration") && !(isset($_POST['WP_SH_Setting_submit']) && $_POST['wp_sh_hidden_value'] == "true") && !(isset($_POST['WP_SH_Reset']) && $_POST['wp_sh_reset'] == "true")) {
        add_action('admin_notices', 'wp_sh_admin_updated_notice');
    }
    if ($updated == "migration" && !(isset($_POST['WP_SH_Setting_submit']) && $_POST['wp_sh_hidden_value'] == "true") && !(isset($_POST['WP_SH_Reset']) && $_POST['wp_sh_reset'] == "true")) {
        add_action('admin_notices', 'wp_sh_admin_migration_notice');
    }
}
开发者ID:Paulf-999,项目名称:HollyFry.com,代码行数:29,代码来源:wp-syntaxhighlighter-admin.php

示例12: menu

    /**
     * Initialize the administration page.
     */
    public function menu()
    {
        $capability = 'manage_options';
        if (defined('POST_SNIPPETS_ALLOW_EDIT_POSTS')
            and current_user_can('edit_posts')
        ) {
            $allowed = true;
            $capability = 'edit_posts';
        }

        if (current_user_can('manage_options') or isset($allowed)) {
            $optionPage = add_options_page(
                'Post Snippets Options',
                'Post Snippets',
                $capability,
                PostSnippets::FILE,
                array(&$this, 'optionsPage')
            );
            new PostSnippets_Help($optionPage);
        } else {
            $option_page = add_options_page(
                'Post Snippets',
                'Post Snippets',
                'edit_posts',
                PostSnippets::FILE,
                array(&$this, 'overviewPage')
            );
        }
    }
开发者ID:erudith,项目名称:moviesagcsingleniche,代码行数:32,代码来源:Admin.php

示例13: sf_settings_page

function sf_settings_page()
{
    global $sf_textdomain;
    if (function_exists('add_options_page')) {
        add_options_page(__('SpamFighter Settings', $sf_textdomain), __('SFSettings', $sf_textdomain), 8, basename(__FILE__), 'sf_settings_form');
    }
}
开发者ID:pombredanne,项目名称:spamfighter,代码行数:7,代码来源:spamfighter.php

示例14: admin_settings_menu

 /**
  * Add sub menu page to the Settings menu.
  *
  * @since 1.0.0
  */
 public function admin_settings_menu()
 {
     if (!\current_user_can('manage_options')) {
         return;
     }
     \add_options_page(\__('Smartlook', 'wpsmartlook'), \__('Smartlook', 'wpsmartlook'), 'manage_options', 'smartlook', array($this, 'display_options_page'));
 }
开发者ID:s3rgiosan,项目名称:wpsmartlook,代码行数:12,代码来源:Admin.php

示例15: ultimate_admin_menus

 function ultimate_admin_menus()
 {
     // Add a new menu under Manage:
     add_management_page('Tag Management', 'Tags', 8, basename(__FILE__), array('UltimateTagWarriorActions', 'ultimate_better_admin'));
     // And one under options
     add_options_page('Tag Options', 'Tags', 8, basename(__FILE__), array('UltimateTagWarriorActions', 'utw_options'));
 }
开发者ID:jbogota,项目名称:blog-king,代码行数:7,代码来源:ultimate-tag-warrior-actions.php


注:本文中的add_options_page函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。