문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top