1. Home
  2. Knowledge Base
  3. HappyPress
  4. Git Mirroring
  5. Documenting New Functions and Classes

Documenting New Functions and Classes

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:

*Function description*

@since <version_created_in>
@author <author_name>
@param <param_type> <param_name> <param_description>

@return <type> <return_name>

For example:

* Multiplies two numbers together
* @since 1.0.0
* @author Matt Oakley
* @param int $num_1 - The first number to multiple
* @param int $num_2 - The second number to multiple
* @return int $answer
function multiple_numbers( $num_1, $num_2 ) {
    $answer = $num_1 * $num_2;

    return $answer;
Updated on October 18, 2022

Was this article helpful?

Related Articles

Not the solution you were looking for?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support