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!
📣 “ACF Chat Fridays”
— Advanced Custom Fields (@wp_acf) January 31, 2023
The ACF team holds their first open office hours this Friday! Come and talk ACF, and ask questions about building sites with the plugin.
We’d love to see you there!
📆 Friday 3rd Feb - 3pm UTC
👉 Register here - https://t.co/3UtvQbE4CU pic.twitter.com/oTwW9K1XQ0
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.