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


PHP menu_page_url函数代码示例

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


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

示例1: ztjalali_admin_message

function ztjalali_admin_message()
{
    if (current_user_can('activate_plugins')) {
        $Message = sprintf(__('WP Jalali successful installed. please check %soptions%s', 'ztjalali'), '<a href="' . menu_page_url('ztjalali_admin_page', FALSE) . '">', '</a>');
        echo '<div class="updated ztjalali-notice notice is-dismissible"><p>' . $Message . '</p></div>';
    }
}
开发者ID:airani,项目名称:wp-jalali,代码行数:7,代码来源:wp-jalali-admin.php

示例2: 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

示例3: layout_box

    /**
     * The layout metabox for the 404 page.
     *
     * @since 1.5.0
     */
    public function layout_box()
    {
        $layout = esc_attr($this->get_field_value('genesis_layout'));
        ?>
		<div class="genesis-layout-selector">
			<p><input type="radio" name="<?php 
        echo $this->get_field_name('genesis_layout');
        ?>
" class="default-layout" id="default-layout" value="" <?php 
        checked($layout, '');
        ?>
 /> <label class="default" for="default-layout"><?php 
        printf(__('Default Layout set in <a href="%s">Theme Settings</a>', 'genesis'), menu_page_url('genesis', 0));
        ?>
</label></p>

			<p><?php 
        genesis_layout_selector(array('name' => $this->get_field_name('genesis_layout'), 'selected' => $layout, 'type' => 'site'));
        ?>
</p>
		</div>

		<br class="clear" />
		<?php 
    }
开发者ID:tleonard2,项目名称:durablegbFeb,代码行数:30,代码来源:class-be-genesis-404-settings.php

示例4: redirect

function redirect()
{
    $redirect = '<script type="text/javascript">';
    $redirect .= 'window.location = "' . menu_page_url(WPWSL_GENERAL_PAGE, false) . '"';
    $redirect .= '</script>';
    echo $redirect;
}
开发者ID:xiangyan99,项目名称:wechat_subscribers,代码行数:7,代码来源:_edit.php

示例5: dashboard_widget

        public function dashboard_widget()
        {
            $projectId = 0;
            if (empty($this->gadwp->config->options['ga_dash_token'])) {
                echo '<p>' . __("This plugin needs an authorization:", 'google-analytics-dashboard-for-wp') . '</p><form action="' . menu_page_url('gadash_settings', false) . '" method="POST">' . get_submit_button(__("Authorize Plugin", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
                return;
            }
            if (current_user_can('manage_options')) {
                if ($this->gadwp->config->options['ga_dash_tableid_jail']) {
                    $projectId = $this->gadwp->config->options['ga_dash_tableid_jail'];
                } else {
                    echo '<p>' . __("An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp') . '</p><form action="' . menu_page_url('gadash_settings', false) . '" method="POST">' . get_submit_button(__("Select Domain", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
                    return;
                }
            } else {
                if ($this->gadwp->config->options['ga_dash_tableid_jail']) {
                    $projectId = $this->gadwp->config->options['ga_dash_tableid_jail'];
                } else {
                    echo '<p>' . __("An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp') . '</p><form action="' . menu_page_url('gadash_settings', false) . '" method="POST">' . get_submit_button(__("Select Domain", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
                    return;
                }
            }
            if (!$projectId) {
                echo '<p>' . __("Something went wrong while retrieving property data. You need to create and properly configure a Google Analytics account:", 'google-analytics-dashboard-for-wp') . '</p> <form action="https://deconf.com/how-to-set-up-google-analytics-on-your-website/" method="POST">' . get_submit_button(__("Find out more!", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
                return;
            }
            ?>
<div id="gadwp-window-1"></div>
<?php 
        }
开发者ID:aguerojahannes,项目名称:aguerojahannes.com,代码行数:30,代码来源:widgets.php

示例6: _getAdminAuthUrl

 protected function _getAdminAuthUrl()
 {
     $betterAnalyticsOptions = get_option('better_analytics');
     if (@$betterAnalyticsOptions['api']['use_own']) {
         return menu_page_url('better-analytics_auth', false);
     } else {
         return $this->_credentials['auth_url'];
     }
 }
开发者ID:Vatia13,项目名称:tofido,代码行数:9,代码来源:Reporting.php

示例7: query

 static function query($params, $request_type = 'query')
 {
     $ooyala_video = Ooyala_Video::init();
     if (empty($ooyala_video->partner_code) || empty($ooyala_video->partner_code)) {
         return new WP_Error('no_api_codes', sprintf(__('Please set your API codes in the <a href="%s" target="_blank">Ooyala Video</a> Settings page'), menu_page_url('ooyalavideo_options', false)));
     } else {
         return OoyalaBacklotAPI::send_request($request_type, $params);
     }
 }
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:9,代码来源:class-ooyala-backlot-api.php

示例8: get_url

 public static function get_url()
 {
     $url = menu_page_url('instant-articles-wizard', false);
     // Needed when calling from ajax
     if (!$url) {
         $url = get_option('instant-articles-wizard-url');
     }
     return $url;
 }
开发者ID:ActiveWebsite,项目名称:BoojPressPlugins,代码行数:9,代码来源:class-instant-articles-wizard.php

示例9: wpht_plugin_action_links

 public function wpht_plugin_action_links($links, $file)
 {
     if (untrailingslashit(plugins_url('', $file)) != untrailingslashit(plugins_url('', __FILE__))) {
         return $links;
     }
     $settings_link = '<a href="' . menu_page_url('wpht', false) . '">' . esc_html(__('Settings', 'wpht')) . '</a>';
     array_unshift($links, $settings_link);
     return $links;
 }
开发者ID:toabound,项目名称:abound.com.br,代码行数:9,代码来源:wpht.class.php

示例10: init_admin

 function init_admin()
 {
     global $pagenow;
     if ('themes.php' == $pagenow && isset($_GET['activated'])) {
         //op_post_types();
         //flush_rewrite_rules();
         wp_redirect(menu_page_url(OP_SN . ($this->installed ? op_get_option('blog_enabled') == 'Y' ? '' : '-setup-wizard' : ''), false));
     }
 }
开发者ID:shahadat014,项目名称:geleyi,代码行数:9,代码来源:init.php

示例11: admin_init

 public function admin_init()
 {
     if (isset($_REQUEST['notice'])) {
         if (check_admin_referer('message_sample')) {
             set_transient('wp-admin-notice-sample', $_REQUEST['notice'], 10);
             wp_safe_redirect(menu_page_url(__FILE__, false));
         }
     }
 }
开发者ID:kurozumi,项目名称:wp-admin-notice-sample,代码行数:9,代码来源:wp-admin-notice-sample.php

示例12: wpcf7_admin_url

function wpcf7_admin_url($args = array())
{
    $defaults = array('page' => 'wpcf7');
    $args = wp_parse_args($args, $defaults);
    $url = menu_page_url($args['page'], false);
    unset($args['page']);
    $url = add_query_arg($args, $url);
    return esc_url_raw($url);
}
开发者ID:ViktorLinnasaar,项目名称:hanset,代码行数:9,代码来源:functions.php

示例13: display

    function display()
    {
        ?>
    <div class="wrap">
      <h2>Ashuwp-导入/导出</h2>
      <?php 
        if (isset($_REQUEST['imported']) && 'true' === $_REQUEST['imported']) {
            echo '<div id="message" class="updated"><p><strong>设置数据导入成功。</strong></p></div>';
        } elseif (isset($_REQUEST['error']) && 'true' === $_REQUEST['error']) {
            echo '<div id="message" class="error"><p><strong>导入失败,请重试。</strong></p></div>';
        }
        ?>
      <table class="form-table">
      <tbody>
        <tr>
          <th scope="row"><b>导入设置选项数据</p></th>
          <td>
            <p>请上传一个.json格式的数据文件(数据文件应该是从ashuwp_framework框架中导出的),请勿上传其它文件</p>
            <p>
              <form enctype="multipart/form-data" method="post" action="<?php 
        echo menu_page_url('ashupw_import', 0);
        ?>
">
                <?php 
        wp_nonce_field('ashuwp_import', 'ashuwp_import');
        ?>
                <input type="file" id="ashuwp_import_upload" name="ashuwp_import_upload" size="25" />
                <?php 
        submit_button('Upload File and Import', 'primary', 'upload');
        ?>
              </form>
            </p>
          </td>
        </tr>
        <tr>
          <th scope="row"><b>导出设置选项数据</b></th>
          <td>
            <p>点击下载设置数据文件,下载的数据包含整个ashuwp_framework框架建立的设置页面的所有数据,不包括文章自定义字段和分类自定义字段数据。</p>
            <p>
              <form method="post" action="<?php 
        echo menu_page_url('ashupw_import', 0);
        ?>
">
              <?php 
        wp_nonce_field('ashuwp_export', 'ashuwp_export');
        submit_button('Download Export File', 'primary', 'download');
        ?>
              </form>
            </p>
          </td>
        </tr>
      </tbody>
      </table>
    </div>
  <?php 
    }
开发者ID:ashuwp,项目名称:Ashuwp_framework,代码行数:56,代码来源:import_export.php

示例14: genesis_scribe_nag

/**
 * Display nag for Scribe SEO Copywriting tool.
 */
function genesis_scribe_nag()
{
    if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'seo-settings') {
        return;
    }
    if (class_exists('Ecordia') || get_option('genesis-scribe-nag-disabled')) {
        return;
    }
    printf('<div class="updated" style="overflow: hidden;"><p class="alignleft">Have you tried our Scribe SEO software? Do keyword research, content optimization, and link building without leaving WordPress. <b>Genesis owners save over 50&#37; using the promo code FIRST when you sign up</b>. <a href="%s" target="_blank">Click here for more info</a>.</p> <p class="alignright"><a href="%s">Dismiss</a></p></div>', 'http://scribeseo.com/genesis-owners-only', add_query_arg('dismiss-scribe', 'true', menu_page_url('seo-settings', false)));
}
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:13,代码来源:seo.php

示例15: wpcf7_admin_url

function wpcf7_admin_url($args = array())
{
    wpcf7_deprecated_function(__FUNCTION__, '3.2', 'admin_url()');
    $defaults = array('page' => 'wpcf7');
    $args = wp_parse_args($args, $defaults);
    $url = menu_page_url($args['page'], false);
    unset($args['page']);
    $url = add_query_arg($args, $url);
    return esc_url_raw($url);
}
开发者ID:kristinakarnitskaya,项目名称:larkyonline,代码行数:10,代码来源:deprecated.php


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