Skip to content

Commit

Permalink
simplify rcp_elements_is_update_card_page function to bail early i…
Browse files Browse the repository at this point in the history
…f result found
  • Loading branch information
mcfarlan committed Oct 6, 2017
1 parent 5faa8d8 commit 43926df
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions rcp-stripe-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,18 @@ function rcp_elements_load_scripts() {
/**
* Checks if the current page is the RCP update card page
*
* @return bool $ret
* @return bool
*/
function rcp_elements_is_update_card_page() {
global $rcp_options, $post;

$ret = false;

if ( isset( $rcp_options['update_card'] ) ) {
$ret = is_page( $rcp_options['update_card'] );
return is_page( $rcp_options['update_card'] );
}

if ( ! empty( $post ) && has_shortcode( $post->post_content, 'rcp_update_card' ) ) {
$ret = true;
return true;
}

return $ret;
return false;
}

0 comments on commit 43926df

Please sign in to comment.