bsf_get_api_site( bool $prefer_unsecure = false, bool $is_rest_api = false )
BSF get API site.
Description
Parameters
- $prefer_unsecure
-
(bool) (Optional) Prefer unsecure.
Default value: false
- $is_rest_api
-
(bool) (Optional) use rest api base URL.
Default value: false
Return
($bsf_api_site.)
Source
File: admin/bsf-core/includes/helpers.php
function bsf_get_api_site( $prefer_unsecure = false, $is_rest_api = false ) { $rest_api_endoint = ( true === $is_rest_api ) ? 'wp-json/bsf-products/v1/' : ''; if ( defined( 'BSF_API_URL' ) ) { $bsf_api_site = BSF_API_URL . $rest_api_endoint; } else { $bsf_api_site = 'http://support.brainstormforce.com/' . $rest_api_endoint; if ( false === $prefer_unsecure && wp_http_supports( array( 'ssl' ) ) ) { $bsf_api_site = set_url_scheme( $bsf_api_site, 'https' ); } } return $bsf_api_site; }
Expand full source code Collapse full source code View on Trac