• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

wordpress圣经 的源码 有有关问题吗

php 搞代码 4年前 (2022-01-24) 28次浏览 已收录 0个评论
文章目录[隐藏]

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’]))

附原码:
<?php

/*

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_

2本文来源gao!daima.com搞$代!码网

搞代gaodaima码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’) . ‘.

‘;

}

?>

<?php _e(‘Copyright Notices Configuration’,’copyright-notices’) ?>

<?php _e(‘On this page, you will configure all the aspects of this plugins.’,’copyright-notices’) ?>

” />


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:wordpress圣经 的源码 有有关问题吗

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址