Skip to content

Commit

Permalink
Implement changes to the XML documentation asked during review
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed Jul 29, 2024
1 parent fa399d1 commit 5dd8031
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions WordPress/Docs/WP/GetMetaFunctionSingleParameterStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
>
<standard>
<![CDATA[
When calling the get_(comment|post|site|term|user)_meta(), get_metadata(), get_metadata_default(),
and get_metadata_raw() functions, if the $meta_key/$key parameter is passed, the $single parameter
should be passed as well to make it explicit what is the expected return type.
When calling the `get_(comment|post|site|term|user)_meta()`, `get_metadata()`,
`get_metadata_default()`, and `get_metadata_raw()` functions, if the `$[meta_]key` parameter is
passed, the `$single` parameter should be passed as well to make it explicit what is the
expected return type.
]]>
</standard>
<code_comparison>
<code title="Valid: get meta functions used with or without both $meta_key/$key and $single parameters.">
<code title="Valid: Get meta functions called either without the `$[meta_]key` parameter or with both the `$[meta_]key` and the `$single` parameters.">
<![CDATA[
$admin_color = get_user_meta(
$user_id,
<em>'admin_color',
true</em>
<em>'admin_color'</em>,
<em>true</em>
);
$post_meta = get_metadata( 'post', $post_id<em></em> );
]]>
</code>
<code title="Invalid: get meta function used with $meta_key/$key parameter and without $single parameter.">
<code title="Invalid: Get meta function called with the `$[meta_]key` parameter and without `$single` parameter.">
<![CDATA[
$admin_color = get_user_meta(
$user_id,
Expand Down

0 comments on commit 5dd8031

Please sign in to comment.