Timeline for Should I use add_action('publish_post or add_filter('publish_post?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 19, 2015 at 7:21 | vote | accept | alex | ||
S Feb 15, 2015 at 17:52 | history | suggested | Greenonline | CC BY-SA 3.0 |
Added code formatting for print_r
|
Feb 15, 2015 at 17:00 | comment | added | alex | @birgire wow never looked into the add_action function, that indeed is suprising. Thanks for the class_exists suggestion! | |
Feb 15, 2015 at 16:34 | comment | added | birgire |
ps: it's rather surprising at first to see that the add_action function definition is actually only a single line of code, namely a call to the add_filter() function ;-)
|
|
Feb 15, 2015 at 16:25 | review | Suggested edits | |||
S Feb 15, 2015 at 17:52 | |||||
Feb 15, 2015 at 16:19 | comment | added | Pieter Goosen | @birgire great spot :-) | |
Feb 15, 2015 at 16:17 | comment | added | birgire |
You should consider using the hook mentioned by @PieterGoosen and additionally you might want to add a if( class_exists( 'Attachments' ) ) check into your code so it won't break if the corresponding external plugin is removed.
|
|
Feb 15, 2015 at 16:07 | answer | added | Pieter Goosen | timeline score: 5 | |
Feb 15, 2015 at 15:53 | history | edited | alex | CC BY-SA 3.0 |
added 23 characters in body
|
Feb 15, 2015 at 15:45 | history | asked | alex | CC BY-SA 3.0 |