Home › Forums › General Issues › ACF and Revolution Slider date display › Reply To: ACF and Revolution Slider date display
Other plugins do not use ACF functions like get_value() to get values stored in the database, they generally use get_post_meta(), a WP function. Because of this there isn’t any way to make ACF convert the format of the stored value into the display format that you want.
There are a couple of choices. The first is to look into the documentation for rev slider and see if there are any filter hooks available for you to use to alter the display of custom fields. There should be, it is an extensive plugin, and it’s a premium plugin. At any rate, the best information and help for this will come from the rev slider developers or other developers that use it.
The second choice is to create a new custom field that will hold the date in the format that you want it to be saved in and then use that field in rev slider instead of the acf field.
add_filter('acf/update_value/name=my_date_field', 'store_date_for_other_use', 10, 3);
function store_date_for_other_use($value, $post_id, $field) {
// change format to your date format
$date = date('Y-m-d H:i:s', strtotime($value);
// use this field meta key in other plugins
$new_field = 'displayable_date';
update_post_meta($post_id, $new_field, $date);
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.