can’t modify post title using the_posts filter

Question

I tried to modify post title and content, content is modified in output, but title stays intact:

function filter_the_posts( $array , $oQuery) {
   ...
   $array[0]->post_title="new title";
   $array[0]->post_content="new content";
}

add_filter( 'the_posts', 'filter_the_posts', 10, 2 );

0
AVEbrahimi 3 months 2022-05-07T23:18:40-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse