user1838222
user1838222

Reputation: 113

Wordpress edit post on display?

I am developing a plugin, to modify a post for SEO purposes but on display.

Anyway my plugin checks the useragent & ip and then matches who is a search engine etc., and then edits the post/page content by removing links etc via regex.

How ever i am having trouble editing the post when it is shown ? So when the page is caleld how do i edit the content?

Upvotes: 1

Views: 235

Answers (1)

Nazim
Nazim

Reputation: 564

In order to change the post before displaying use Filter Hook content_edit_pre

add_filter('content_edit_pre','your_callback_function');

function your_callback_function(){
 // implement your changes here
 }

Visit http://codex.wordpress.org/Plugin_API/Filter_Reference/content_edit_pre

Upvotes: 4

Related Questions