wordpress - 没有插件页面的权限

时间:2021-08-08 19:20:15

when i try to open the plugin file it gives me an error "You do not have sufficient permissions to access this page". how can access my page!

当我尝试打开插件文件时,它给出了一个错误“您没有足够的权限来访问此页面”。怎么可以访问我的页面!

here is my code !

这是我的代码!

<?php
/*
Plugin Name: Plugin Display
Plugin URI: http://test.com
Description: Plugin for displaying info
Author: rohail
Version: 1.0
Author URI: http://test.com
 */

add_action('wp', 'prefix_setup_schedule');
/**
 * On an early action hook, check if the hook is scheduled - if not, schedule it.
 */
function prefix_setup_schedule() {
    if (!wp_next_scheduled('prefix_hourly_event')) {
        wp_schedule_event(time(), 'hourly', 'prefix_hourly_event');
    }
}

add_action('prefix_hourly_event', 'prefix_do_this_hourly');
/**
 * On the scheduled action hook, run a function.
 */
function prefix_do_this_hourly() {
    echo "test test";
}
?>

1 个解决方案

#1


usually due error(s) in the code

通常是代码中的到期错误

error can viewed by setting WP_DBUG to TRUE in wp-config file

通过在wp-config文件中将WP_DBUG设置为TRUE可以查看错误

WP_DEBUG is a PHP constant, used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php

WP_DEBUG是一个PHP常量,用于在整个WordPress中触发“调试”模式。默认情况下它假定为false,并且通常在wp-config.php中设置为true

#1


usually due error(s) in the code

通常是代码中的到期错误

error can viewed by setting WP_DBUG to TRUE in wp-config file

通过在wp-config文件中将WP_DBUG设置为TRUE可以查看错误

WP_DEBUG is a PHP constant, used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php

WP_DEBUG是一个PHP常量,用于在整个WordPress中触发“调试”模式。默认情况下它假定为false,并且通常在wp-config.php中设置为true