Inside get_posts()
method of the WP_Query
class (line 3769), you will find out this filter:
$this->posts = apply_filters_ref_array( 'the_posts', array( $this->posts, &$this ) );
It’s the very first hook you can use to modify queried posts on both back-end and front-end.
$this->posts
is an array of queried posts so it’s easy to modify the content of each posts for your purposes.
Example, we want to change the first post content:
function wpse_modify_post_content($args) {
$args[0]->post_content="This filter filters the content of a post right after it is fetched from the database";
return $args;
}
add_filter('the_posts', 'wpse_modify_post_content');
For specific edit screen, you can use content_edit_pre
filter. This filter accepts two parameters.
Example:
function wpse_content_edit_pre($content, $post_id) {
$content="This filter filters the content of a post which being loaded for editting.";
return $content;
}
add_filter('content_edit_pre', 'wpse_content_edit_pre', 10, 2);
I recommend you to take a look at Filter Reference.