本文整理汇总了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');
// }
}
示例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();
}
}
示例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>
示例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);
}
}
示例5: renderSettings
public static function renderSettings()
{
if (MainWP_Utility::isAdmin()) {
MainWP_Manage_Sites_View::renderSettings();
}
}