• I’ve seen some pretty fancy stuff done with add_filter, but I think what I want needs something else.
    I want to scan the post for keywords and replace them. But, say that I want to grab a link from another feed every time I mention the name of the feed. Now, I want to do this replacement before the post is put in the DB, because I need to use the link that appeared in the feed at the time I posted, not at the time my post is viewed. (Am I clear?)
    What would I want to use?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter RobotHero

    (@robothero)

    Okay, I think I’ll change the format_to_post function in functions.php, adding $content = apply_filters(‘format_to_post’, $content);
    And then I should be able to use my-hacks.php to define the specific stuff.
    function format_to_post($content) {
    global $post_autobr,$comment_autobr;
    $content = addslashes($content);
    if ($post_autobr || $comment_autobr) { $content = autobrize($content); }
    $content = apply_filters('format_to_post', $content);
    return $content;
    }

    Good idea, I’ll add that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtered before posting?’ is closed to new replies.