0

我在做什么错......这似乎不起作用......我不断收到以下错误

警告:无法修改标头信息 - 标头已由 /home/puretige/public_html/wp-includes/option 中的(输出开始于 /home/puretige/public_html/wp-content/plugins/Pure Tiger/puretiger.php:13)发送.php 在第 568 行

警告:无法修改标头信息 - 标头已由 /home/puretige/public_html/wp-includes/option 中的(输出开始于 /home/puretige/public_html/wp-content/plugins/Pure Tiger/puretiger.php:13)发送.php 在第 569 行

该插件在激活期间生成了 2 个字符的意外输出。如果您发现“标头已发送”消息、联合提要问题或其他问题,请尝试停用或删除此插件。

请注意我对此很陌生....

<?php
/*
Plugin Name: Pure Tiger Hosting
Plugin URI: http://www.puretigerhosting.com/wordpressplugin
Description: Themes, Plugins and Support from within your admin panel.
Version: 1.00
Author: Pure Tiger Hosting
Author URI: http://www.puretigerhosting.com
License: GPL2
*/
?>

<?php

add_action('admin_menu','register_custom_menu_page');

add_action('admin_menu','register_my_custom_submenu_page');

add_action('admin_menu','register_my_custom_submenu_page2');

add_action('admin_menu','register_my_custom_submenu_page3');



Function register_custom_menu_page() {

    add_menu_page('Pure Tiger', 'Pure Tiger','pure-tiger','add_users','','', 6);
}


/*-----------------------------Sub Pages--------------------------------------------*/


function register_my_custom_submenu_page() {
    add_submenu_page( 'pure-tiger','Themes','Themes','PTthemes','','','my_custom_submenu_page_themes');
}

function register_my_custom_submenu_page2() {
    add_submenu_page( 'pure-tiger','Plugins','Plugins','PTPlugins','','','my_custom_submenu_page_plugins');
}

function register_my_custom_submenu_page3() {
    add_submenu_page( 'pure-tiger','Ask a Question','Ask a Question','question','','','my_custom_submenu_page_question');
}


/*-----------------------------Themes--------------------------------------------*/

function my_custom_submenu_page_themes() {
    echo '<h3>Pure Tiger Themes</h3>';
}


/*-----------------------------Plugins--------------------------------------------*/

function my_custom_submenu_page_plugins() {
    echo '<h3>Pure Tiger Plugins</h3>';
}


/*-----------------------------Support--------------------------------------------*/

function my_custom_submenu_page_question() {
    echo '<h3>Pure Tiger Support</h3>';
}

?>
4

3 回答 3

0

尝试在插件声明之前删除打开的关闭 php 标签。

/*
Plugin Name: Pure Tiger Hosting
Plugin URI: http://www.puretigerhosting.com/wordpressplugin
Description: Themes, Plugins and Support from within your admin panel.
Version: 1.00
Author: Pure Tiger Hosting
Author URI: http://www.puretigerhosting.com
License: GPL2
*/



<?php

add_action('admin_menu','register_custom_menu_page');
//remaining code to follow....
于 2013-03-14T15:32:24.487 回答
0

版权声明后删除关闭?>和打开标签。<?php2 换行防止 wordpress 发送标题。

<?php
/*
Plugin Name: Pure Tiger Hosting
Plugin URI: http://www.puretigerhosting.com/wordpressplugin
Description: Themes, Plugins and Support from within your admin panel.
Version: 1.00
Author: Pure Tiger Hosting
Author URI: http://www.puretigerhosting.com
License: GPL2
*/

add_action('admin_menu','register_custom_menu_page');

add_action('admin_menu','register_my_custom_submenu_page');
于 2013-03-19T14:05:32.677 回答
-1

检查此插件是否尝试写入 cookie。

如果是这种情况,那么您的插件必须在任何 html 代码处理之前启动。因此,您必须在 index.php 的顶部启动插件,然后<!doctype ... >

一些关于 cookie 的阅读:http: //php.net/manual/en/features.cookies.php

于 2013-03-14T15:50:33.340 回答