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


PHP MainWP_Utility::isAdmin方法代码示例

本文整理汇总了PHP中MainWP_Utility::isAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP MainWP_Utility::isAdmin方法的具体用法?PHP MainWP_Utility::isAdmin怎么用?PHP MainWP_Utility::isAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainWP_Utility的用法示例。


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

示例1: on_admin_menu

 function on_admin_menu()
 {
     if (MainWP_Utility::isAdmin()) {
         global $current_user;
         delete_user_option($current_user->ID, 'screen_layout_toplevel_page_mainwp_tab');
         $this->dashBoard = add_menu_page('MainWP', 'MainWP', 'read', 'mainwp_tab', array($this, 'on_show_page'), plugins_url('images/mainwpicon.png', dirname(__FILE__)), '2.00001');
         if (mainwp_current_user_can('dashboard', 'access_global_dashboard')) {
             add_submenu_page('mainwp_tab', 'MainWP', __('Dashboard', 'mainwp'), 'read', 'mainwp_tab', array($this, 'on_show_page'));
         }
         $val = get_user_option('screen_layout_' . $this->dashBoard);
         if (!MainWP_Utility::ctype_digit($val)) {
             update_user_option($current_user->ID, 'screen_layout_' . $this->dashBoard, 2, true);
         }
         add_action('load-' . $this->dashBoard, array(&$this, 'on_load_page'));
     }
     //        else
     //        {
     //            $this->dashBoard = add_menu_page('MainWP', 'MainWP', 'read', 'mainwp_tab', array($this, 'require_registration'), plugins_url('images/mainwpicon.png', dirname(__FILE__)), '2.0001');
     //        }
 }
开发者ID:senlin,项目名称:mainwp,代码行数:20,代码来源:page-mainwp-main.php

示例2: new_menus

 function new_menus()
 {
     if (MainWP_Utility::isAdmin()) {
         //Adding the page to manage your added sites/groups
         //The first page which will display the post area etc..
         MainWP_Security_Issues::initMenu();
         MainWP_Manage_Sites::initMenu();
         MainWP_Post::initMenu();
         MainWP_Page::initMenu();
         MainWP_Themes::initMenu();
         MainWP_Plugins::initMenu();
         MainWP_User::initMenu();
         MainWP_Manage_Backups::initMenu();
         MainWP_Bulk_Update_Admin_Passwords::initMenu();
         MainWP_Manage_Groups::initMenu();
         MainWP_Settings::initMenu();
         MainWP_Extensions::initMenu();
         do_action('mainwp_admin_menu');
         MainWP_Documentation::initMenu();
         MainWP_Server_Information::initMenu();
         MainWP_Child_Scan::initMenu();
         MainWP_API_Settings::initMenu();
     }
 }
开发者ID:reeslo,项目名称:mainwp,代码行数:24,代码来源:class-mainwp-system.php

示例3: renderSettings


//.........这里部分代码省略.........
						<th scope="row"><?php 
        _e('Notification Email', 'mainwp');
        MainWP_Utility::renderToolTip(__('This address is used to send monitoring alerts.', 'mainwp'));
        ?>
</th>
						<td>
							<input type="text" class="" name="mainwp_options_email" size="35" value="<?php 
        echo $user_email;
        ?>
"/><span class="mainwp-form_hint"><?php 
        _e('This address is used to send monitoring alerts.', 'mainwp');
        ?>
</span>
						</td>
					</tr>
					<tr>
						<th scope="row"><?php 
        _e('Use WP-Cron', 'mainwp');
        MainWP_Utility::renderToolTip(__('When not using WP-Cron you will need to set up a cron job via your hosting.', 'mainwp'), 'http://docs.mainwp.com/disable-wp-cron/');
        ?>
</th>
						<td>
							<div class="mainwp-checkbox">
								<input type="checkbox" name="mainwp_options_wp_cron"
									id="mainwp_options_wp_cron" <?php 
        echo get_option('mainwp_wp_cron') == 1 || get_option('mainwp_wp_cron') === false ? 'checked="true"' : '';
        ?>
/>
								<label for="mainwp_options_wp_cron"></label>
							</div>
						</td>
					</tr>
					<?php 
        if (MainWP_Utility::isAdmin()) {
            ?>
						<tr>
							<th scope="row"><?php 
            _e('Show Basic SEO Stats', 'mainwp');
            MainWP_Utility::renderToolTip(__('This requires your Dashboard to query the Google servers for this information.', 'mainwp'));
            ?>
</th>
							<td>
								<div class="mainwp-checkbox">
									<input type="checkbox" name="mainwp_seo"
										id="mainwp_seo" <?php 
            echo get_option('mainwp_seo') == 1 ? 'checked="true"' : '';
            ?>
/>
									<label for="mainwp_seo"></label>
								</div>
							</td>
						</tr>
					<?php 
        }
        ?>
					</tbody>
				</table>
			</div>
		</div>

		<div class="postbox" id="mainwp-upgrade-options-settings">
			<h3 class="mainwp_box_title">
				<span><i class="fa fa-cog"></i> <?php 
        _e('Upgrade Options', 'mainwp');
        ?>
</span></h3>
开发者ID:senlin,项目名称:mainwp,代码行数:67,代码来源:widget-mainwp-options.php

示例4: secure_request

 function secure_request($action = '', $query_arg = 'security')
 {
     if (!MainWP_Utility::isAdmin()) {
         die(0);
     }
     if ($action == '') {
         return;
     }
     if (!$this->check_security($action, $query_arg)) {
         die(json_encode(array('error' => 'Invalid request')));
     }
     if (isset($_POST['dts'])) {
         $ajaxPosts = get_option('mainwp_ajaxposts');
         if (!is_array($ajaxPosts)) {
             $ajaxPosts = array();
         }
         //If already processed, just quit!
         if (isset($ajaxPosts[$action]) && $ajaxPosts[$action] == $_POST['dts']) {
             die(json_encode(array('error' => 'Double request')));
         }
         $ajaxPosts[$action] = $_POST['dts'];
         MainWP_Utility::update_option('mainwp_ajaxposts', $ajaxPosts);
     }
 }
开发者ID:jexmex,项目名称:mainwp,代码行数:24,代码来源:class-mainwp-post-handler.php

示例5: renderSettings

 public static function renderSettings()
 {
     if (MainWP_Utility::isAdmin()) {
         MainWP_Manage_Sites_View::renderSettings();
     }
 }
开发者ID:reeslo,项目名称:mainwp,代码行数:6,代码来源:page-mainwp-manage-sites.php


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