- Timestamp:
- 11/06/2026 08:36:45 AM (7 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/abilities-api/class-wp-ability.php
r65044 r65306 567 567 * 568 568 * Also applies schema format sanitization, such as stripping tags for 569 * `text-field` and sanitizing URLs for `uri`, using rest_sanitize_value_from_schema().570 * 571 * Call validate_input()before this method. Coercing unvalidated input can569 * `text-field` and sanitizing URLs for `uri`, using `rest_sanitize_value_from_schema()`. 570 * 571 * Call `validate_input()` before this method. Coercing unvalidated input can 572 572 * remove unknown properties or cast invalid values, hiding validation errors. 573 573 * This method does not apply defaults or run input validation filters. … … 578 578 * @since 7.2.0 579 579 * 580 * @see validate_input()580 * @see WP_Ability::validate_input() 581 581 * 582 582 * @param mixed $input Validated ability input. 583 * @return mixed|WP_Error Coerced input, or WP_Errorwhen it cannot be safely coerced.583 * @return mixed|WP_Error Coerced input, or `WP_Error` when it cannot be safely coerced. 584 584 */ 585 585 public function coerce_input( $input ) { … … 752 752 * Checks whether the ability has the necessary permissions. 753 753 * 754 * Please note that input is not automatically validated against the input schema. 755 * Use `validate_input()` method to validate input before calling this method if needed. 754 * This method does not prepare the input. Use `execute()` to run the full ability 755 * lifecycle, which prepares the input before calling this method. 756 * 757 * When calling this method directly, prepare the input in the same order as 758 * `execute()`, and stop if any step returns a `WP_Error`: 759 * 760 * 1. `normalize_input()` applies the schema default and returns the input. 761 * 2. `validate_input()` checks the input against the schema and returns `true`. 762 * 3. `coerce_input()` converts values to the schema types and returns the input 763 * to pass to this method. 764 * 765 * Skipping these steps means the permission callback may receive different input 766 * than it does during `execute()`, such as a missing schema default or a string 767 * instead of an integer. 756 768 * 757 769 * The checks run in this order: … … 769 781 * @since 7.2.0 Added the `required_capabilities` check. 770 782 * 771 * @see validate_input() 772 * 773 * @param mixed $input Optional. The valid input data for permission checking. Default `null`. 783 * @see WP_Ability::normalize_input() 784 * @see WP_Ability::validate_input() 785 * @see WP_Ability::coerce_input() 786 * @see WP_Ability::execute() 787 * 788 * @param mixed $input Optional. The normalized, validated, and coerced input data for permission checking. 789 * Default `null`. 774 790 * @return bool|WP_Error Whether the ability has the necessary permission. 775 791 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)