很多童鞋發現升級到 WordPress 3.4.2 版後,添加自定義欄目按鈕失效,這可能是 WP 所有版本中最明顯的 BUG,瘋狂升級的結果。

雖然官方對此 BUG 未作出響應,不過非官方的修復方法已有人給出,你可以不必等待版本升級,先使用該插件臨時解決該問題。

插件下載地址:http://WordPress.org/extend/plugins/hotfix/

上傳空間插件目錄並啓用即可。

或者將下面代碼添加到主題的 functions 模版中

<?php  
/*
Plugin Name: Fix Custom Fields in WP 3.4.2 
Version: 0.1 
Plugin URI: http://core.trac.WordPress.org/ticket/21829 
Description: Implements a workaround for adding and updating custom fields in WordPress 3.4.2. 
Author: Sergey Biryukov 
Author URI: http://profiles.WordPress.org/sergeybiryukov/ 
*/ 
 
function fix_custom_fields_in_wp342() {  
        global $wp_version, $hook_suffix;  
 
        if ( '3.4.2' == $wp_version && in_array( $hook_suffix, array( 'post.php', 'post-new.php' ) ) ) : ?>  
<script type="text/javascript">  
jQuery(document).delegate( '#addmetasub, #updatemeta', 'hover focus', function() {  
        jQuery(this).attr('id', 'meta-add-submit');  
});  
</script>  
<?php  
        endif;  
}  
add_action( 'admin_print_footer_scripts', 'fix_custom_fields_in_wp342' );  
?>

代碼來源:http://core.trac.WordPress.org/attachment/ticket/21829/fix-custom-fields-in-wp342.php

相信官方很快會修正該 BUG 。