![]() |
Wordpress Gurus
Is it possible for a plugin to capture the text of a post someone has just entered in their posts area then perform an operation on that text before it gets placed into the database ?
Examples, taking the text and adding or removing elements, taking the text and adding or removing particular words or phrases ? |
Pretty much anything on the web is possible if you have programming skills and unlimited time.
With that being said... Good Luck! :thumbsup |
Sure, you can hook into the save_post action.
http://codex.wordpress.org/Plugin_AP...ence/save_post For a list of tons of other hooks: http://codex.wordpress.org/Plugin_API/Action_Reference |
Quote:
|
Hmm, content_save_pre might be closer to what you need according to this:
http://wordpress.stackexchange.com/q...-prior-to-save WordPress StackExchange has filled out really well with a lot of great information about customizing WP. |
yup, its possible.
|
Quote:
https://gfy.com/profile.php?do=addlis...gnore&u=162926 |
Quote:
http://wordpress.stackexchange.com/q...re-it-is-saved I'm well on the way now. I hardly ever write any plugins myself but I just needed to whip something up for testing an idea real quick thanks for the responses |
Quote:
|
Now you can add this info to your blog to teach newbies. LOL
|
Quote:
Quote:
|
Quote:
|
you want wp_insert_post_data
i did this, so when you publish a post it took you back a year ;) Code:
function back_to_the_future($data,$postarr) { like so Code:
function change_post_content($data,$postarr) { this will get you started. |
Hey, thanks heaps for that fris.
|
Just for anyone else who is interested in the solution here, based on fris' excellent example this is changing the post content, you could replace ucwords with any function or series of functions to modify your post content.
Code:
<?php |
glad it worked out ;)
|
All times are GMT -7. The time now is 12:27 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123