Changeset 14026 for trunk/src/bp-core/classes/class-bp-component.php
- Timestamp:
- 09/27/2024 09:11:27 PM (15 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/classes/class-bp-component.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-component.php
r13943 r14026 247 247 * 248 248 * @param string $id Unique ID. Letters, numbers, and underscores only. 249 * @param string $name Unique name. This should be a translatable name, eg. 250 * __( 'Groups', 'buddypress' ). 249 * @param string $name Unique name. This should be a translatable name, e.g. __( 'Groups', 'buddypress' ). 251 250 * @param string $path The file path for the component's files. Used by {@link BP_Component::includes()}. 252 251 * @param array $params { … … 314 313 * if one is found, otherwise an empty string. 315 314 * @type bool $has_directory Set to true if the component requires an associated WordPress page. 316 * @type array $rewrite_ids The list of rewrit edIDs to use for the component.315 * @type array $rewrite_ids The list of rewritten IDs to use for the component. 317 316 * @type string $directory_title The title to use for the directory page. 318 317 * @type callable $notification_callback The callable function that formats the component's notifications. … … 530 529 531 530 foreach ( $paths as $path ) { 531 532 532 if ( @is_file( $slashed_path . $path ) ) { 533 533 require $slashed_path . $path; … … 623 623 // Register BP REST Endpoints. 624 624 if ( bp_rest_in_buddypress() && bp_rest_api_is_available() ) { 625 add_action( 'bp_rest_api_init', array( $this, 'rest_api_init' ) , 10);625 add_action( 'bp_rest_api_init', array( $this, 'rest_api_init' ) ); 626 626 } 627 627 … … 1416 1416 * @since 5.0.0 1417 1417 * 1418 * @param array$controllers The list of BP REST API controllers to load.1418 * @param string[] $controllers The list of BP REST API controllers to load. 1419 1419 */ 1420 1420 $controllers = (array) apply_filters( 'bp_' . $this->id . '_rest_api_controllers', $controllers ); … … 1425 1425 } 1426 1426 1427 if ( ! class_exists( $controller ) ) { 1428 _doing_it_wrong( 1429 __METHOD__, 1430 sprintf( 1431 // translators: %s: REST API controller class name. 1432 esc_html__( 'The REST API controller class %s does not exist.', 'buddypress' ), 1433 esc_attr( $controller ) 1434 ), 1435 '15.0.0' 1436 ); 1437 } 1438 1427 1439 $component_controller = new $controller(); 1428 1440 $component_controller->register_routes();
Note: See TracChangeset
for help on using the changeset viewer.