Skip to content

Commit

Permalink
Adjust feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
burhandodhy committed Mar 7, 2024
1 parent 628fa50 commit a03a4ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions includes/api/class-bc-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ private function cached_get( $url, $args, $cache_response = false ) {
}
$successful_response_codes = array( 200, 201, 202, 204 );

/**
* Filter whether to cache the api response.
*
* @since 2.8.5
* @hook brightcove_cache_api_response
* @param {bool} $cache_response Whether to cache the response.
* @param {string} $url The URL of the request.
* @param {array} $args The arguments of the request.
*/
$cache_response = apply_filters( 'brightcove_cache_api_response', $cache_response, $url, $args );

if ( in_array( wp_remote_retrieve_response_code( $request ), $successful_response_codes, true ) || $cache_response ) {
BC_Utility::set_cache_item( $transient_key, '', $request, $cache_time_in_seconds );
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-bc-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public static function bc_admin_notices() {

$notices[] = array(
'message' => sprintf(
'It looks like one or more of your accounts API authentication has changed recently. Please update your settings <a href="%s"><strong>here</strong></a>. Or click <a href="%s"><strong>here</strong></a> to try again.',
esc_html__( 'It looks like one or more of your accounts API authentication has changed recently. Please update your settings <a href="%s"><strong>here</strong></a>. Or click <a href="%s"><strong>here</strong></a> to try again.', 'brightcove' ),
esc_url( admin_url( 'admin.php?page=brightcove-sources' ) ),
esc_url( $force_refresh_url )
),
Expand Down

0 comments on commit a03a4ff

Please sign in to comment.