This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
post_date_column_time filter
Filters the published time of the post.
apply_filters( 'post_date_column_time', string $t_time, WP_Post $post, string $column_name, string $mode )
Description
This hook is used for filtering the published time of a post.
If $mode
equals excerpt, the published time and date are both displayed. If $mode
equals list (default), the publish date is displayed, with the time and date together available as an abbreviation definition.
Parameters
- $t_time : (string) The published time.
- $post : (WP_Post) Post object.
- $column_name : (string) The column name.
- $mode : (string) The list display mode (‘excerpt’ or ‘list’).
Live Examples
Example 1: Basic Hook Usage
To run the hook, you can use the following example:
$t_time = apply_filters( 'post_date_column_time', $t_time, $post, $date, $mode ); if ( !empty( $t_time ) ) { // everything has led up to this point... }
Example 2: Adding a Hook Callback
The following example demonstrates how to add a hook callback:
// define the post_date_column_time callback function weplugins_filter_post_date_column_time( $t_time, $post, $date, $mode ) { // make filter magic happen here... return $t_time; }; // add the filter add_filter( 'post_date_column_time', 'weplugins_filter_post_date_column_time', 10, 4 );
Example 3: Removing a Hook Callback
To remove a hook callback, use the following example:
// remove the filter remove_filter( 'post_date_column_time', 'weplugins_filter_post_date_column_time', 10, 4 );
Contact Us
If you need any customization or assistance, feel free to contact us.
Explore the latest in WordPress
Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.