[wp-hackers] applying a filter to when a new post is made
Amit Gupta
amit at igeek.info
Mon Aug 9 21:48:46 UTC 2004
so, if following is my function code
function myFunction($content)
{
// do some thing with $content here
$content = "<strong>".$content."</strong>";
return $content;
}
add_action('publish_post', 'myFunction', 0);
add_action('edit_post', 'myFunction', 0);
will I get the content of the post wrapped between <strong> & </strong>
tags? I was thinking of converting backslashes in the code
sections(HTML, CSS, PHP, JAVA, SQL), as HTML entities, when using
iG:Syntax Hiliter plugin, so that they are displayed as backslashes.
Currently WordPress strips them from the post content, so obviously they
don't appear in the post.
-----
Amit
---------- Original Message from chuckg at blindmuse.com
<mailto:chuckg at blindmuse.com> ----------
Amit Gupta wrote:
> Is there a hook or whatever its called so that I can calla custom
> function of a plugin, whenever a new post is madeor an old one is
> edited, before saving the post content to db?
add_action('publish_post', 'functionName', 0);
add_action('edit_post', 'functionName', 0);
Where the functionName is the function you want to happen when
a post is edited or published. I believe you can pass a $id or
$content type value to this to modify the actual content. I'm
not entirely positive, however.
Hope that answers your question, in short. I'm sure others will
have more advanced knowledge if necessary.
chuckg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/hackers_wordpress.org/attachments/20040810/87667464/attachment.htm
More information about the hackers
mailing list