| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * bbPress Actions. | |
| 4 | + * bbPress Actions | |
| 5 | 5 | * |
| 6 | 6 | * This file contains the actions that are used through-out bbPress. They are |
| 7 | 7 | * consolidated here to make searching for them easier, and to help developers |
| 8 | 8 | * understand at a glance the order in which things occur. |
| @@ -21,9 +21,9 @@ | ||
| 21 | 21 | // Exit if accessed directly |
| 22 | 22 | defined( 'ABSPATH' ) || exit; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * Attach bbPress to WordPress. | |
| 25 | + * Attach bbPress to WordPress | |
| 26 | 26 | * |
| 27 | 27 | * bbPress uses its own internal actions to help aid in third-party plugin |
| 28 | 28 | * development, and to limit the amount of potential future code changes when |
| 29 | 29 | * updates to WordPress core occur. |
| @@ -58,9 +58,9 @@ | ||
| 58 | 58 | add_action( 'transition_post_status', 'bbp_transition_post_status', 10, 3 ); |
| 59 | 59 | add_action( 'post_updated', 'bbp_post_updated', 10, 3 ); |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * bbp_loaded - Attached to 'plugins_loaded' above. | |
| 62 | + * bbp_loaded - Attached to 'plugins_loaded' above | |
| 63 | 63 | * |
| 64 | 64 | * Attach various loader actions to the bbp_loaded action. |
| 65 | 65 | * The load order helps to execute code at the correct time. |
| 66 | 66 | * v---Load order |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | add_action( 'bbp_loaded', 'bbp_setup_user_option_filters', 12 ); |
| 74 | 74 | add_action( 'bbp_loaded', 'bbp_pre_load_options', 14 ); |
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | - * bbp_init - Attached to 'init' above. | |
| 77 | + * bbp_init - Attached to 'init' above | |
| 78 | 78 | * |
| 79 | 79 | * Attach various initialization actions to the init action. |
| 80 | 80 | * The load order helps to execute code at the correct time. |
| 81 | 81 | * v---Load order |
| @@ -88,19 +88,19 @@ | ||
| 88 | 88 | add_action( 'bbp_init', 'bbp_setup_engagements', 50 ); |
| 89 | 89 | add_action( 'bbp_init', 'bbp_ready', 999 ); |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | - * bbp_rest_api_init - Attached to 'rest_api_init' above. | |
| 92 | + * bbp_rest_api_init - Attached to 'rest_api_init' above | |
| 93 | 93 | */ |
| 94 | 94 | add_action( 'bbp_rest_api_init', 'bbp_register_rest_attachment_controller', 5 ); |
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | - * bbp_xmlrpc_call - Attached to 'xmlrpc_call' above. | |
| 97 | + * bbp_xmlrpc_call - Attached to 'xmlrpc_call' above | |
| 98 | 98 | */ |
| 99 | 99 | add_action( 'bbp_xmlrpc_call', 'bbp_validate_xmlrpc_post', 10, 2 ); |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * bbp_setup_theme - Attached to 'setup_theme' above. | |
| 102 | + * bbp_setup_theme - Attached to 'setup_theme' above | |
| 103 | 103 | * |
| 104 | 104 | * Attach various theme related actions to the setup_theme action. |
| 105 | 105 | * The load order helps to execute code at the correct time. |
| 106 | 106 | * v---Load order |
| @@ -107,9 +107,9 @@ | ||
| 107 | 107 | */ |
| 108 | 108 | add_action( 'bbp_setup_theme', 'bbp_register_theme_packages', 2 ); // Lower than 5 |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * bbp_roles_init - Attached to 'wp_roles_init' above. | |
| 111 | + * bbp_roles_init - Attached to 'wp_roles_init' above | |
| 112 | 112 | * |
| 113 | 113 | * Attach various role related actions to the wp_roles_init action. |
| 114 | 114 | * The load order helps to execute code at the correct time. |
| 115 | 115 | * v---Load order |
| @@ -124,9 +124,9 @@ | ||
| 124 | 124 | */ |
| 125 | 125 | add_action( 'bbp_setup_current_user', 'bbp_set_current_user_default_role' ); |
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | - * bbp_register - Attached to 'init' above on 0 priority. | |
| 128 | + * bbp_register - Attached to 'init' above on 0 priority | |
| 129 | 129 | * |
| 130 | 130 | * Attach various initialization actions early to the init action. |
| 131 | 131 | * The load order helps to execute code at the correct time. |
| 132 | 132 | * v---Load order |
| @@ -135,9 +135,8 @@ | ||
| 135 | 135 | add_action( 'bbp_register', 'bbp_register_post_statuses', 4 ); |
| 136 | 136 | add_action( 'bbp_register', 'bbp_register_taxonomies', 6 ); |
| 137 | 137 | add_action( 'bbp_register', 'bbp_register_views', 8 ); |
| 138 | 138 | add_action( 'bbp_register', 'bbp_register_shortcodes', 10 ); |
| 139 | -add_action( 'bbp_register', 'bbp_register_blocks', 10 ); | |
| 140 | 139 | add_action( 'bbp_register', 'bbp_register_meta', 12 ); |
| 141 | 140 | |
| 142 | 141 | // Autoembeds |
| 143 | 142 | add_action( 'bbp_init', 'bbp_reply_content_autoembed', 8 ); |
| @@ -147,9 +146,9 @@ | ||
| 147 | 146 | add_action( 'wp_body_open', 'bbp_swap_no_js_body_class' ); |
| 148 | 147 | add_action( 'bbp_footer', 'bbp_swap_no_js_body_class' ); |
| 149 | 148 | |
| 150 | 149 | /** |
| 151 | - * bbp_ready - attached to end 'bbp_init' above. | |
| 150 | + * bbp_ready - attached to end 'bbp_init' above | |
| 152 | 151 | * |
| 153 | 152 | * Attach actions to the ready action after bbPress has fully initialized. |
| 154 | 153 | * The load order helps to execute code at the correct time. |
| 155 | 154 | * v---Load order |
| @@ -170,9 +169,8 @@ | ||
| 170 | 169 | add_action( 'bbp_widgets_init', array( 'BBP_Forums_Widget', 'register_widget' ), 10 ); |
| 171 | 170 | add_action( 'bbp_widgets_init', array( 'BBP_Topics_Widget', 'register_widget' ), 10 ); |
| 172 | 171 | add_action( 'bbp_widgets_init', array( 'BBP_Replies_Widget', 'register_widget' ), 10 ); |
| 173 | 172 | add_action( 'bbp_widgets_init', array( 'BBP_Stats_Widget', 'register_widget' ), 10 ); |
| 174 | -// phpcs:enable | |
| 175 | 173 | |
| 176 | 174 | // Notices |
| 177 | 175 | add_action( 'bbp_template_notices', 'bbp_template_notices', 20 ); |
| 178 | 176 | add_action( 'bbp_template_notices', 'bbp_login_notices' ); |
| @@ -371,14 +369,8 @@ | ||
| 371 | 369 | add_action( 'bbp_user_edit_after', 'bbp_user_edit_after' ); |
| 372 | 370 | |
| 373 | 371 | // Clean bbPress post caches when WordPress's is cleaned |
| 374 | 372 | add_action( 'clean_post_cache', 'bbp_clean_post_cache', 10, 2 ); |
| 375 | - | |
| 376 | -// Invalidate forum-user counts after users or their capabilities change | |
| 377 | -add_action( 'clean_user_cache', 'bbp_clean_user_count_cache' ); | |
| 378 | -add_action( 'added_user_meta', 'bbp_clean_user_count_cache_on_meta_change', 10, 3 ); | |
| 379 | -add_action( 'updated_user_meta', 'bbp_clean_user_count_cache_on_meta_change', 10, 3 ); | |
| 380 | -add_action( 'deleted_user_meta', 'bbp_clean_user_count_cache_on_meta_change', 10, 3 ); | |
| 381 | 373 | |
| 382 | 374 | // User Registration |
| 383 | 375 | add_action( 'added_existing_user', 'bbp_user_add_role_on_register', 10, 1 ); |
| 384 | 376 | add_action( 'bbp_user_register', 'bbp_user_add_role_on_register', 10, 1 ); |