[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/ -> bp-core-rest-api.php (summary)

Core REST API functions.

File Size: 391 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 16 functions

  bp_rest_is_plugin_active()
  bp_rest_in_buddypress()
  bp_rest_api_is_available()
  bp_rest_api_register_request_script()
  bp_rest_namespace()
  bp_rest_version()
  bp_rest_get_object_url()
  bp_rest_response_add_total_headers()
  bp_rest_prepare_date_response()
  bp_rest_sanitize_member_types()
  bp_rest_validate_member_types()
  bp_rest_sanitize_group_types()
  bp_rest_validate_group_types()
  bp_rest_sanitize_string_list()
  bp_rest_get_user()
  bp_rest_register_field()

Functions
Functions that are not part of a class:

bp_rest_is_plugin_active()   X-Ref
Is the BP REST plugin is active?

return: boolean True if the BP REST plugin is active. False otherwise.
since: 5.0.0

bp_rest_in_buddypress()   X-Ref
Should we use the REST Endpoints of built BuddyPress?

If the BP REST plugin is active, it overrides BuddyPress REST enpoints.
This allows us to carry on maintaining all the BP REST API endpoints from
the BP REST plugin on GitHub.

return: bool Whether to use the REST Endpoints of built BuddyPress.
since: 5.0.0

bp_rest_api_is_available()   X-Ref
Check the availability of the BP REST API.

return: boolean True if the BP REST API is available. False otherwise.
since: 5.0.0

bp_rest_api_register_request_script()   X-Ref
Register the jQuery.ajax wrapper for BP REST API requests.

since: 5.0.0

bp_rest_namespace()   X-Ref
BuddyPress REST API namespace.

return: string
since: 5.0.0

bp_rest_version()   X-Ref
BuddyPress REST API version.

return: string
since: 5.0.0

bp_rest_get_object_url( $object_id, $object_path )   X-Ref
Get a REST API object URL from a component.

param: integer $object_id   Object ID.
param: string  $object_path Path of the component endpoint.
return: string
since: 9.0.0

bp_rest_response_add_total_headers( WP_REST_Response $response, $total = 0, $per_page = 0 )   X-Ref
Set headers to let the Client Script be aware of the pagination.

param: WP_REST_Response $response The response data.
param: integer          $total    The total number of found items.
param: integer          $per_page The number of items per page of results.
return: WP_REST_Response $response The response data.
since: 5.0.0

bp_rest_prepare_date_response( $date_gmt, $date = null )   X-Ref
Convert the input date to RFC3339 format.

param: string      $date_gmt Date GMT format.
param: string|null $date     Optional. Date object.
return: string|null ISO8601/RFC3339 formatted datetime.
since: 5.0.0

bp_rest_sanitize_member_types( $value )   X-Ref
Clean up member_type input.

param: string $value Comma-separated list of group types.
return: array|null
since: 5.0.0

bp_rest_validate_member_types( $value )   X-Ref
Validate member_type input.

param: mixed $value Mixed value.
return: WP_Error|boolean
since: 5.0.0

bp_rest_sanitize_group_types( $value )   X-Ref
Clean up group_type input.

param: string $value Comma-separated list of group types.
return: array|null
since: 5.0.0

bp_rest_validate_group_types( $value )   X-Ref
Validate group_type input.

param: mixed $value Mixed value.
return: WP_Error|bool
since: 5.0.0

bp_rest_sanitize_string_list( $list )   X-Ref
Clean up an array, comma- or space-separated list of strings.

param: array|string $list List of strings.
return: array Sanitized array of strings.
since: 5.0.0

bp_rest_get_user( $user_id )   X-Ref
Get the user object, if the ID is valid.

param: int $user_id Supplied user ID.
return: WP_User|boolean
since: 5.0.0

bp_rest_register_field( $component_id, $attribute, $args = array()   X-Ref
Registers a new field on an existing BuddyPress object.

param: string $component_id The name of the *active* component (eg: `activity`, `groups`, `xprofile`).
param: string $attribute    The attribute name. Required.
param: array  $args {
param: string $object_type  The xProfile object type to get. This parameter is only required for
return: bool                True if the field has been registered successfully. False otherwise.
since: 5.0.0



Generated: Thu Dec 26 01:01:04 2024 Cross-referenced by PHPXref 0.7.1