Adding more text to a post, after it was published

I’m trying to build a wp plugin, which will basically add some text for every post, in the post itself, I’m afraid that the codex is too large for me to even know what to look for, so I’d appreciate if someone could point me in the right direction.

Edit: As per request, the info should be added to the post’s text on the database, at the end of the post, it’s not static, it’s a random embed from a tube site, based on a query I run on the tubesite.

Related posts

Leave a Reply

1 comment

  1. Your best bet is to use the the_content filter hook and add your content to the post
    “on the fly” for ex:

    add_filter('the_content','add_my_extra_content');
    
    function add_my_extra_content($content){
       $my_extra = "<h5>this is the extra content</h5>';
    
       //add before post content
       // return $my_extra.$content;
    
       //add after post content
       return $content.$my_extra.;
    
    }