[wp-hackers] Plugin Problem - Working sometimes...
Stephen Rider
wp-hackers at striderweb.com
Fri Jul 25 17:30:52 GMT 2008
If he later saves the post again, won't it add a second footer?
I would use a filter, but add it only to posts last saved after
today. Then down the road if you ever edit a past post, you can
delete the old footer and the new save date will flag it to show the
new footer via filter. :)
Stephen
--
Stephen Rider
<http://striderweb.com/>
On Jul 24, 2008, at 11:50 PM, Gaarai wrote:
> The hook you most likely want to look into is the save_post action
> hook. You'll have to do some checks to see if you've modified the
> post or not, but that's a readily-solved problem.
>
> Travis Quinnelly [MUO] wrote:
>> I think we decided for this route since prior to this plugin, the
>> authors
>> were adding this to every post. Therefore, these "footers" are
>> already
>> inputted into hundreds of posts already as part of "the_content".
>>
>> Wouldn't this route duplicate those?
>>
>> On Thu, Jul 24, 2008 at 11:17 PM, Viper007Bond <viper at viper007bond.com
>> >
>> wrote:
>>
>>> Yeah, filters are the way to go here. You're doing it the really,
>>> really
>>> hard (and I guess technically "wrong") way.
>>>
>>> On Thu, Jul 24, 2008 at 9:08 PM, Gaarai <gaarai at gaarai.com> wrote:
>>>
>>>> Why are you directly modifying the post at all? If you think
>>>> about it, this
>>>> would work much better if you are just appending the data to each
>>>> post when
>>>> it is shown (I.E. hook to the the_content filter). The reason is
>>>> simple: if
>>>> the author ever changes their info, your current system doesn't
>>>> have a
>>>> method for updating the data that is already added to the posts.
>>>>
>>>> Travis Quinnelly [MUO] wrote:
>>>>
>>>>> This particular plugin appends each article with a custom "author
>>>>> footer"
>>>>> which is saved in each author's profile page to the db. It grabs
>>>>> the
>>>>> author
>>>>> footer, and places it at the end of the_content on publish.
More information about the wp-hackers
mailing list