wordpress聖經 的源碼 有有關問題嗎

來源:互聯網
上載者:User
wordpress聖經 的源碼 有問題嗎?
wordpress 聖經 在講Chapter 5: Extending WordPress with Plugins時,有個例子,我在試用時出現這樣的問題,請高手指點:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'copyright-notices' not found or invalid function name in E:\xampp\htdocs\chinese\wp-includes\plugin.php on line 405:

call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']))

附原碼:

/*

Plugin Name: Copyright Notices

Plugin URI: http://emmense.com/copyright-notices/

Description: A plugin that allows the user to set Copyright text in the theme and control it from WordPress Admin.

Author: Aaron Brazell

Version: 1.0

Author URI: http://technosailor.com/

*/



function i18n_copyright()

{

$plugin_path = plugin_basename( dirname( __FILE__ ) .'/translations' );

load_plugin_textdomain('copyright-notices', $plugin_path );

}

add_action('init','i18n_copyright');



function copyright_notices_admin_page() {

add_submenu_page( 'plugins.php',__('Copyright Notices Configuration'), __('Copyright Notices Configuration','copyright-notices'), 0, 'manage_options', 'copyright-notices', 'copyright_notices_admin');

}

add_action('admin_menu', 'copyright_notices_admin_page');

function copyright_notices_admin()

{

if( $_POST['submit'] )

{

if( check_admin_referer('copyright_notices_admin_options-update') )

{

$options_saved = false;

if( $oldvalue = get_option('copyright_notices_text') )

{

update_option( 'copyright_notices_text', $_POST['copyright_text'] );

if( $oldvalue == get_option('copyright_notices_text') )

{

$options_saved = true;

}

}

else

{

if( add_option( 'copyright_notices_text', $_POST['copyright_text'] ) )

{

$options_saved = true;

}

}

}

}

if( $options_saved )

{

echo '

' . __('Options Saved','copyright-notices') . '.

';

}



?>









:



  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.