Created
September 7, 2012 14:43
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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