Created
March 6, 2020 19:06
-
-
Save bnecreative/b2b8f47a0102d69ac4127326fe6d4b70 to your computer and use it in GitHub Desktop.
Testimonials - Add new field to Setting Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Don't copy this line... | |
/* | |
* BNE Testimonials Settings API | |
* | |
* Add new settings to the settings page. | |
* | |
*/ | |
function custom_testimoinals_add_settings() { | |
$cmb = cmb2_get_metabox( 'bne_testimonials_settings_metabox' ); | |
if( $cmb ) { | |
$cmb->add_field( array( | |
'id' => 'yotpo_key', | |
'name' => esc_html( 'Yotpo API key', 'bne-testimonials' ), | |
'desc' => esc_html( 'An API key is required to interact with the Yotpo API.', 'bne-testimonials' ), | |
'type' => 'text', | |
) ); | |
} | |
} | |
add_action('cmb2_init_before_hookup', 'custom_testimoinals_add_settings' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment