File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/wp-includes/abilities-api Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,7 @@ protected function prepare_properties( array $args ): array {
325325 $ args ['meta ' ] ?? array (),
326326 array (
327327 'annotations ' => static ::$ default_annotations ,
328+ 'deprecated ' => false ,
328329 'show_in_rest ' => self ::DEFAULT_SHOW_IN_REST ,
329330 )
330331 );
@@ -553,6 +554,13 @@ protected function do_execute( $input = null ) {
553554 );
554555 }
555556
557+ // Trigger deprecation notice if the ability is deprecated.
558+ if ( $ this ->get_meta_item ( 'deprecated ' , false ) === true ) {
559+ $ version = $ this ->get_meta_item ( 'deprecated_version ' , '' );
560+ $ replacement = $ this ->get_meta_item ( 'deprecated_replacement ' , '' );
561+ _deprecated_ability ( $ this ->name , $ version , $ replacement );
562+ }
563+
556564 return $ this ->invoke_callback ( $ this ->execute_callback , $ input );
557565 }
558566
You can’t perform that action at this time.
0 commit comments