Opened 3 years ago
Closed 3 years ago
#8490 closed enhancement (fixed)
Helper to get a REST API object URL from a component.
Reported by: | espellcaste | Owned by: | espellcaste |
---|---|---|---|
Milestone: | 9.0.0 | Priority: | normal |
Severity: | normal | Version: | 8.0.0 |
Component: | REST API | Keywords: | has-patch commit |
Cc: |
Description
This is a little helper to grab a REST API url from a specific object. Currently we have bp_rest_get_user_url
but for other components, we need to build the url every single time.
We are doing lots of code duplication in the REST API plugin that could be improved using a more improved helper function.
Attachments (2)
Change History (11)
#2
@
3 years ago
@imath Do I create a new file for the 9.0 version?
require( $this->plugin_dir . 'bp-core/deprecated/9.0.php' );
I don't the see the 8.0 version being loaded anywhere so I'm confused if this was added in the previous version.
#3
@
3 years ago
@espellcaste Good catch! You're absolutely right. I've just committed the fix r12975
Thanks @espellcaste
Could you improve the patch a bit to "fully" deprecate
bp_rest_get_user_url()
and make it usebp_rest_get_object_url()
. See /src/deprecated/8.0.php` for examples.eg: