wordpress bible 插件 第一个例子是 讲在帖子后增加版权内容的。我把相关代码弄到一起,可总是也调试不好。请问:哪位有完整的?我下面的总出错啊!
<?php
/*
Plugin Name: ABC 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 copyright_notices_admin()
{
?>
<div class=”wrap”>
<h2>Copyright Notices Configuration</h2>
<p>On this page, you will configure all the aspects of this
plugins.</p>
<form action=”” method=”post” id=”copyright-notices-conf-form”>
<h3><label for=”copyright_text”>Copyright Text to be inserted
in the footer of your theme:</label></h3>
<p><input type=”text” name=”copyright_text” id=”copyright_
text” value=” <?php echo esc_attr( get_option(‘copyright_notices_text’) )
?> “ /></p>
<p class=”submit”><input type=”submit” name=”submit”
value=”Update options &raquo;” /></p>
<?php wp_nonce_field(‘copyright_notices_admin_optionsupdate’);
?>
</form>
</div>
<?php
}function copyright_notices_admin_page() {add_submenu_page( 'plugins.php','Copyright Notices Configuration', 'Copyright Notices Configuration', 'manage_options', 'copyright-notices' 'copyright_notices_admin');}
//Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in E:\xampp\htdocs\chinese\wp-content\plugins\copyright.php on line 35add_action('admin_menu', 'copyright_notices_admin_page');function save_copyright_notices(){if( check_admin_referer('copyright_notices_admin_options-update') ){if( update_option( 'copyright_notices_test', stripslashes( $_POST['copyright_text'] ) ) ) wp_redirect( __FILE__ . '?updated=1' );}}add_action( 'load-plugins_page_copyright-notices', 'save_copyright_notices' );
function display_copyright()
{
if( $copyright_text = get_option(‘copyright_notices_text’ ) )
{
echo ‘<p class=”copyright_text”>’ . $copyright_text . ‘</p>’;
}
}
add_action(‘wp_footer’,’display_copyright’);
function display_copyright_feed( $post_content )
{
if( !$copyright_text = get_option(‘copyright_notices_text’) || !is_
feed() )
return $post_content;
return $post_content . $copyright_text;
}
add_filter(‘the_content’,’display_copyright_feed’);
?>