Commit cc03046
fix(docs): correct invalid function references and parameter placement (#140)
- Replace non-existent wp_execute_ability() with correct wp_get_ability() and ->execute() pattern
- Move 'category' parameter from meta array to top-level args array in examples
- Fix class name from WP_Abilities_Category_Registry to WP_Ability_Categories_Registry
The documentation incorrectly referenced wp_execute_ability() which does not exist in the codebase (verified in includes/abilities-api.php lines 278-607). The correct approach is to use wp_get_ability() to retrieve the ability object, then call its execute() method (defined in includes/abilities-api/class-wp-ability.php line 595).
Additionally, code examples showed 'category' inside the meta array, but per the function signature (includes/abilities-api.php line 237) and core implementation (includes/abilities/wp-core-abilities.php line 89), category must be a top-level parameter.
Fixes documentation accuracy to match actual codebase implementation.
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
Co-authored-by: huzaifaalmesbah <huzaifaalmesbah@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>
Co-authored-by: mindctrl <mindctrl@git.wordpress.org>1 parent 0a1cda6 commit cc03046
3 files changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | 88 | | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments