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

Plugin API/Filter Reference/author edit pre


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


When the 'author_edit_pre' filter is called, it is passed two parameters: the user id of the post author and the id of the post to be edited

function filter_function_name( $user_id, $post_id ) {
  // Do user manipulation here
  return $user_id;
add_filter( 'author_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 an integer after it is finished processing or the author will be empty.

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

See Also