WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/date edit pre

Description

The "date_edit_pre" filter is part of a group of dynamic filters. This filter runs in wp-admin when loading a post for editing.

Usage

When the 'date_edit_pre' filter is called, it is passed two parameters: the post date and the id of the post to be edited.

The date is passed in the format: year-month-day hours:minutes:seconds or Y-m-d H:m:s

Example: 2013-01-16 01:42:48

function filter_function_name( $date, $post_id ) {
  // Process content here
  return $date;
}
add_filter( 'date_edit_pre', 'filter_function_name', 10, 2 );

Where 'filter_function_name' is the function WordPress should call when filter is run. Note that the filter function must return a date after it is finished processing or the content will be empty.

filter_function_name should be unique function name. It cannot match any other function name already declared.

See Also