Title: [Plugin: Magic Fields] Version 154 and Dates
Last modified: August 20, 2016

---

# [Plugin: Magic Fields] Version 154 and Dates

 *  Resolved [Thiago Fernandes](https://wordpress.org/support/users/thiagof/)
 * (@thiagof)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-magic-fields-version-154-and-dates/)
 * My blog after an mass update get erros using Write Panels. The panels still appear,
   but there was no Custom Fields on the writing post. Also, the behavior of date
   fields changed without asking, leaving me in trouble.
 * Admins can bring some light into as I didnt research a all, BUT HERE’S MY SOLUTION:
 * 1. For the missing customs fields on the write panel YOU SHOULD update your write
   panel via the administrator interface. Just enter on Magic Fields Plugin Admin
   and update your panel, as it is. This should do the trick behind the scenes.
   
   2. The dates stored in the wp_postmeta changed its format. Before it was stored
   in the format I’d selected for it to show up, but now it is stored in a regular
   SQL Date format (yyyy-mm-dd). SOLUTION: in my app I needed to change the SQL 
   Query to get both types of dates
 *     ```
       AND ( STR_TO_DATE(wpostmeta.meta_value, '%m/%d/%Y') >= '2011-05-01'
                OR STR_TO_DATE(wpostmeta.meta_value, '%Y-%m-%d') >= '2011-05-01' )
       ```
   
 * [http://wordpress.org/extend/plugins/magic-fields/](http://wordpress.org/extend/plugins/magic-fields/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Thiago Fernandes](https://wordpress.org/support/users/thiagof/)
 * (@thiagof)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-magic-fields-version-154-and-dates/#post-2102930)
 * You can also, for the date problem (more recommended), switch all your dates 
   to the new format. In this case you do not need to handle multiple formats, only
   the new one (yyyy-mm-dd).
 * Try this query
 *     ```
       UPDATE wp_postmeta
           SET meta_value = STR_TO_DATE( meta_value,  '%m/%d/%Y' )
           WHERE meta_key =  'date-field-name'
               AND STR_TO_DATE( meta_value,  '%m/%d/%Y' ) IS NOT NULL
       ```
   
 * REMEMBER to backup your table first. You should change the old value format to
   yours.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Magic Fields] Version 154 and Dates’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/magic-fields.svg)
 * [Magic Fields](https://wordpress.org/plugins/magic-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/magic-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/magic-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/magic-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/magic-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/magic-fields/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Thiago Fernandes](https://wordpress.org/support/users/thiagof/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-magic-fields-version-154-and-dates/#post-2102930)
 * Status: resolved