内容 |
很多童鞋发现升级到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' ); ?>
|