Esempio n. 1
0
 function spb_register_assets()
 {
     $pb_assets = array();
     $path = dirname(__FILE__) . '/shortcodes/';
     $folders = scandir($path, 1);
     foreach ($folders as $file) {
         if ($file == '.' || $file == '..' || $file == '.DS_Store' || strpos($file, '.php') != true) {
             continue;
         }
         $file = substr($file, 0, -4);
         $pb_assets[$file] = SPB_SHORTCODES . $file . '.php';
     }
     $pb_assets = apply_filters('spb_assets_filter', $pb_assets);
     if (!sf_gravityforms_activated()) {
         unset($pb_assets['gravityforms']);
     }
     if (!sf_woocommerce_activated()) {
         unset($pb_assets['products']);
         unset($pb_assets['product-reviews']);
     }
     if (!sf_gopricing_activated()) {
         unset($pb_assets['gopricing']);
     }
     if (!sf_ninjaforms_activated()) {
         unset($pb_assets['ninjaforms']);
     }
     // Load Each Asset
     foreach ($pb_assets as $asset) {
         require_once $asset;
     }
 }
Esempio n. 2
0
 function sf_ninjaforms_list()
 {
     if (!is_admin() || !sf_ninjaforms_activated()) {
         return;
     }
     $forms = ninja_forms_get_all_forms();
     $forms_array = array();
     if (!empty($forms)) {
         foreach ($forms as $form) {
             $forms_array[$form['id']] = $form['data']['form_title'];
         }
     }
     return $forms_array;
 }