-
-
Save clifgriffin/44ac30efbe3c01b450aa to your computer and use it in GitHub Desktop.
Gravity Forms Download Lead Capture: CMB2 Configuration
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 include opening PHP tag | |
add_filter( 'cmb2_meta_boxes', 'cmb2_download_metabox' ); | |
/** | |
* Define the metabox and field configurations. | |
* | |
* @param array $meta_boxes | |
* @return array | |
*/ | |
function cmb2_download_metabox( array $meta_boxes ) { | |
// Start with an underscore to hide fields from custom fields list | |
$prefix = '_cgd_'; | |
// Metabox for Download Custom Post Type | |
$meta_boxes['download_settings'] = array( | |
'id' => 'download_settings', | |
'title' => 'Download Settings', | |
'object_types' => array( 'download', ), // Only Show on Download CPT | |
'context' => 'normal', | |
'priority' => 'high', | |
'show_names' => true, | |
'fields' => array( | |
array( | |
'name' => 'Download File', | |
'desc' => 'Upload the file that you would like to offer as a download.', | |
'id' => 'download_file', | |
'type' => 'file', | |
), | |
), | |
); | |
return $meta_boxes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment