Viewing 1 replies (of 1 total)
  • Plugin Author ka2

    (@ka2)

    Thank you for your inquiry.

    How to use the new filter of “cdbt_shortcode_datetime_format” is as follows:

    1. the case of filtering by the table name and the column name.

    function custom_filter_datetime( $datetime_format, $column, $column_type, $shortcode_name, $table ){
      if ( 'your_table_name' === $table && 'date_column_name' === $column ) {
        $datetime_format = 'M j, Y g:i A';
      }
      return $datetime_format;
    }
    add_filter( 'cdbt_shortcode_datetime_format', 'custom_filter_datetime', 10, 5 );

    2. the case of filtering by the type format of column.

    function custom_filter_datetime( $datetime_format, $column, $column_type, $shortcode_name, $table ){
      if ( 'date' === $column_type ) {
        $datetime_format = 'M j, Y';
      }
      return $datetime_format;
    }
    add_filter( 'cdbt_shortcode_datetime_format', 'custom_filter_datetime', 10, 5 );

    Please try it.

    Thank you,

Viewing 1 replies (of 1 total)
  • The topic ‘How to customize the date’ is closed to new replies.