Support

Account

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