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


PHP user_can_access_admin_page函数代码示例

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


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

示例1: wp_portability_kit

function wp_portability_kit()
{
    if (!user_can_access_admin_page()) {
        return false;
    }
    if (isset($_REQUEST['_wpnonce'])) {
        if (function_exists('check_admin_referer')) {
            check_admin_referer('wordpress-portability-kit');
        }
    }
    global $task;
    switch ($task) {
        case 'upkit':
            wpk_create_kit();
            break;
        case 'downkit':
            wpk_unpack_kit();
            break;
        case 'restore':
            wpk_restore_kit();
            break;
        default:
            wpk_show_kit_start();
            break;
    }
}
开发者ID:keithdsouza,项目名称:wordpress-portability-kit,代码行数:26,代码来源:wordpress-portability-kit.php

示例2: surveys_options

function surveys_options()
{
    if (function_exists('current_user_can') && !current_user_can('manage_options')) {
        die(__("Cheatin' uh?", 'surveys'));
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page.', 'surveys'));
    }
    require ABSPATH . '/wp-content/plugins/surveys/options.php';
}
开发者ID:umairriaz90,项目名称:Daschug1,代码行数:10,代码来源:surveys.php

示例3: eventr_options

function eventr_options()
{
    if (function_exists('current_user_can') && !current_user_can('manage_options')) {
        die(t('Cheatin’ uh?'));
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page.', 'eventr'));
    }
    require ABSPATH . '/wp-content/plugins/eventr/options.php';
}
开发者ID:htmELS,项目名称:eventr,代码行数:10,代码来源:eventr.php

示例4: elseif

        global $menu_order, $default_menu_order;
        $a = $a[2];
        $b = $b[2];
        if (isset($menu_order[$a]) && !isset($menu_order[$b])) {
            return -1;
        } elseif (!isset($menu_order[$a]) && isset($menu_order[$b])) {
            return 1;
        } elseif (isset($menu_order[$a]) && isset($menu_order[$b])) {
            if ($menu_order[$a] == $menu_order[$b]) {
                return 0;
            }
            return $menu_order[$a] < $menu_order[$b] ? -1 : 1;
        } else {
            return $default_menu_order[$a] <= $default_menu_order[$b] ? -1 : 1;
        }
    }
    usort($menu, 'sort_menu');
    unset($menu_order, $default_menu_order);
}
// Remove the last menu item if it is a separator.
$last_menu_key = array_keys($menu);
$last_menu_key = array_pop($last_menu_key);
if (!empty($menu) && 'wp-menu-separator' == $menu[$last_menu_key][4]) {
    unset($menu[$last_menu_key]);
}
unset($last_menu_key);
if (!user_can_access_admin_page()) {
    do_action('admin_page_access_denied');
    wp_die(__('You do not have sufficient permissions to access this page.'));
}
$menu = add_menu_classes($menu);
开发者ID:vivekkodira1,项目名称:wordpress,代码行数:31,代码来源:menu.php

示例5: grpdocs_assembly_options

function grpdocs_assembly_options() {
	if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(t('An error occurred.'));
	if (! user_can_access_admin_page()) wp_die('You do not have sufficient permissions to access this page');

	require(ABSPATH. 'wp-content/plugins/groupdocs-assembly/options.php');
}
开发者ID:unisexx,项目名称:drtooth,代码行数:6,代码来源:grpdocsassembly.php

示例6: user_level_check

 function user_level_check()
 {
     if (!user_can_access_admin_page()) {
         redirect_header(wp_siteurl() . '/wp-admin/', 5, _LANG_P_CHEATING_ERROR);
     }
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:6,代码来源:admin-functions.php

示例7: gde_options

function gde_options()
{
    if (!current_user_can('manage_options')) {
        wp_die('You don\'t have access to this page.');
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page', 'google-document-embedder'));
    }
    require GDE_PLUGIN_DIR . 'options.php';
    add_action('in_admin_footer', 'gde_admin_footer');
}
开发者ID:vladflip,项目名称:carewp,代码行数:11,代码来源:functions-admin.php

示例8: wp_automatic_upgrade

function wp_automatic_upgrade()
{
    if (!user_can_access_admin_page()) {
        return false;
    }
    if (isset($_REQUEST['_wpnonce'])) {
        if (function_exists('check_admin_referer')) {
            check_admin_referer('wordpress_automatic_upgrade');
        }
    }
    global $task;
    switch ($task) {
        case 'start':
            show_upgrade_start();
            break;
        case 'files':
            wpau_backup_files();
            break;
        case 'skipfiles':
            wpau_skip_backup_files();
            break;
        case 'backupdbopt':
            wpau_backup_db_options();
            break;
        case 'skipbackupdbopt':
            wpau_skip_backup_db();
            break;
        case 'backupdb':
            wpau_backup_db();
            break;
        case 'newversionoption':
            wpau_show_new_version_forms();
            break;
        case 'getlatestfiles':
            wpau_get_latest_version();
            break;
        case 'maintmode':
            wpau_site_down();
            break;
        case 'de-plugin':
            wpau_deactivate_plugins();
            break;
        case 'upgrade':
            wpau_upgrade_installation();
            break;
        case 'updatedb':
            wpau_update_database();
            break;
        case 're-plugin':
            wpau_reactivate_plugins();
            break;
        case 'cleanup':
            wpau_cleanup();
            break;
        case 'done':
            wpau_show_backup_log();
            break;
        case 'logs':
            wpau_show_log();
            break;
        case 'prelimopts':
            wpau_prelim_opts_and_sanatize();
            break;
        case 'skiptask':
            wpau_skip_task();
        default:
            wpau_run_prelims();
            break;
    }
}
开发者ID:julianbonilla,项目名称:three20.info,代码行数:70,代码来源:wordpress-automatic-upgrade.php

示例9: watu_options

function watu_options()
{
    if (function_exists('current_user_can') && !current_user_can('manage_options')) {
        die(__("Your are not allowed to to perform this operation", 'watu'));
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page', 'watu'));
    }
    require ABSPATH . '/wp-content/plugins/watu/options.php';
}
开发者ID:leeci,项目名称:watu,代码行数:10,代码来源:watu.php

示例10: rebuildCache

 /**
  * This is for a future release.
  * It should be called through ajax and rebuild cache for all posts in that are cached
  * 
  * @author Panagiotis Vagenas <pan.vagenas@gmail.com>
  * @since 1.0.0
  */
 public function rebuildCache()
 {
     if (!user_can_access_admin_page() || !current_user_can('manage_options')) {
         echo json_encode(false);
         die;
     }
     // This may take a while so set time limit to 0
     set_time_limit(0);
     erpPROPaths::requireOnce(erpPROPaths::$erpPRODBActions);
     erpPROPaths::requireOnce(erpPROPaths::$erpPROMainOpts);
     erpPROPaths::requireOnce(erpPROPaths::$erpProRelated);
     $db = erpPRODBActions::getInstance();
     $mainOpts = new erpPROMainOpts();
     $rel = erpProRelated::get_instance($mainOpts);
     $allCached = $db->getUniqueIds();
     $db->emptyRelTable();
     $plugin = easyRelatedPostsPRO::get_instance();
     global $wpdb, $wp_actions;
     foreach ($allCached as $key => $value) {
         $pid = (int) $value['pid'];
         if ($plugin->isInExcludedPostTypes($pid) || $plugin->isInExcludedTaxonomies($pid)) {
             continue;
         }
         $rel->doRating($pid);
     }
     echo json_encode(true);
     die;
 }
开发者ID:panvagenas,项目名称:easy-related-posts-pro,代码行数:35,代码来源:easyRelatedPostsPROAdmin.php

示例11: aa_pp_admin_header

/**
* aa_pp_admin_header()
*
* @return
*/
function aa_pp_admin_header()
{
    global $wpdb, $aa_PP, $aa_SIDS;
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page.'));
    }
    if (!current_user_can(8)) {
        wp_die(__("You are not allowed to be here without upload permissions"));
    }
    $aa_PP = get_option('askapache_password_protect');
    $aa_SIDS = get_option('askapache_password_protect_sids');
    @set_time_limit(60);
    @set_magic_quotes_runtime(0);
}
开发者ID:jkreska,项目名称:test1,代码行数:19,代码来源:askapache-password-protect.php


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