예제 #1
0
/**
 * Wrapper for MAB_MetaBoxes::optionBox()
 */
function mab_option_box($name = '', $data = array())
{
    return MAB_MetaBoxes::optionBox($name, $data);
}
예제 #2
0
 function optInSettings($post)
 {
     $MabAdmin = MAB('admin');
     $MabBase = MAB();
     $MabButton = MAB('button');
     $data['meta'] = $MabBase->get_mab_meta($post->ID);
     $data['assets-url'] = MAB_ASSETS_URL;
     //get allowed optin providers
     $data['optin-providers'] = MAB_OptinProviders::getAllAllowed();
     if (!empty($data['meta']['optin-provider'])) {
         $data['optin-provider-html'] = MAB_MetaBoxes::getOptinSettingsHtml($data['meta']['optin-provider'], $post->ID);
     } else {
         $data['optin-provider-html'] = MAB_MetaBoxes::getOptinSettingsHtml('manual', $post->ID);
     }
     //get available action box styles
     $data['styles'] = MAB_Utils::getStyles();
     //get buttons
     $data['buttons'] = $MabButton->getConfiguredButtons();
     $filename = 'metaboxes/type/optin-settings.php';
     $box = MAB_Utils::getView($filename, $data);
     echo $box;
 }
예제 #3
0
 /**
  * FUNCTIONAL CALLBACKS
  * ================================ */
 public static function ajaxGetOptinProviderSettings()
 {
     $data = stripslashes_deep($_REQUEST);
     $provider = sanitize_text_field($data['provider']);
     if (empty($provider)) {
         echo "No settings found for selected opt-in provider [{$provider}].";
         exit;
     }
     $optinProviders = MAB_OptinProviders::getAllAllowed();
     if (empty($optinProviders[$provider])) {
         echo "No settings found for selected opt-in provider [{$provider}].";
         exit;
     }
     $postId = intval($data['postid']);
     echo MAB_MetaBoxes::getOptinSettingsHtml($provider, $postId);
     exit;
 }
예제 #4
0
 function register_meta_box_cb($post)
 {
     $MabMetaBoxes = new MAB_MetaBoxes($post);
     $MabMetaBoxes->initMetaboxes();
 }