Recently I encountered an issue with the WordPress custom-fields not working. I first did a Google search on “WordPress custom fields not working” and found information regarding extra lines in the functions.php file. I checked to make sure that I did not have any extra lines. I then checked my recent code changes and then checked disabling plugins. I then did a more thorough search on Google searching on “WordPress custom fields not working”, “WordPress custom fields broken” and the WordPress support forum. With my final search I found a post explaining that there is a known bug in 3.4.2 with custom fields and the add/update buttons.
Solutions to fixing WordPress Custom Fields Not Working
Add code snippet to your functions.php file:
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' );
Install Hotfix plugin:
http://wordpress.org/extend/plugins/hotfix/