WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom fields in 3.4.2 (19 posts)

  1. pwnst
    Member
    Posted 1 year ago #

    Hello,

    I updated to 3.4.2 few hours ago and I cant get my custom fields in posts to work. Every time I try to add a new custom field nothing happens. I got no problem in earlier versions.

    - I got no addons/plugins and I've tried without my functions.php.

    - I get the same result with Opera and Chrome.

    -Thanks

  2. sharecommons
    Member
    Posted 1 year ago #

    Yeah .. Same here. I use 4 custom fields in my posts. Earlier I used to add values for those 4 custom fields one after the other. But after upgrading, I add one custom field, hit ADD CUSTOM FIELD button and the button disappears. I have to hit "Save as draft" and the custom fields button re-appears. For 4 custom fields, I have to do the Save As Draft thing 4 times. Then I can publish the post. Although it works but then I look at 4 post revisions that were created because of saving over and again.

    Someone suggested to download the WordPress package and then Overwrite the WP-Admin and WP-Includes folders on your server taken from the package. I'm gonna try that and see if that works. Will let you know if it worked.

  3. Ryan Paul
    Member
    Posted 1 year ago #

    I am getting this too.

    This is DEFINITELY a bug.

    Sometimes when clicking Add Custom Field The button sometimes disappears momentarily, turns yellow, and reappears in the box above...

    And sometimes when clicking Add Custom Field the button disappears and gets replaced with some line about custom fields in your theme.

    When will this bug be fixed? It's crippling my job atm :(

  4. Hey Guys,

    There is a known bug in 3.4.2 with custom fields and the add / update buttons. To fix this you will need to install the hot fix plugin. http://wordpress.org/extend/plugins/hotfix/

  5. sharecommons
    Member
    Posted 1 year ago #

    Hey Chris,

    I understand that hotfix plugin may fix this problem but I do not consider that a good solution. Not everyone loves putting up a pile of plugins in their WordPress installation. I hate keeping too many plugins and I try to keep minimum plugins.
    A better solution would have been a DIY article. I will fix this problem, suggest it to WordPress folks (if someone hasn't already) and also write and publish a DIY article.
    THAT would be a better solution.

    Thanks for the help anyway.

  6. sharecommons
    Member
    Posted 1 year ago #

    Yeah Ryan, that little freakin button is playing nuts lol. It is running around all over the place :D

  7. Add this code snippet to your functions.php file to fix the custom fields bug in 3.4.2:

    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' );
  8. nobita
    Member
    Posted 1 year ago #

    Hi

    http://wordpress.org/extend/plugins/hotfix/

    but new custom field is not add the fields list.

    show post and reedit post.

    then new custom field display custom fields list.

    Thank you.

  9. pwnst
    Member
    Posted 1 year ago #

    Hi,

    Thanks for the solution Chris. Works for me at least. =)

  10. m zamin
    Member
    Posted 1 year ago #

    Chris, your code works here too.

    THanks

  11. m zamin
    Member
    Posted 1 year ago #

    HI
    CHris that code is making template files all code cleaned up when updated.

  12. kmenon
    Member
    Posted 1 year ago #

    Thanks Chris, your help is greatly appreciated! Had the same problem, both your solutions worked for me!

  13. mattcass
    Member
    Posted 1 year ago #

    Nicely done Chris, thanks for the code snippet. Works like a charm.

  14. tobbe_l
    Member
    Posted 1 year ago #

    Neither the hotfix or the snippet posted here works for me. No customs fields showing on my wp 3.4.2. Suggestions?

  15. tobbe_l
    Member
    Posted 1 year ago #

    My bad. I'm not worthy. Egg all over my face.

    I´ve totally missed the panel settings. Everything works A-OK now after I acivated the custom fields in the panel settings.

    This just shows how used I got to my old WP-rig...

  16. drmen8x
    Member
    Posted 1 year ago #

    Thank you @Chris Olbekson, it done for me and i have fixed for all my website. Thank you again!

  17. motocomdigital
    Member
    Posted 1 year ago #

    Seriously I lost an day to this bug before I realised it was 3.4.2 causing the issue!

    What the hell!!!

    Anyway, thanks chris for your solution, however, am I missing something?

    I put this code into functions...

    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' );

    ...and although I can actually add multiple custom fields in one go (as oppose to the bug where you can only add one at a time and you need to hit post update in order to apply it)

    I'm not seeing the freshly added custom post types appear before my eyes?

    I have to refresh the page (without hitting post update) in order to see my recently added custom fields?

    Is this correct? - as this is not an absolute fix for me, only a partial one.

    Thanks

  18. Ryan
    Member
    Posted 1 year ago #

    Thanks Chris. Worked like a champ.

  19. kristinachilds
    Member
    Posted 1 year ago #

    omg chris, may the ground you walk on be fraught with blessings. thank you so much that was driving me nuts!

Topic Closed

This topic has been closed to new replies.

About this Topic