WordPress.org

Make WordPress Core

Ticket #21829: fix-custom-fields-in-wp342.php

File fix-custom-fields-in-wp342.php, 745 bytes (added by SergeyBiryukov, 22 months ago)
Line 
1<?php
2/*
3Plugin Name: Fix Custom Fields in WP 3.4.2
4Version: 0.1
5Plugin URI: http://core.trac.wordpress.org/ticket/21829
6Description: Implements a workaround for adding and updating custom fields in WordPress 3.4.2.
7Author: Sergey Biryukov
8Author URI: http://profiles.wordpress.org/sergeybiryukov/
9*/
10
11function fix_custom_fields_in_wp342() {
12        global $wp_version, $hook_suffix;
13
14        if ( '3.4.2' == $wp_version && in_array( $hook_suffix, array( 'post.php', 'post-new.php' ) ) ) : ?>
15<script type="text/javascript">
16jQuery(document).delegate( '#addmetasub, #updatemeta', 'hover focus', function() {
17        jQuery(this).attr('id', 'meta-add-submit');
18});
19</script>
20<?php
21        endif;
22}
23add_action( 'admin_print_footer_scripts', 'fix_custom_fields_in_wp342' );
24?>