WordPress.org

Make WordPress Core

Changeset 45917


Ignore:
Timestamp:
08/30/2019 04:56:39 PM (4 months ago)
Author:
SergeyBiryukov
Message:

Docs: Simplify get_plugin_data() and get_file_data() description.

See #47110.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r45916 r45917  
    1010 * Parses the plugin contents to retrieve plugin's metadata.
    1111 *
    12  * The metadata of the plugin's data searches for the following in the plugin's
    13  * header. All plugin data must be on its own line. For plugin description, it
    14  * must not have any newlines or only parts of the description will be displayed
    15  * and the same goes for the plugin data. The below is formatted for printing.
     12 * All plugin headers must be on their own line. Plugin description must not have
     13 * any newlines, otherwise only parts of the description will be displayed.
     14 * The below is formatted for printing.
    1615 *
    1716 *     /*
     
    3433 *     Requires at least: Optional. Specify the minimum required WordPress version.
    3534 *     Requires PHP: Optional. Specify the minimum required PHP version.
    36  *      * / # Remove the space to close comment
    37  *
    38  * Some users have issues with opening large files and manipulating the contents
    39  * for want is usually the first 1kiB or 2kiB. This function stops pulling in
    40  * the plugin contents when it has all of the required plugin data.
    41  *
    42  * The first 8kiB of the file will be pulled in and if the plugin data is not
    43  * within that first 8kiB, then the plugin author should correct their plugin
     35 *     * / # Remove the space to close comment.
     36 *
     37 * The first 8 KB of the file will be pulled in and if the plugin data is not
     38 * within that first 8 KB, then the plugin author should correct their plugin
    4439 * and move the plugin data headers to the top.
    4540 *
     
    4944 *
    5045 * @since 1.5.0
    51  * @since 5.3.0 Added support for `Requires at least` and `Requires PHP`.
     46 * @since 5.3.0 Added support for `Requires at least` and `Requires PHP` headers.
    5247 *
    5348 * @param string $plugin_file Absolute path to the main plugin file.
  • trunk/src/wp-includes/functions.php

    r45914 r45917  
    56855685 * Retrieve metadata from a file.
    56865686 *
    5687  * Searches for metadata in the first 8kiB of a file, such as a plugin or theme.
     5687 * Searches for metadata in the first 8 KB of a file, such as a plugin or theme.
    56885688 * Each piece of metadata must be on its own line. Fields can not span multiple
    56895689 * lines, the value will get cut at the end of the first line.
    56905690 *
    5691  * If the file data is not within that first 8kiB, then the author should correct
     5691 * If the file data is not within that first 8 KB, then the author should correct
    56925692 * their plugin file and move the data headers to the top.
    56935693 *
     
    56975697 *
    56985698 * @param string $file            Absolute path to the file.
    5699  * @param array  $default_headers List of headers, in the format `array('HeaderKey' => 'Header Name')`.
     5699 * @param array  $default_headers List of headers, in the format `array( 'HeaderKey' => 'Header Name' )`.
    57005700 * @param string $context         Optional. If specified adds filter hook {@see 'extra_$context_headers'}.
    57015701 *                                Default empty.
     
    57065706    $fp = fopen( $file, 'r' );
    57075707
    5708     // Pull only the first 8kiB of the file in.
     5708    // Pull only the first 8 KB of the file in.
    57095709    $file_data = fread( $fp, 8 * KB_IN_BYTES );
    57105710
Note: See TracChangeset for help on using the changeset viewer.