当前位置: 首页>>代码示例>>PHP>>正文


PHP ninja_forms_get_all_forms函数代码示例

本文整理汇总了PHP中ninja_forms_get_all_forms函数的典型用法代码示例。如果您正苦于以下问题:PHP ninja_forms_get_all_forms函数的具体用法?PHP ninja_forms_get_all_forms怎么用?PHP ninja_forms_get_all_forms使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ninja_forms_get_all_forms函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ninja_forms_get_form_ids_by_post_id

function ninja_forms_get_form_ids_by_post_id($post_id)
{
    global $wpdb;
    $form_ids = array();
    if (is_page($post_id)) {
        $form_results = ninja_forms_get_all_forms();
        if (is_array($form_results) and !empty($form_results)) {
            foreach ($form_results as $form) {
                $form_data = $form['data'];
                if (isset($form_data['append_page']) and !empty($form_data['append_page'])) {
                    if ($form_data['append_page'] == $post_id) {
                        $form_ids[] = $form['id'];
                    }
                }
            }
        }
        $form_id = get_post_meta($post_id, 'ninja_forms_form', true);
        if (!empty($form_id)) {
            $form_ids[] = $form_id;
        }
    } else {
        if (is_single($post_id)) {
            $form_id = get_post_meta($post_id, 'ninja_forms_form', true);
            if (!empty($form_id)) {
                $form_ids[] = $form_id;
            }
        }
    }
    return $form_ids;
}
开发者ID:idies,项目名称:escience-2016-wp,代码行数:30,代码来源:database.php

示例2: ld_theme_options_all_ninja_forms

function ld_theme_options_all_ninja_forms()
{
    $return = array();
    if (function_exists('ninja_forms_get_all_forms')) {
        $all_forms = ninja_forms_get_all_forms();
        if (!empty($all_forms)) {
            foreach ($all_forms as $form) {
                $return[] = array('label' => $form['data']['form_title'], 'value' => $form['id']);
            }
        }
    }
    return $return;
}
开发者ID:julianomoreira,项目名称:euescolhivoce,代码行数:13,代码来源:option.php

示例3: ninja_forms_feditor_profile_editing_tab_metabox_options

function ninja_forms_feditor_profile_editing_tab_metabox_options()
{
    $plugin_settings = get_option('ninja_forms_settings');
    if (isset($plugin_settings['feditor'])) {
        $feditor_settings = $plugin_settings['feditor'];
    } else {
        $feditor_settings = '';
    }
    if (isset($feditor_settings['default_profile_editor'])) {
        $default_profile_editor = $feditor_settings['default_profile_editor'];
    } else {
        $default_profile_editor = '';
    }
    if (isset($plugin_settings['feditor']['show_profile_editor_username'])) {
        $show_profile_editor_username = $plugin_settings['feditor']['show_profile_editor_username'];
    } else {
        $show_profile_editor_username = 1;
    }
    if (isset($feditor_settings['profile_editing']['roles'])) {
        $sel_roles = $feditor_settings['profile_editing']['roles'];
    } else {
        $sel_roles = array();
    }
    $all_roles = get_editable_roles();
    $tmp_array = array();
    if (is_array($all_roles) and !empty($all_roles)) {
        foreach ($all_roles as $key => $role) {
            $tmp_array[] = array('name' => $role['name'], 'value' => $key);
        }
    }
    $all_roles = $tmp_array;
    if (function_exists('ninja_forms_get_all_forms')) {
        $all_forms = ninja_forms_get_all_forms();
    } else {
        $all_forms = array();
    }
    $forms_options = array();
    $forms_options[] = array('name' => '- ' . __('Ninja Forms Default', 'ninja-forms-feditor'), 'value' => '_profile_editor');
    foreach ($all_forms as $form) {
        $forms_options[] = array('name' => $form['data']['form_title'], 'value' => $form['id']);
    }
    $p_class = 'profile-editor-option';
    if ($default_profile_editor != '_profile_editor') {
        $p_class .= ' hidden';
    }
    $args = array('page' => 'ninja-forms-feditor', 'tab' => 'profile_editing', 'slug' => 'settings', 'settings' => array(array('name' => 'default_profile_editor', 'type' => 'select', 'options' => $forms_options, 'label' => __('Default profile editor', 'ninja-forms-feditor'), 'default_value' => $default_profile_editor), array('name' => '', 'type' => '', 'label' => '', 'display_function' => 'ninja_forms_feditor_default_profile_editor_options'), array('name' => 'profile_editing[roles]', 'type' => 'checkbox_list', 'select_all' => false, 'options' => $all_roles, 'label' => __('Allow these roles to edit their profile', 'ninja-forms'), 'default_value' => $sel_roles)));
    if (function_exists('ninja_forms_register_tab_metabox_options')) {
        ninja_forms_register_tab_metabox_options($args);
    }
}
开发者ID:emtv,项目名称:hackmsi,代码行数:50,代码来源:profile-editing.php

示例4: sf_ninjaforms_list

 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;
 }
开发者ID:arobbins,项目名称:spellestate,代码行数:14,代码来源:helpers.php

示例5: register_form_settings

 public static function register_form_settings()
 {
     $settings = array();
     $error = false;
     // Settings
     if (class_exists('RGFormsModel') && method_exists('RGFormsModel', 'get_forms')) {
         $gravity_options = array(0 => self::__('No forms found'));
         if (class_exists('RGFormsModel') && method_exists('RGFormsModel', 'get_forms')) {
             $all_grav_forms = RGFormsModel::get_forms(1, 'title');
             $gravity_options = array();
             foreach ($all_grav_forms as $form) {
                 $gravity_options[absint($form->id)] = esc_html($form->title);
             }
         }
         $settings = array(self::GRAVITY_FORM_ID => array('label' => self::__('GravityForms ID'), 'option' => array('type' => 'select', 'options' => $gravity_options, 'default' => self::$gravity_form_id, 'description' => sprintf(self::__('Select the submission form built with <a href="%s">Gravity Forms</a>.'), 'https://sproutapps.co/link/gravity-forms'))));
     } elseif (function_exists('ninja_forms_get_all_forms')) {
         $ninja_options = array(0 => self::__('No forms found'));
         if (function_exists('ninja_forms_get_all_forms')) {
             $all_ninja_forms = ninja_forms_get_all_forms();
             $ninja_options = array();
             foreach ($all_ninja_forms as $form) {
                 $ninja_options[$form['id']] = $form['data']['form_title'];
             }
         }
         // Settings
         $settings = array(self::NINJA_FORM_ID => array('label' => self::__('NinjaForms ID'), 'option' => array('type' => 'select', 'options' => $ninja_options, 'default' => self::$ninja_form_id, 'description' => sprintf(self::__('Select the submission form built with <a href="%s">Ninja Forms</a>.'), 'https://sproutapps.co/link/ninja-forms'))));
     } elseif (function_exists('frm_forms_autoloader')) {
         $frdbl_options = array(0 => self::__('No forms found'));
         $forms = FrmForm::get_published_forms();
         if (!empty($forms)) {
             $frdbl_options = array();
             foreach ($forms as $form) {
                 $frdbl_options[$form->id] = !isset($form->name) ? __('(no title)', 'formidable') : esc_attr(FrmAppHelper::truncate($form->name, 33));
             }
         }
         // Settings
         $settings = array(self::FORMIDABLE_FORM_ID => array('label' => self::__('Formidable ID'), 'option' => array('type' => 'select', 'options' => $frdbl_options, 'default' => self::$frdbl_form_id, 'description' => sprintf(self::__('Select the submission form built with <a href="%s">Formidable</a>.'), 'https://sproutapps.co/link/formidable'))));
     } else {
         // Settings
         $settings = array(self::NINJA_FORM_ID => array('label' => self::__('Integration Error'), 'option' => array('type' => 'bypass', 'output' => sprintf(self::__('It looks like neither <a href="%s">Gravity Forms</a> or <a href="%s">Ninja Forms</a> or <a href="%s">Formidable</a> is active.'), 'https://sproutapps.co/link/gravity-forms', 'https://sproutapps.co/link/ninja-forms', 'https://sproutapps.co/link/formidable'))));
         $error = true;
     }
     $map_settings = array();
     if (!$error) {
         // Settings
         $map_settings = array(self::FORM_ID_MAPPING => array('label' => self::__('Form ID Mapping'), 'option' => array(__CLASS__, 'show_form_field_mapping'), 'sanitize_callback' => array(__CLASS__, 'save_form_field_mapping')));
     }
     return array_merge($settings, $map_settings);
 }
开发者ID:danielbachhuber,项目名称:marcgratch.com,代码行数:49,代码来源:SI_Form_Integrations.php

示例6: ninja_forms_register_exp_forms_metabox

function ninja_forms_register_exp_forms_metabox()
{
    $form_results = ninja_forms_get_all_forms();
    $form_select = array();
    if (is_array($form_results) and !empty($form_results)) {
        foreach ($form_results as $form) {
            if (isset($form['data'])) {
                $data = $form['data'];
                $form_title = $data['form_title'];
                array_push($form_select, array('name' => $form_title, 'value' => $form['id']));
            }
        }
    }
    $args = array('page' => 'ninja-forms-impexp', 'tab' => 'impexp_forms', 'slug' => 'exp_form', 'title' => __('Export a form', 'ninja-forms'), 'settings' => array(array('name' => 'form_id', 'type' => 'select', 'label' => __('Select a form', 'ninja-forms'), 'desc' => '', 'options' => $form_select, 'help_text' => ''), array('name' => 'submit', 'type' => 'submit', 'label' => __('Export Form', 'ninja-forms'), 'class' => 'button-secondary')));
    ninja_forms_register_tab_metabox($args);
}
开发者ID:Natedaug,项目名称:WordPressSites,代码行数:16,代码来源:impexp-forms.php

示例7: load

 /**
  * Implement interface, map ninja forms shortcode
  * @since 4.4
  */
 public function load()
 {
     if (!function_exists('ninja_forms_get_all_forms')) {
         // experimental, maybe not needed
         require_once NINJA_FORMS_DIR . '/includes/database.php';
     }
     $ninja_forms_data = ninja_forms_get_all_forms();
     $ninja_forms = array();
     if (!empty($ninja_forms_data)) {
         // Fill array with Name=>Value(ID)
         foreach ($ninja_forms_data as $key => $value) {
             if (is_array($value)) {
                 $ninja_forms[$value['name']] = $value['id'];
             }
         }
     }
     $this->mapNinjaForms($ninja_forms);
 }
开发者ID:arkev,项目名称:IntelligentMode,代码行数:22,代码来源:class-vc-vendor-ninja-forms.php

示例8: populate_form_values

function populate_form_values()
{
    if (!function_exists('ninja_forms_get_all_forms')) {
        return array('Formulär är inte aktiverat' => '0');
    }
    $forms_data = ninja_forms_get_all_forms();
    $forms = array();
    if (!empty($forms_data)) {
        foreach ($forms_data as $i => $v) {
            if (is_array($v)) {
                $forms[$v['name']] = $v['id'];
            }
        }
    } else {
        return array('Hittade inga formulär' => '0');
    }
    return $forms;
}
开发者ID:sebjon-bytbil,项目名称:BB.CMS,代码行数:18,代码来源:form.php

示例9: addShortcodeSettings

 /**
  * Mapping settings for lean method.
  *
  * @since 4.9
  *
  * @param $tag
  *
  * @return array
  */
 public function addShortcodeSettings($tag)
 {
     if (!function_exists('ninja_forms_get_all_forms')) {
         // experimental, maybe not needed
         require_once NINJA_FORMS_DIR . '/includes/database.php';
     }
     $ninja_forms_data = ninja_forms_get_all_forms();
     $ninja_forms = array();
     if (!empty($ninja_forms_data)) {
         // Fill array with Name=>Value(ID)
         foreach ($ninja_forms_data as $key => $value) {
             if (is_array($value)) {
                 $ninja_forms[$value['name']] = $value['id'];
             }
         }
     }
     return array('base' => $tag, 'name' => __('Ninja Forms', 'js_composer'), 'icon' => 'icon-wpb-ninjaforms', 'category' => __('Content', 'js_composer'), 'description' => __('Place Ninja Form', 'js_composer'), 'params' => array(array('type' => 'dropdown', 'heading' => __('Select ninja form', 'js_composer'), 'param_name' => 'id', 'value' => $ninja_forms, 'save_always' => true, 'description' => __('Choose previously created ninja form from the drop down list.', 'js_composer'))));
 }
开发者ID:k2jysy,项目名称:wedev,代码行数:27,代码来源:class-vc-vendor-ninja-forms.php

示例10: loading

    public function loading()
    {
        global $wpdb;
        /**
         * Add our table structure for version 2.8.
         */
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        // Create our object meta table
        $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECT_META_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `object_id` bigint(20) NOT NULL,\n\t\t  `meta_key` varchar(255) NOT NULL,\n\t\t  `meta_value` longtext NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
        dbDelta($sql);
        // Create our object table
        $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECTS_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `type` varchar(255) NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
        dbDelta($sql);
        // Create our object relationships table
        $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECT_RELATIONSHIPS_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `child_id` bigint(20) NOT NULL,\n\t\t  `parent_id` bigint(20) NOT NULL,\n\t\t  `child_type` varchar(255) NOT NULL,\n\t\t  `parent_type` varchar(255) NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
        dbDelta($sql);
        if (isset($email_address['id'])) {
            $sql = 'DELETE FROM `' . NINJA_FORMS_FAV_FIELDS_TABLE_NAME . '` WHERE id = ' . $email_address['id'];
            $wpdb->query($sql);
        }
        $sql = 'INSERT INTO `' . NINJA_FORMS_FAV_FIELDS_TABLE_NAME . '` (`id`, `row_type`, `type`, `order`, `data`, `name`) VALUES
		(1, 0, \'_text\', 0, \'a:11:{s:5:\\"label\\";s:13:\\"Email Address\\";s:9:\\"label_pos\\";s:4:\\"left\\";s:13:\\"default_value\\";s:0:\\"\\";s:4:\\"mask\\";s:0:\\"\\";s:10:\\"datepicker\\";s:1:\\"0\\";s:5:\\"email\\";s:1:\\"1\\";s:10:\\"send_email\\";s:1:\\"0\\";s:3:\\"req\\";s:1:\\"0\\";s:5:\\"class\\";s:0:\\"\\";s:9:\\"show_help\\";s:1:\\"0\\";s:9:\\"help_text\\";s:0:\\"\\";}\', \'Email Address\')';
        $wpdb->query($sql);
        // Get our total number of forms.
        $form_count = nf_get_form_count();
        // Get all our forms
        $forms = ninja_forms_get_all_forms(true);
        $x = 1;
        if (is_array($forms)) {
            foreach ($forms as $form) {
                $this->args['forms'][$x] = $form['id'];
                $x++;
            }
        }
        if (empty($this->total_steps) || $this->total_steps <= 1) {
            $this->total_steps = $form_count;
        }
        $args = array('total_steps' => $this->total_steps, 'step' => 1);
        $this->redirect = admin_url('index.php?page=nf-about');
        return $args;
    }
开发者ID:HeliWang,项目名称:EngSoc-Website,代码行数:41,代码来源:convert-notifications.php

示例11: add_customizable_meta_box

    function add_customizable_meta_box($product)
    {
        $wpc_metas = get_post_meta($product->ID, 'wpc-metas', true);
        $selected_options_form = WPD_Admin::get_proper_value($wpc_metas, 'ninja-form-options', "");
        $is_checked = $this->get_checkbox_value($wpc_metas, 'is-customizable', '');
        echo "<label for='is-customizable'>";
        echo "<input type='checkbox' name='wpc-metas[is-customizable]' id='is-customizable' value='1' {$is_checked} />Customizable product</label><br>";
        $is_checked = $this->get_checkbox_value($wpc_metas, 'can-design-from-blank', '');
        echo "<label for='can-design-from-blank'>";
        echo "<input type='checkbox' name='wpc-metas[can-design-from-blank]' id='can-design-from-blank' value='1' {$is_checked} />The clients can design from blank</label><br>";
        if (function_exists('ninja_forms_get_all_forms')) {
            $forms = ninja_forms_get_all_forms();
            ?>
            <div>
                <h4><?php 
            echo _e("Customized product options form", "wpd");
            ?>
</h4>
                <select name="wpc-metas[ninja-form-options]" class="mg-top-10"> 
                <option value="">
               <?php 
            echo _e("No option form needed", "wpd");
            ?>
</option>
                <?php 
            foreach ($forms as $form) {
                if ($selected_options_form == $form['id']) {
                    $option = '<option value="' . $form['id'] . '" selected>';
                } else {
                    $option = '<option value="' . $form['id'] . '">';
                }
                $option .= $form['data']['form_title'];
                $option .= '</option>';
                echo $option;
            }
            ?>
               </select>
            </div>
        <?php 
        }
    }
开发者ID:Zovio,项目名称:woocommerce-products-designer,代码行数:41,代码来源:class-wpd-product.php

示例12: loading

 public function loading()
 {
     // Remove old email settings.
     nf_change_email_fav();
     // Get our total number of forms.
     $form_count = nf_get_form_count();
     // Get all our forms
     $forms = ninja_forms_get_all_forms(true);
     $x = 1;
     if (is_array($forms)) {
         foreach ($forms as $form) {
             $this->args['forms'][$x] = $form['id'];
             $x++;
         }
     }
     if (empty($this->total_steps) || $this->total_steps <= 1) {
         $this->total_steps = $form_count;
     }
     $args = array('total_steps' => $this->total_steps, 'step' => 1);
     $this->redirect = admin_url('admin.php?page=ninja-forms');
     return $args;
 }
开发者ID:serker72,项目名称:T3S,代码行数:22,代码来源:update-email-settings.php

示例13: loading

 public function loading()
 {
     global $wpdb;
     /**
      * Add our table structure for version 2.8.
      */
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     // Create our object meta table
     $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECT_META_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `object_id` bigint(20) NOT NULL,\n\t\t  `meta_key` varchar(255) NOT NULL,\n\t\t  `meta_value` longtext NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
     dbDelta($sql);
     // Create our object table
     $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECTS_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `type` varchar(255) NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
     dbDelta($sql);
     // Create our object relationships table
     $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECT_RELATIONSHIPS_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `child_id` bigint(20) NOT NULL,\n\t\t  `parent_id` bigint(20) NOT NULL,\n\t\t  `child_type` varchar(255) NOT NULL,\n\t\t  `parent_type` varchar(255) NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
     dbDelta($sql);
     // Remove old email settings.
     nf_change_email_fav();
     nf_remove_old_email_settings();
     // Get our total number of forms.
     $form_count = nf_get_form_count();
     // Get all our forms
     $forms = ninja_forms_get_all_forms(true);
     $x = 1;
     if (is_array($forms)) {
         foreach ($forms as $form) {
             $this->args['forms'][$x] = $form['id'];
             $x++;
         }
     }
     if (empty($this->total_steps) || $this->total_steps <= 1) {
         $this->total_steps = $form_count;
     }
     $args = array('total_steps' => $this->total_steps, 'step' => 1);
     $this->redirect = admin_url('index.php?page=nf-about');
     return $args;
 }
开发者ID:umairakhtar123,项目名称:hova,代码行数:37,代码来源:convert-notifications.php

示例14: ninja_forms_inner_custom_box

function ninja_forms_inner_custom_box()
{
    $post_id = !empty($_REQUEST['post']) ? absint($_REQUEST['post']) : 0;
    // Use nonce for verification
    wp_nonce_field(plugin_basename(__FILE__), 'ninja_forms_nonce');
    // The actual fields for data entry
    ?>
	<select id="ninja_form_select" name="ninja_form_select">
		<option value="0">-- <?php 
    _e('None', 'ninja-forms');
    ?>
</option>
		<?php 
    $all_forms = ninja_forms_get_all_forms();
    $form_id = get_post_meta($post_id, 'ninja_forms_form', true);
    foreach ($all_forms as $form) {
        $title = $form['data']['form_title'];
        $id = $form['id'];
        ?>
			<option value="<?php 
        echo esc_attr($id);
        ?>
"<?php 
        selected($id, $form_id);
        ?>
>
			<?php 
        echo $title;
        ?>
			</option>
			<?php 
    }
    ?>
	</select>
	<?php 
}
开发者ID:serker72,项目名称:T3S,代码行数:36,代码来源:post-metabox.php

示例15: get_forms

 private function get_forms()
 {
     $ninja_forms = array();
     if ($this->is_ninja_forms_three()) {
         $ninja_forms_data = ninja_forms_get_all_forms();
         if (!empty($ninja_forms_data)) {
             // Fill array with Name=>Value(ID)
             foreach ($ninja_forms_data as $key => $value) {
                 if (is_array($value)) {
                     $ninja_forms[$value['name']] = $value['id'];
                 }
             }
         }
     } else {
         $ninja_forms_data = Ninja_Forms()->form()->get_forms();
         if (!empty($ninja_forms_data)) {
             // Fill array with Name=>Value(ID)
             foreach ($ninja_forms_data as $form) {
                 $ninja_forms[$form->get_setting('title')] = $form->get_id();
             }
         }
     }
     return $ninja_forms;
 }
开发者ID:pab44,项目名称:pab44,代码行数:24,代码来源:class-vc-vendor-ninja-forms.php


注:本文中的ninja_forms_get_all_forms函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。