Make WordPress Core

Changeset 30544


Ignore:
Timestamp:
11/24/2014 06:04:10 AM (10 years ago)
Author:
DrewAPicture
Message:

Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.

Affects DocBlocks for the following core elements:

  • Markdown-indent a code snippet in the description for wp_salt()
  • Backtick-escape inline code in the return description for get_avatar()
  • Various markdown formatting in the description for add_filter()
  • Markdown-indent a code snippet in the description for apply_filters()
  • Backtick-escape inline code in the @see description for apply_filters_ref_array()
  • Backtick-escape inline code in the description for do_action()
  • Backtick-escape variables in the parameter and return descriptions for do_action_ref_array()
  • Various markdown formatting in the description for get_plugin_data()

Props rarst.
See #30473.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r30199 r30544  
    1515 * and the same goes for the plugin data. The below is formatted for printing.
    1616 *
    17  * <code>
    18  * /*
    19  * Plugin Name: Name of Plugin
    20  * Plugin URI: Link to plugin information
    21  * Description: Plugin Description
    22  * Author: Plugin author's name
    23  * Author URI: Link to the author's web site
    24  * Version: Must be set in the plugin for WordPress 2.3+
    25  * Text Domain: Optional. Unique identifier, should be same as the one used in
    26  *      plugin_text_domain()
    27  * Domain Path: Optional. Only useful if the translations are located in a
    28  *      folder above the plugin's base path. For example, if .mo files are
    29  *      located in the locale folder then Domain Path will be "/locale/" and
    30  *      must have the first slash. Defaults to the base folder the plugin is
    31  *      located in.
    32  * Network: Optional. Specify "Network: true" to require that a plugin is activated
    33  *      across all sites in an installation. This will prevent a plugin from being
    34  *      activated on a single site when Multisite is enabled.
    35  *  * / # Remove the space to close comment
    36  * </code>
     17 *     /*
     18 *     Plugin Name: Name of Plugin
     19 *     Plugin URI: Link to plugin information
     20 *     Description: Plugin Description
     21 *     Author: Plugin author's name
     22 *     Author URI: Link to the author's web site
     23 *     Version: Must be set in the plugin for WordPress 2.3+
     24 *     Text Domain: Optional. Unique identifier, should be same as the one used in
     25 *          plugin_text_domain()
     26 *     Domain Path: Optional. Only useful if the translations are located in a
     27 *          folder above the plugin's base path. For example, if .mo files are
     28 *          located in the locale folder then Domain Path will be "/locale/" and
     29 *          must have the first slash. Defaults to the base folder the plugin is
     30 *          located in.
     31 *     Network: Optional. Specify "Network: true" to require that a plugin is activated
     32 *          across all sites in an installation. This will prevent a plugin from being
     33 *          activated on a single site when Multisite is enabled.
     34 *      * / # Remove the space to close comment
    3735 *
    3836 * Plugin data returned array contains the following:
    39  *      'Name' - Name of the plugin, must be unique.
    40  *      'Title' - Title of the plugin and the link to the plugin's web site.
    41  *      'Description' - Description of what the plugin does and/or notes
    42  *      from the author.
    43  *      'Author' - The author's name
    44  *      'AuthorURI' - The authors web site address.
    45  *      'Version' - The plugin version number.
    46  *      'PluginURI' - Plugin web site address.
    47  *      'TextDomain' - Plugin's text domain for localization.
    48  *      'DomainPath' - Plugin's relative directory path to .mo files.
    49  *      'Network' - Boolean. Whether the plugin can only be activated network wide.
     37 *
     38 * - 'Name' - Name of the plugin, must be unique.
     39 * - 'Title' - Title of the plugin and the link to the plugin's web site.
     40 * - 'Description' - Description of what the plugin does and/or notes
     41 * - from the author.
     42 * - 'Author' - The author's name
     43 * - 'AuthorURI' - The authors web site address.
     44 * - 'Version' - The plugin version number.
     45 * - 'PluginURI' - Plugin web site address.
     46 * - 'TextDomain' - Plugin's text domain for localization.
     47 * - 'DomainPath' - Plugin's relative directory path to .mo files.
     48 * - 'Network' - Boolean. Whether the plugin can only be activated network wide.
    5049 *
    5150 * Some users have issues with opening large files and manipulating the contents
     
    6362 * @link https://core.trac.wordpress.org/ticket/5651 Previous Optimizations.
    6463 * @link https://core.trac.wordpress.org/ticket/7372 Further and better Optimizations.
     64 *
    6565 * @since 1.5.0
    6666 *
  • trunk/src/wp-includes/pluggable.php

    r30412 r30544  
    17731773 * for you.
    17741774 *
    1775  * <code>
    1776  * define('AUTH_KEY',         ' Xakm<o xQy rw4EMsLKM-?!T+,PFF})H4lzcW57AF0U@N@< >M%G4Yt>f`z]MON');
    1777  * define('SECURE_AUTH_KEY',  'LzJ}op]mr|6+![P}Ak:uNdJCJZd>(Hx.-Mh#Tz)pCIU#uGEnfFz|f ;;eU%/U^O~');
    1778  * define('LOGGED_IN_KEY',    '|i|Ux`9<p-h$aFf(qnT:sDO:D1P^wZ$$/Ra@miTJi9G;ddp_<q}6H1)o|a +&JCM');
    1779  * define('NONCE_KEY',        '%:R{[P|,s.KuMltH5}cI;/k<Gx~j!f0I)m_sIyu+&NJZ)-iO>z7X>QYR0Z_XnZ@|');
    1780  * define('AUTH_SALT',        'eZyT)-Naw]F8CwA*VaW#q*|.)g@o}||wf~@C-YSt}(dh_r6EbI#A,y|nU2{B#JBW');
    1781  * define('SECURE_AUTH_SALT', '!=oLUTXh,QW=H `}`L|9/^4-3 STz},T(w}W<I`.JjPi)<Bmf1v,HpGe}T1:Xt7n');
    1782  * define('LOGGED_IN_SALT',   '+XSqHc;@Q*K_b|Z?NC[3H!!EONbh.n<+=uKR:>*c(u`g~EJBf#8u#R{mUEZrozmm');
    1783  * define('NONCE_SALT',       'h`GXHhD>SLWVfg1(1(N{;.V!MoE(SfbA_ksP@&`+AycHcAV$+?@3q+rxV{%^VyKT');
    1784  * </code>
     1775 *     define('AUTH_KEY',         ' Xakm<o xQy rw4EMsLKM-?!T+,PFF})H4lzcW57AF0U@N@< >M%G4Yt>f`z]MON');
     1776 *     define('SECURE_AUTH_KEY',  'LzJ}op]mr|6+![P}Ak:uNdJCJZd>(Hx.-Mh#Tz)pCIU#uGEnfFz|f ;;eU%/U^O~');
     1777 *     define('LOGGED_IN_KEY',    '|i|Ux`9<p-h$aFf(qnT:sDO:D1P^wZ$$/Ra@miTJi9G;ddp_<q}6H1)o|a +&JCM');
     1778 *     define('NONCE_KEY',        '%:R{[P|,s.KuMltH5}cI;/k<Gx~j!f0I)m_sIyu+&NJZ)-iO>z7X>QYR0Z_XnZ@|');
     1779 *     define('AUTH_SALT',        'eZyT)-Naw]F8CwA*VaW#q*|.)g@o}||wf~@C-YSt}(dh_r6EbI#A,y|nU2{B#JBW');
     1780 *     define('SECURE_AUTH_SALT', '!=oLUTXh,QW=H `}`L|9/^4-3 STz},T(w}W<I`.JjPi)<Bmf1v,HpGe}T1:Xt7n');
     1781 *     define('LOGGED_IN_SALT',   '+XSqHc;@Q*K_b|Z?NC[3H!!EONbh.n<+=uKR:>*c(u`g~EJBf#8u#R{mUEZrozmm');
     1782 *     define('NONCE_SALT',       'h`GXHhD>SLWVfg1(1(N{;.V!MoE(SfbA_ksP@&`+AycHcAV$+?@3q+rxV{%^VyKT');
    17851783 *
    17861784 * Salting passwords helps against tools which has stored hashed values of
     
    20912089 * @param string $default URL to a default image to use if no avatar is available
    20922090 * @param string $alt Alternative text to use in image tag. Defaults to blank
    2093  * @return string <img> tag for the user's avatar
     2091 * @return string `<img>` tag for the user's avatar.
    20942092*/
    20952093function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
  • trunk/src/wp-includes/plugin.php

    r30105 r30544  
    4646 *
    4747 * The following example shows how a callback function is bound to a filter hook.
    48  * Note that $example is passed to the callback, (maybe) modified, then returned:
    49  *
    50  * <code>
    51  * function example_callback( $example ) {
    52  *  // Maybe modify $example in some way
    53  *  return $example;
    54  * }
    55  * add_filter( 'example_filter', 'example_callback' );
    56  * </code>
     48 *
     49 * Note that `$example` is passed to the callback, (maybe) modified, then returned:
     50 *
     51 *     function example_callback( $example ) {
     52 *         // Maybe modify $example in some way.
     53 *         return $example;
     54 *     }
     55 *     add_filter( 'example_filter', 'example_callback' );
    5756 *
    5857 * Since WordPress 1.5.1, bound callbacks can take as many arguments as are
    59  * passed as parameters in the corresponding apply_filters() call. The $accepted_args
     58 * passed as parameters in the corresponding apply_filters() call. The `$accepted_args`
    6059 * parameter allows for calling functions only when the number of args match.
    6160 *
    62  * <strong>Note:</strong> the function will return true whether or not the callback
    63  * is valid. It is up to you to take care. This is done for optimization purposes,
     61 * *Note:* the function will return true whether or not the callback is valid.
     62 * It is up to you to take care. This is done for optimization purposes,
    6463 * so everything is as quick as possible.
    6564 *
     
    149148 *
    150149 * The function allows for additional arguments to be added and passed to hooks.
    151  * <code>
    152  * // Our filter callback function
    153  * function example_callback( $string, $arg1, $arg2 ) {
    154  *  // (maybe) modify $string
    155  *  return $string;
    156  * }
    157  * add_filter( 'example_filter', 'example_callback', 10, 3 );
    158  *
    159  * // Apply the filters by calling the 'example_callback' function we
    160  * // "hooked" to 'example_filter' using the add_filter() function above.
    161  * // - 'example_filter' is the filter hook $tag
    162  * // - 'filter me' is the value being filtered
    163  * // - $arg1 and $arg2 are the additional arguments passed to the callback.
    164  * $value = apply_filters( 'example_filter', 'filter me', $arg1, $arg2 );
    165  * </code>
     150 *
     151 *     // Our filter callback function
     152 *     function example_callback( $string, $arg1, $arg2 ) {
     153 *         // (maybe) modify $string
     154 *         return $string;
     155 *     }
     156 *     add_filter( 'example_filter', 'example_callback', 10, 3 );
     157 *
     158 *     /*
     159 *      * Apply the filters by calling the 'example_callback' function we
     160 *      * "hooked" to 'example_filter' using the add_filter() function above.
     161 *      * - 'example_filter' is the filter hook $tag
     162 *      * - 'filter me' is the value being filtered
     163 *      * - $arg1 and $arg2 are the additional arguments passed to the callback.
     164 *     $value = apply_filters( 'example_filter', 'filter me', $arg1, $arg2 );
    166165 *
    167166 * @since 0.71
     
    172171 *
    173172 * @param string $tag   The name of the filter hook.
    174  * @param mixed  $value The value on which the filters hooked to <tt>$tag</tt> are applied on.
    175  * @param mixed  $var   Additional variables passed to the functions hooked to <tt>$tag</tt>.
     173 * @param mixed  $value The value on which the filters hooked to `$tag` are applied on.
     174 * @param mixed  $var   Additional variables passed to the functions hooked to `$tag`.
    176175 * @return mixed The filtered value after all hooked functions are applied to it.
    177176 */
     
    225224 * Execute functions hooked on a specific filter hook, specifying arguments in an array.
    226225 *
     226 * @see 3.0.0
     227 *
    227228 * @see apply_filters() This function is identical, but the arguments passed to the
    228  * functions hooked to <tt>$tag</tt> are supplied using an array.
    229  *
    230  * @since 3.0.0
     229 * functions hooked to `$tag` are supplied using an array.
    231230 *
    232231 * @global array $wp_filter         Stores all of the filters
     
    435434 * Execute functions hooked on a specific action hook.
    436435 *
    437  * This function invokes all functions attached to action hook $tag. It is
     436 * This function invokes all functions attached to action hook `$tag`. It is
    438437 * possible to create new action hooks by simply calling this function,
    439  * specifying the name of the new hook using the <tt>$tag</tt> parameter.
     438 * specifying the name of the new hook using the `$tag` parameter.
    440439 *
    441440 * You can pass extra arguments to the hooks, much like you can with
    442  * apply_filters().
     441 * {@see apply_filters()}.
    443442 *
    444443 * @since 1.2.0
    445444 *
    446  * @see apply_filters() This function works similar with the exception that nothing
    447  *                      is returned and only the functions or methods are called.
    448445 * @global array $wp_filter  Stores all of the filters
    449446 * @global array $wp_actions Increments the amount of times action was triggered.
     
    534531 *
    535532 * @param string $tag  The name of the action to be executed.
    536  * @param array  $args The arguments supplied to the functions hooked to <tt>$tag</tt>
    537  * @return null Will return null if $tag does not exist in $wp_filter array
     533 * @param array  $args The arguments supplied to the functions hooked to `$tag`.
     534 * @return null Will return null if `$tag` does not exist in `$wp_filter` array.
    538535 */
    539536function do_action_ref_array($tag, $args) {
Note: See TracChangeset for help on using the changeset viewer.