[wp-hackers] register_*() vs. add_*()?

Mike Schinkel mikeschinkel at newclarity.net
Sat Mar 19 18:17:46 UTC 2011


I'm trying to understand the rationale between prefixing core functions with "register_" vs. "add_" as a prefix.  I can't seem to recognize why one is used at times and the other is used at times.  Examples from core:

add_shortcode()
add_rewrite_rule()
add_action()
add_custom_background()

register_post_type()
register_taxonomy()
register_nav_menu()
register_sidebar()

I'm working on code I could envision offering up as proposed additions to core so that's why I'm interested in the difference.

Thanks in advance.

-Mike
P.S. I think I asked this question on trac before but didn't get a good answer.


More information about the wp-hackers mailing list