Make WordPress Core

Changeset 42809


Ignore:
Timestamp:
03/08/2018 11:18:35 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for meta capability filters.

Remove self-references, correct parameter names and descriptions.

Props milana_cap, ocean90, SergeyBiryukov.
Fixes #43504.

File:
1 edited

Legend:

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

    r42606 r42809  
    315315
    316316                                /**
    317                                  * Filters whether the user is allowed to edit meta.
     317                                 * Filters whether the user is allowed to edit meta for specific object types.
    318318                                 *
    319                                  * Use the {@see auth_post_$object_type_meta_$meta_key} filter to modify capabilities for
    320                                  * specific object types. Return true to have the mapped meta caps from edit_{$object_type} apply.
     319                                 * Return true to have the mapped meta caps from `edit_{$object_type}` apply.
    321320                                 *
    322321                                 * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.
    323322                                 * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap().
    324323                                 *
    325                                  * @since 3.3.0 As 'auth_post_meta_{$meta_key}'.
     324                                 * @since 3.3.0 As `auth_post_meta_{$meta_key}`.
    326325                                 * @since 4.6.0
    327326                                 *
    328                                  * @param bool   $allowed  Whether the user can add the post meta. Default false.
    329                                  * @param string $meta_key The meta key.
    330                                  * @param int    $post_id  Post ID.
    331                                  * @param int    $user_id  User ID.
    332                                  * @param string $cap      Capability name.
    333                                  * @param array  $caps     User capabilities.
     327                                 * @param bool   $allowed   Whether the user can add the object meta. Default false.
     328                                 * @param string $meta_key  The meta key.
     329                                 * @param int    $object_id Object ID.
     330                                 * @param int    $user_id   User ID.
     331                                 * @param string $cap       Capability name.
     332                                 * @param array  $caps      User capabilities.
    334333                                 */
    335334                                $allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", false, $meta_key, $object_id, $user_id, $cap, $caps );
    336335
    337336                                /**
    338                                  * Filters whether the user is allowed to add post meta to a post of a given type.
     337                                 * Filters whether the user is allowed to edit meta for specific object types/subtypes.
    339338                                 *
    340                                  * Use the {@see auth_$object_type_$sub_type_meta_$meta_key} filter to modify capabilities for
    341                                  * specific object types/subtypes. Return true to have the mapped meta caps from edit_{$object_type} apply.
     339                                 * Return true to have the mapped meta caps from `edit_{$object_type}` apply.
    342340                                 *
    343341                                 * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.
    … …  
    345343                                 * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap().
    346344                                 *
    347                                  * @since 4.6.0 As 'auth_post_{$post_type}_meta_{$meta_key}'.
     345                                 * @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`.
    348346                                 * @since 4.7.0
    349347                                 *
    350                                  * @param bool   $allowed  Whether the user can add the post meta. Default false.
    351                                  * @param string $meta_key The meta key.
    352                                  * @param int    $post_id  Post ID.
    353                                  * @param int    $user_id  User ID.
    354                                  * @param string $cap      Capability name.
    355                                  * @param array  $caps     User capabilities.
     348                                 * @param bool   $allowed   Whether the user can add the object meta. Default false.
     349                                 * @param string $meta_key  The meta key.
     350                                 * @param int    $object_id Object ID.
     351                                 * @param int    $user_id   User ID.
     352                                 * @param string $cap       Capability name.
     353                                 * @param array  $caps      User capabilities.
    356354                                 */
    357355                                $allowed = apply_filters( "auth_{$object_type}_{$sub_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
Note: See TracChangeset for help on using the changeset viewer.