Skip to content

Instantly share code, notes, and snippets.

@bueltge
Created September 7, 2012 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bueltge/3666774 to your computer and use it in GitHub Desktop.
Save bueltge/3666774 to your computer and use it in GitHub Desktop.
Implements a workaround for adding and updating custom fields in WordPress 3.4.2
<?php
/**
* Plugin Name: Fix Custom Fields in WP 3.4.2
* Version: 0.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:
* Author URI:
*/
if ( ! function_exists( 'fix_custom_fields_in_wp342' ) ) {
add_action( 'admin_footer-post.php', 'fix_custom_fields_in_wp342' );
add_action( 'admin_footer-post-new.php', 'fix_custom_fields_in_wp342' );
function fix_custom_fields_in_wp342() {
if ( version_compare( $GLOBALS['wp_version'], '3.4.2', '!=' ) )
return NULL;
?>
<script type="text/javascript">
jQuery(document).delegate( '#addmetasub, #updatemeta', 'hover', function() {
jQuery(this).attr('id', 'meta-add-submit');
});
</script>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment