ACF Custom validation message not showing up

Add this snippet and check according to your needed. add_action(‘acf/validate_save_post’, ‘my_acf_validate_save_post’); function my_acf_validate_save_post() { $start = $_POST[‘acf’][‘field_5fb0e816ea4fc’]; //$start = new DateTime($start); $start = strtotime($start); $end = $_POST[‘acf’][‘field_5fb0e83aea4fd’]; //$end = new DateTime($end); $end = strtotime($end); if( current_user_can(‘manage_options’) ) { acf_reset_validation_errors(); } // check custom $_POST data if ($start > $end ) { acf_add_validation_error($_POST[‘acf’][‘field-600e609de8ab8’], ‘End Date should … Read more

Advanced custom fields sort repeater by date

I think this is not possible with the API functions provided by ACF. I would try to save the values to a temporary array first and then sort the values inside the array with php (using krsort() for example). Something like this (just to give an idea): while(has_sub_field(‘in_the_news’)) { $date = get_sub_field(‘published_date’); // $date = … Read more

Set default date in datepicker of an advanced custom field

It depends on the datepicker plugin you are using. Mostly all datepickers will have a default value you can play with. Usualy it is set within the input text type that hosts the datepicker. <input type=”text” class=”datepicker” default-value=”2013/07/25″> And in wordpress’ php you can do : <input type=”text” class=”datepicker” default-value=”<?php echo date(“Y/m/d”); ?>”>

Add jQuery UI datepicker to admin panel

maybe you include your scripts ui-core and picker too early. Use wp_enqueue script() to include on the right hook. You must not include ui-core, only datepicker! example: wp_enqueue_script( ‘jquery-ui-datetimepicker’, \ $this->get_plugins_url( ‘js/ui.datetimepicker.js’, __FILE__ ), \ array(‘jquery-ui-core’) , 0.1, TRUE );` any tutorials: http://wpengineer.com/415/use-javascript-libraries-in-and-of-wordpress/ http://codex.wordpress.org/Function_Reference/wp_enqueue_script http://wpengineer.com/2028/small-tips-using-wordpress-and-jquery/ I use the datepicker on different plugins and works fine, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)