redacademy / it-winter-2018

2 stars 2 forks source link

function name prefix #4

Closed resonantdoghouse closed 6 years ago

resonantdoghouse commented 6 years ago

In general you should try to prefix your function names with your project or company name e.g. instead of people_posttype you could prefix with it e.g. it_ people_post_type

The reason this is important is it helps a bit to avoid errors, namespace collisions, e.g. if you install another plugin that has a function name people_post_type an error would occur. Although it seems unlikely that this may happen it's considered best practice to prefix all functions with your company or project name.

https://github.com/redacademy/it-winter-2018/blob/cf684effeca6adc3f68a3c56649aacfb086c7b23/plugins/it-functionality/lib/functions/post-types.php#L12

DakotaPaige commented 6 years ago

Fixed on custom post types and taxonomies in it-functionality commit: d6d16c444361df879674418a0c35123e543b2549