MrK
MrK

Reputation: 1078

Where is posts sent when stored in WordPress?

Where is posts sent to when stored in wordpress? not the database, but the actual php file ?

I need to know this because i am going to create some automatic images to be inserted if certein keywords are used such as "WIN_KEY" etc.

Upvotes: 1

Views: 52

Answers (1)

Kristoffer Svanmark
Kristoffer Svanmark

Reputation: 778

You should take a looka at the filter called the_content. With the filter you can run a "search and replace" to replace WIN_KEY with a tag.

Here's the doc for the_content filter: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content

Add your filter to your theme's functions.php file or other preferred location.

Example:

add_filter('the_content', 'my_the_content_filter');
function my_the_content_filter($content) {
    return str_replace('WIN_KEY', '<img src="my-image.png">', $content);
}

Upvotes: 1

Related Questions