Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bnecreative/b2b8f47a0102d69ac4127326fe6d4b70 to your computer and use it in GitHub Desktop.
Save bnecreative/b2b8f47a0102d69ac4127326fe6d4b70 to your computer and use it in GitHub Desktop.
Testimonials - Add new field to Setting Page
<?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