Skip to main content
2 of 2
Don't shout.
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

Wordpress function to add text

I m using this simple function to add text to my wordpress site post !

add_filter( 'afip_new_post_content', 'myprefix_change_afip_post_content', 10, 2 );
/* Grabs the image source for the newly created image and inserts it
* into the new post content along with a one line paragraph. */
function myprefix_change_afip_post_content( $post_content, $attachment_id ) {
 
$my_uploaded_image = wp_get_attachment_image_src( $attachment_id );
$post_content = '<p>This is my new uploaded image....</p>';
return $post_content;

I'm trying to add the title , the author and the date to

$post_content = '<p>This is my new uploaded image....</p>';

How do i insert wordpress post title , post author and the date to the above text

Like

$post_content = ‘This post – $post_title() ; is uploaded by the_author() on the_time() on category the_category()
pradip
  • 70
  • 1
  • 10