Make WordPress Core


Ignore:
Timestamp:
06/23/2021 07:04:51 PM (4 years ago)
Author:
desrosj
Message:

Docs: Various docblock corrections for code added in 5.8.

Props johnbillion.
See #53461.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r51198 r51221  
    356356     * Example:
    357357     *
    358      * {
    359      *   'core/paragraph': {
    360      *     'selector': 'p',
    361      *     'elements': {
    362      *       'link' => 'link selector',
    363      *       'etc'  => 'element selector'
     358     *     {
     359     *       'core/paragraph': {
     360     *         'selector': 'p',
     361     *         'elements': {
     362     *           'link' => 'link selector',
     363     *           'etc'  => 'element selector'
     364     *         }
     365     *       },
     366     *       'core/heading': {
     367     *         'selector': 'h1',
     368     *         'elements': {}
     369     *       }
     370     *       'core/group': {
     371     *         'selector': '.wp-block-group',
     372     *         'elements': {}
     373     *       }
    364374     *     }
    365      *   },
    366      *   'core/heading': {
    367      *     'selector': 'h1',
    368      *     'elements': {}
    369      *   }
    370      *   'core/group': {
    371      *     'selector': '.wp-block-group',
    372      *     'elements': {}
    373      *   }
    374      * }
    375375     *
    376376     * @since 5.8.0
     
    518518     * as classes for each preset value such as:
    519519     *
    520      *   .has-value-color {
    521      *     color: value;
    522      *   }
    523      *
    524      *   .has-value-background-color {
    525      *     background-color: value;
    526      *   }
    527      *
    528      *   .has-value-font-size {
    529      *     font-size: value;
    530      *   }
    531      *
    532      *   .has-value-gradient-background {
    533      *     background: value;
    534      *   }
    535      *
    536      *   p.has-value-gradient-background {
    537      *     background: value;
    538      *   }
     520     *     .has-value-color {
     521     *       color: value;
     522     *     }
     523     *
     524     *     .has-value-background-color {
     525     *       background-color: value;
     526     *     }
     527     *
     528     *     .has-value-font-size {
     529     *       font-size: value;
     530     *     }
     531     *
     532     *     .has-value-gradient-background {
     533     *       background: value;
     534     *     }
     535     *
     536     *     p.has-value-gradient-background {
     537     *       background: value;
     538     *     }
    539539     *
    540540     * @since 5.8.0
     
    581581     * For each section this creates a new ruleset such as:
    582582     *
    583      *   block-selector {
    584      *     --wp--preset--category--slug: value;
    585      *     --wp--custom--variable: value;
    586      *   }
     583     *     block-selector {
     584     *       --wp--preset--category--slug: value;
     585     *       --wp--custom--variable: value;
     586     *     }
    587587     *
    588588     * @since 5.8.0
     
    613613     * Given a selector and a declaration list,
    614614     * creates the corresponding ruleset.
    615      *
    616      * To help debugging, will add some space
    617      * if SCRIPT_DEBUG is defined and true.
    618615     *
    619616     * @since 5.8.0
     
    732729     * following the format:
    733730     *
    734      * ```php
    735      * array(
    736      *   'name'  => 'property_name',
    737      *   'value' => 'property_value,
    738      * )
    739      * ```
     731     *     array(
     732     *       'name'  => 'property_name',
     733     *       'value' => 'property_value,
     734     *     )
    740735     *
    741736     * @since 5.8.0
     
    766761     * array following the format:
    767762     *
    768      * ```php
    769      * array(
    770      *   'name'  => 'property_name',
    771      *   'value' => 'property_value,
    772      * )
    773      * ```
     763     *     array(
     764     *       'name'  => 'property_name',
     765     *       'value' => 'property_value,
     766     *     )
    774767     *
    775768     * @since 5.8.0
     
    809802     * and the token is '--', for this input tree:
    810803     *
    811      * {
    812      *   'some/property': 'value',
    813      *   'nestedProperty': {
    814      *     'sub-property': 'value'
    815      *   }
    816      * }
     804     *     {
     805     *       'some/property': 'value',
     806     *       'nestedProperty': {
     807     *         'sub-property': 'value'
     808     *       }
     809     *     }
    817810     *
    818811     * it'll return this output:
    819812     *
    820      * {
    821      *   '--wp--some-property': 'value',
    822      *   '--wp--nested-property--sub-property': 'value'
    823      * }
     813     *     {
     814     *       '--wp--some-property': 'value',
     815     *       '--wp--nested-property--sub-property': 'value'
     816     *     }
    824817     *
    825818     * @since 5.8.0
     
    857850     * and adds them to the $declarations array following the format:
    858851     *
    859      * ```php
    860      * array(
    861      *   'name'  => 'property_name',
    862      *   'value' => 'property_value,
    863      * )
    864      * ```
     852     *     array(
     853     *       'name'  => 'property_name',
     854     *       'value' => 'property_value,
     855     *     )
    865856     *
    866857     * @since 5.8.0
     
    968959     * Builds metadata for the setting nodes, which returns in the form of:
    969960     *
    970      * [
    971      *   [
    972      *     'path'     => ['path', 'to', 'some', 'node' ],
    973      *     'selector' => 'CSS selector for some node'
    974      *   ],
    975      *   [
    976      *     'path'     => [ 'path', 'to', 'other', 'node' ],
    977      *     'selector' => 'CSS selector for other node'
    978      *   ],
    979      * ]
     961     *     [
     962     *       [
     963     *         'path'     => ['path', 'to', 'some', 'node' ],
     964     *         'selector' => 'CSS selector for some node'
     965     *       ],
     966     *       [
     967     *         'path'     => [ 'path', 'to', 'other', 'node' ],
     968     *         'selector' => 'CSS selector for other node'
     969     *       ],
     970     *     ]
    980971     *
    981972     * @since 5.8.0
     
    10221013     * Builds metadata for the style nodes, which returns in the form of:
    10231014     *
    1024      * [
    1025      *   [
    1026      *     'path'     => [ 'path', 'to', 'some', 'node' ],
    1027      *     'selector' => 'CSS selector for some node'
    1028      *   ],
    1029      *   [
    1030      *     'path'     => ['path', 'to', 'other', 'node' ],
    1031      *     'selector' => 'CSS selector for other node'
    1032      *   ],
    1033      * ]
     1015     *     [
     1016     *       [
     1017     *         'path'     => [ 'path', 'to', 'some', 'node' ],
     1018     *         'selector' => 'CSS selector for some node'
     1019     *       ],
     1020     *       [
     1021     *         'path'     => ['path', 'to', 'other', 'node' ],
     1022     *         'selector' => 'CSS selector for other node'
     1023     *       ],
     1024     *     ]
    10341025     *
    10351026     * @since 5.8.0
Note: See TracChangeset for help on using the changeset viewer.