Filter
uncanny-automator
automator_date_format
Filters the default date format used throughout the Automator plugin, allowing customization of how dates are displayed.
add_filter( 'automator_date_format', $callback, 10, 1 );
Description
Allows developers to customize the default date format used throughout the plugin. This filter fires when the plugin needs to retrieve its standard date format. Developers can use this to change the output of dates to match their specific needs or theme.
Usage
add_filter( 'automator_date_format', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
// Change the date format to a more concise YYYY-MM-DD format.
add_filter( 'automator_date_format', 'my_custom_automator_date_format', 10, 1 );
function my_custom_automator_date_format( $default_format ) {
// If the default format is the standard 'F j, Y', override it.
if ( 'F j, Y' === $default_format ) {
return 'Y-m-d';
}
// Otherwise, return the format provided by other filters.
return $default_format;
}
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/core/class-utilities.php:187
public static function automator_get_date_format() {
return apply_filters( 'automator_date_format', 'F j, Y' );
}