Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm developing a plugin to replace a character that google doesn't show it with an accepted character. I want to get all the texts that wordpress returns (content, comments, title, names, etc.) but I don't know what hook should I use to do it. Can anybody help me?

share|improve this question
    
Try the Codex Filter Reference. This question is far too broad for WPSE's question-and-answer format. –  Chip Bennett Dec 20 '12 at 20:34
    
In addition to what @Chip said: also see Adam Brown's WordPress Hooks Database. –  bungeshea Dec 21 '12 at 1:23
add comment

1 Answer

up vote 1 down vote accepted

There's a lot of filter hooks available, and your question is rather board. However, generally WordPress-generated content is handled by three hooks:

  • the_title: applied to the post title retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks).
  • the_content : applied to the post content retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks).
  • comment_text: applied to the comment text before displaying on the screen by the comment_text function, and in the admin menus

These filters only moderfy the front-end of your site, meaning that the content will appear unfiltered in the admin area and in the database.

You can filter the content attatched to these hooks by writing a PHP function and then registering it with your hook:

add_filter( 'comment_text', 'my_func' );

To see an example of how these filters can be used, have a look at the capital_P_dangit() function.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.