Skip to content

Commit

Permalink
Only do rest api hooks if register_api_field function exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Sep 8, 2016
1 parent c0fe88e commit 0960da5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function cmb2_bootstrap() {
$hookup->universal_hooks();
}

if ( $cmb->prop( 'show_in_rest' ) ) {
if ( $cmb->prop( 'show_in_rest' ) && function_exists( 'register_api_field' ) ) {
$rest = new CMB2_REST_Access( $cmb );
$rest->universal_hooks();
}
Expand Down

0 comments on commit 0960da5

Please sign in to comment.