Changeset 12985 for trunk/src/bp-core/bp-core-rest-api.php
- Timestamp:
- 07/02/2021 01:47:57 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-rest-api.php
r12745 r12985 136 136 137 137 /** 138 * Get user URL. 139 * 140 * @since 5.0.0 141 * 142 * @param int $user_id User ID. 138 * Get a REST API object URL from a component. 139 * 140 * @since 9.0.0 141 * 142 * @param integer $object_id Object ID. 143 * @param string $object_path Path of the component endpoint. 143 144 * @return string 144 145 */ 145 function bp_rest_get_user_url( $user_id ) { 146 return sprintf( 147 '/%s/%s/members/%d', 148 bp_rest_namespace(), 149 bp_rest_version(), 150 $user_id 146 function bp_rest_get_object_url( $object_id, $object_path ) { 147 return rest_url( 148 sprintf( 149 '/%1$s/%2$s/%3$s/%4$d', 150 bp_rest_namespace(), 151 bp_rest_version(), 152 $object_path, 153 $object_id 154 ) 151 155 ); 152 156 }
Note: See TracChangeset
for help on using the changeset viewer.