@@ -20,7 +20,7 @@ public function set_up(): void {
2020
2121 // Register category during the hook.
2222 add_action (
23- 'abilities_api_categories_init ' ,
23+ 'wp_abilities_api_categories_init ' ,
2424 function () {
2525 if ( ! WP_Abilities_Category_Registry::get_instance ()->is_registered ( 'math ' ) ) {
2626 wp_register_ability_category (
@@ -35,7 +35,7 @@ function () {
3535 );
3636
3737 // Fire the hook to allow category registration.
38- do_action ( 'abilities_api_categories_init ' );
38+ do_action ( 'wp_abilities_api_categories_init ' );
3939
4040 self ::$ test_ability_properties = array (
4141 'label ' => 'Calculator ' ,
@@ -533,12 +533,12 @@ public function test_before_execute_ability_action() {
533533 $ action_input = $ input ;
534534 };
535535
536- add_action ( 'before_execute_ability ' , $ callback , 10 , 2 );
536+ add_action ( 'wp_before_execute_ability ' , $ callback , 10 , 2 );
537537
538538 $ ability = new WP_Ability ( self ::$ test_ability_name , $ args );
539539 $ result = $ ability ->execute ( 5 );
540540
541- remove_action ( 'before_execute_ability ' , $ callback );
541+ remove_action ( 'wp_before_execute_ability ' , $ callback );
542542
543543 $ this ->assertSame ( self ::$ test_ability_name , $ action_ability_name , 'Action should receive correct ability name ' );
544544 $ this ->assertSame ( 5 , $ action_input , 'Action should receive correct input ' );
@@ -568,12 +568,12 @@ public function test_before_execute_ability_action_no_input() {
568568 $ action_input = $ input ;
569569 };
570570
571- add_action ( 'before_execute_ability ' , $ callback , 10 , 2 );
571+ add_action ( 'wp_before_execute_ability ' , $ callback , 10 , 2 );
572572
573573 $ ability = new WP_Ability ( self ::$ test_ability_name , $ args );
574574 $ result = $ ability ->execute ();
575575
576- remove_action ( 'before_execute_ability ' , $ callback );
576+ remove_action ( 'wp_before_execute_ability ' , $ callback );
577577
578578 $ this ->assertSame ( self ::$ test_ability_name , $ action_ability_name , 'Action should receive correct ability name ' );
579579 $ this ->assertNull ( $ action_input , 'Action should receive null input when no input provided ' );
@@ -610,12 +610,12 @@ public function test_after_execute_ability_action() {
610610 $ action_result = $ result ;
611611 };
612612
613- add_action ( 'after_execute_ability ' , $ callback , 10 , 3 );
613+ add_action ( 'wp_after_execute_ability ' , $ callback , 10 , 3 );
614614
615615 $ ability = new WP_Ability ( self ::$ test_ability_name , $ args );
616616 $ result = $ ability ->execute ( 7 );
617617
618- remove_action ( 'after_execute_ability ' , $ callback );
618+ remove_action ( 'wp_after_execute_ability ' , $ callback );
619619
620620 $ this ->assertSame ( self ::$ test_ability_name , $ action_ability_name , 'Action should receive correct ability name ' );
621621 $ this ->assertSame ( 7 , $ action_input , 'Action should receive correct input ' );
@@ -649,12 +649,12 @@ public function test_after_execute_ability_action_no_input() {
649649 $ action_result = $ result ;
650650 };
651651
652- add_action ( 'after_execute_ability ' , $ callback , 10 , 3 );
652+ add_action ( 'wp_after_execute_ability ' , $ callback , 10 , 3 );
653653
654654 $ ability = new WP_Ability ( self ::$ test_ability_name , $ args );
655655 $ result = $ ability ->execute ();
656656
657- remove_action ( 'after_execute_ability ' , $ callback );
657+ remove_action ( 'wp_after_execute_ability ' , $ callback );
658658
659659 $ this ->assertSame ( self ::$ test_ability_name , $ action_ability_name , 'Action should receive correct ability name ' );
660660 $ this ->assertNull ( $ action_input , 'Action should receive null input when no input provided ' );
@@ -688,14 +688,14 @@ public function test_actions_not_fired_on_permission_failure() {
688688 $ after_action_fired = true ;
689689 };
690690
691- add_action ( 'before_execute_ability ' , $ before_callback );
692- add_action ( 'after_execute_ability ' , $ after_callback );
691+ add_action ( 'wp_before_execute_ability ' , $ before_callback );
692+ add_action ( 'wp_after_execute_ability ' , $ after_callback );
693693
694694 $ ability = new WP_Ability ( self ::$ test_ability_name , $ args );
695695 $ result = $ ability ->execute ();
696696
697- remove_action ( 'before_execute_ability ' , $ before_callback );
698- remove_action ( 'after_execute_ability ' , $ after_callback );
697+ remove_action ( 'wp_before_execute_ability ' , $ before_callback );
698+ remove_action ( 'wp_after_execute_ability ' , $ after_callback );
699699
700700 $ this ->assertFalse ( $ before_action_fired , 'before_execute_ability action should not be fired on permission failure ' );
701701 $ this ->assertFalse ( $ after_action_fired , 'after_execute_ability action should not be fired on permission failure ' );
@@ -728,14 +728,14 @@ public function test_after_action_not_fired_on_execution_error() {
728728 $ after_action_fired = true ;
729729 };
730730
731- add_action ( 'before_execute_ability ' , $ before_callback );
732- add_action ( 'after_execute_ability ' , $ after_callback );
731+ add_action ( 'wp_before_execute_ability ' , $ before_callback );
732+ add_action ( 'wp_after_execute_ability ' , $ after_callback );
733733
734734 $ ability = new WP_Ability ( self ::$ test_ability_name , $ args );
735735 $ result = $ ability ->execute ();
736736
737- remove_action ( 'before_execute_ability ' , $ before_callback );
738- remove_action ( 'after_execute_ability ' , $ after_callback );
737+ remove_action ( 'wp_before_execute_ability ' , $ before_callback );
738+ remove_action ( 'wp_after_execute_ability ' , $ after_callback );
739739
740740 $ this ->assertTrue ( $ before_action_fired , 'before_execute_ability action should be fired even if execution fails ' );
741741 $ this ->assertFalse ( $ after_action_fired , 'after_execute_ability action should not be fired when execution returns WP_Error ' );
@@ -773,14 +773,14 @@ public function test_after_action_not_fired_on_output_validation_error() {
773773 $ after_action_fired = true ;
774774 };
775775
776- add_action ( 'before_execute_ability ' , $ before_callback );
777- add_action ( 'after_execute_ability ' , $ after_callback );
776+ add_action ( 'wp_before_execute_ability ' , $ before_callback );
777+ add_action ( 'wp_after_execute_ability ' , $ after_callback );
778778
779779 $ ability = new WP_Ability ( self ::$ test_ability_name , $ args );
780780 $ result = $ ability ->execute ();
781781
782- remove_action ( 'before_execute_ability ' , $ before_callback );
783- remove_action ( 'after_execute_ability ' , $ after_callback );
782+ remove_action ( 'wp_before_execute_ability ' , $ before_callback );
783+ remove_action ( 'wp_after_execute_ability ' , $ after_callback );
784784
785785 $ this ->assertTrue ( $ before_action_fired , 'before_execute_ability action should be fired even if output validation fails ' );
786786 $ this ->assertFalse ( $ after_action_fired , 'after_execute_ability action should not be fired when output validation fails ' );
0 commit comments