{"id":1417,"date":"2022-10-18T21:48:48","date_gmt":"2022-10-18T20:48:48","guid":{"rendered":"https:\/\/wearesmile.com\/help\/?post_type=ht_kb&#038;p=1417"},"modified":"2022-10-18T21:48:50","modified_gmt":"2022-10-18T20:48:50","slug":"documenting-new-functions-and-classes","status":"publish","type":"ht_kb","link":"https:\/\/wearesmile.com\/help\/documentation\/documenting-new-functions-and-classes\/","title":{"rendered":"Documenting New Functions and Classes"},"content":{"rendered":"\n<p>When updating the changelog, you should ensure that all newly created functions and classes are documented with a comment that adheres to the following format:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*Function description*\n\n@since &lt;version_created_in>\n@author &lt;author_name>\n@param &lt;param_type> &lt;param_name> &lt;param_description>\n\n@return &lt;type> &lt;return_name><\/code><\/pre>\n\n\n\n<p>For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n* Multiplies two numbers together\n*\n* @since 1.0.0\n* @author Matt Oakley\n*\n* @param int $num_1 - The first number to multiple\n* @param int $num_2 - The second number to multiple\n*\n* @return int $answer\n**\/\nfunction multiple_numbers( $num_1, $num_2 ) {\n    $answer = $num_1 * $num_2;\n\n    return $answer;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When updating the changelog, you should ensure that all newly created functions and classes are documented with a comment that adheres to the following format: For example:<\/p>\n","protected":false},"author":5,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_searchwp_excluded":"","footnotes":""},"ht-kb-category":[111],"ht-kb-tag":[],"class_list":["post-1417","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-git-mirroring"],"_links":{"self":[{"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/ht-kb\/1417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/comments?post=1417"}],"version-history":[{"count":1,"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/ht-kb\/1417\/revisions"}],"predecessor-version":[{"id":1418,"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/ht-kb\/1417\/revisions\/1418"}],"wp:attachment":[{"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/media?parent=1417"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/ht-kb-category?post=1417"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/wearesmile.com\/help\/wp-json\/wp\/v2\/ht-kb-tag?post=1417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}