I’ve been developing on WordPress for a couple of years now and I keep seeing the “at” (@
) sign in themes and plugins comments.
What is it for? Does it serve a special purpose in WordPress? Or is it just a general programming documentation thing? I haven’t been able to find anything about it thus far.
Examples of what I’ve seen in code:
@see woocommerce_output_product_data_tabs()
@uses load_theme_textdomain() For translation/localization support.
@since Twenty Thirteen 1.0
@return void
@param string $title Default title text for current view.
If there is documentation somewhere on what this is and how it should be used, I’d love to find it since this question has been bugging me for a while.
They are tags for PHPDoc, the PHP equivalent of Javadoc. These comment blocks can later be parsed by a tool like phpDocumentor to generate useful documentation.
It silences error messages (which in plugins and themes prevents them from being displayed to users). See this StackOverflow thread for more: https://stackoverflow.com/a/1032169/1293256