How can I set up my Wordpress Blog to automatically run a str_replace on all posts’ content after submitting (before inputting it into the database)? I have a key->value array of a handful of terms and what I want them replaced with. I could use a filter - but I’d rather edit the content before it’s inputted, because that’s how I want the content, ultimately.
I am assuming you are wanting to check for bad words being used in a multi author setting. You would need to edit WP’s core files, which I don’t recomment. Maybe WP Content Filter will do the job?
rguy84: the array will possibly come from a rather large xml file - I don’t want wordpress to have to go out and grab that file every time soemone wants to read an article - which is what a filter would do, right?
No. It’s a football blog. On a server I have an XML file with 20k records of football player names and a hyperlink to their statistics.
I want to hyperlink each player automatically to their stats.
So after the user submits the content - I want to grab the XML file - loop through it and “str_replace(“player name”, “<a href=\“http://link.to.stats/player_name\\”>player name</a>”,$content);”
I figure if I implement a content filter it will have to run through the XML file each time someone loads a post, right?
Ah ok, you want a link adder thing so when Jerry Rice is listed you want his details. Gotcha!
My first question is do you maintain the xml file or is it something from espn?
I figure if I implement a content filter it will have to run through the XML file each time someone loads a post, right?
If done correctly the link will be stored in the post in the database
Any chance you know how to work the Wordpress / Facebook like connection? I’m getting the blog info in my facebook like’s and would rather just the title. I can have it post just the article title if the person clicks like on the single page - but I don’t know how to change the meta info for each individual article that is listed on the homepage. Any idea?
Basically on another site I run, BaseballMoves.com | Fantasy Baseball news, analysis, draft guide, projections, cheatsheets - if you click like on an article on the index OR on the individual post pages it posts to facebook the title of the article + the blog info (i.e. it doesn’t just post to facebook “Boston General Hospital” it posts “Boston General Hospital | Fantasy Baseball news, analysis, draft guide, projections, cheatsheets” - I want it to post just the article title to facebook …
That is what I thought you meant. I assume you are using some plugin for that. You will need to edit it. I think that is calling bloginfo, try adjusting it to wp_title()