本文整理汇总了PHP中Ninja_Forms类的典型用法代码示例。如果您正苦于以下问题:PHP Ninja_Forms类的具体用法?PHP Ninja_Forms怎么用?PHP Ninja_Forms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ninja_Forms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Redirect', 'ninja-forms');
$settings = Ninja_Forms::config('ActionRedirectSettings');
$this->_settings = array_merge($this->_settings, $settings);
}
示例2: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Email', 'ninja-forms');
$settings = Ninja_Forms::config('ActionEmailSettings');
$this->_settings = array_merge($this->_settings, $settings);
$this->_backwards_compatibility();
}
示例3: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Success Message', 'ninja-forms');
$settings = Ninja_Forms::config('ActionSuccessMessageSettings');
$this->_settings = array_merge($this->_settings, $settings);
add_action('nf_before_import_form', array($this, 'import_form_action_success_message'), 11);
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->_blacklist = apply_filters('ninja_forms_uploads_extension_blacklist', Ninja_Forms::config('UploadsExtensionBlacklist'));
add_action('wp_ajax_nf_async_upload', array($this, 'upload'));
add_action('wp_ajax_nopriv_nf_async_upload', array($this, 'upload'));
add_action('nf_uploads_delete_temporary_file', array($this, 'delete_temporary_file'), 10, 1);
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Collect Payment', 'ninja-forms');
$settings = Ninja_Forms::config('ActionCollectPaymentSettings');
$this->_settings = array_merge($this->_settings, $settings);
add_action('plugins_loaded', array($this, 'register_payment_gateways'));
add_filter('ninja_forms_action_type_settings', array($this, 'maybe_remove_action'));
}
示例6: _nf_removed_hooks
function _nf_removed_hooks()
{
global $wp_filter;
$hooks = array('ninja_forms_insert_sub', 'nf_email_notification_after_settings', 'nf_edit_notification_settings', 'ninja_forms_edit_field_before_li', 'ninja_forms_edit_field_after_li', 'ninja_forms_edit_field_before_closing_li', 'ninja_forms_edit_field_before_registered', 'ninja_forms_edit_field_after_registered', 'ninja_forms_edit_field_before_ul', 'ninja_forms_edit_field_ul', 'ninja_forms_edit_field_after_ul', 'ninja_forms_email_admin', 'ninja_forms_email_user', 'ninja_forms_display_before_field_label', 'ninja_forms_display_field_label', 'ninja_forms_display_after_field_label', 'ninja_forms_display_field_help', 'ninja_forms_display_field_label', 'ninja_forms_display_field_help', 'nf_before_display_loading', 'ninja_forms_display_open_form_wrap', 'ninja_forms_display_form_title', 'ninja_forms_display_open_form_tag', 'ninja_forms_display_fields', 'ninja_forms_display_close_form_tag', 'ninja_forms_display_close_form_wrap', 'nf_notification_before_process', 'nf_save_notification', 'nf_sub_table_after_row_actions_trash', 'nf_sub_table_after_row_actions', 'nf_sub_table_before_row_actions_trash', 'nf_sub_table_before_row_actions', 'ninja_forms_after_import_form', 'ninja_forms_display_after_closing_field_wrap', 'ninja_forms_display_after_field_function', 'ninja_forms_display_after_field_label', 'ninja_forms_display_after_field', 'ninja_forms_display_after_opening_field_wrap', 'ninja_forms_display_before_closing_field_wrap', 'ninja_forms_display_before_field_function', 'ninja_forms_display_before_field_label', 'ninja_forms_display_before_field', 'ninja_forms_display_before_opening_field_wrap', 'ninja_forms_display_css', 'ninja_forms_save_admin_metabox_option', 'ninja_forms_save_admin_metabox', 'ninja_forms_save_admin_sidebar', 'ninja_forms_save_admin_tab', 'ninja_forms_before_pre_process', 'ninja_forms_display_after_fields', 'ninja_forms_display_after_form_title', 'ninja_forms_display_after_form_wrap', 'ninja_forms_display_after_open_form_tag', 'ninja_forms_display_before_fields', 'ninja_forms_display_before_form_title', 'ninja_forms_display_before_form_wrap', 'ninja_forms_display_before_form', 'ninja_forms_post_process', 'ninja_forms_pre_process', 'ninja_forms_process', 'nf_export_form_row', 'nf_notification_admin_js_vars', 'nf_success_message_locations', 'nf_notification_types', 'ninja_forms_admin_submissions_datepicker_args', 'ninja_forms_starter_form_contents', 'ninja_forms_preview_page_title', 'nf_input_limit_types', 'ninja_forms_edit_field_li_label', 'nf_edit_field_settings_sections', 'ninja_forms_use_post_fields', 'nf_general_settings_advanced', 'nf_new_form_defaults', 'ninja_forms_use_post_fields', 'ninja_forms_form_settings_basic', 'ninja_forms_form_settings_restrictions', 'nf_upgrade_handler_register', 'ninja_forms_save_sub', 'ninja_forms_export_subs_csv_file_name', 'ninja_forms_export_sub_label', 'ninja_forms_export_subs_label_array', 'ninja_forms_export_sub_pre_value', 'ninja_forms_export_sub_value', 'ninja_forms_export_subs_value_array', 'ninja_forms_csv_bom', 'ninja_forms_csv_delimiter', 'ninja_forms_csv_enclosure', 'ninja_forms_csv_terminator', 'ninja_forms_sub_table_row_actions', 'ninja_forms_csv_delimiter', 'ninja_forms_csv_enclosure', 'ninja_forms_csv_terminator', 'ninja_forms_admin_menu_capabilities', 'ninja_forms_email_all_fields_array', 'nf_email_user_values_title', 'ninja_forms_email_field_label', 'ninja_forms_email_user_value', 'ninja_forms_email_field_list', 'ninja_forms_admin_email_message_wpautop', 'ninja_forms_admin_email_from', 'ninja_forms_user_email_message_wpautop', 'ninja_forms_submission_csv_name', 'ninja_forms_success_msg', 'nf_delete_form_capabilities', 'ninja_forms_field', 'ninja_forms_display_field_type', 'ninja_forms_use_post_fields', 'ninja_forms_list_terms', 'ninja_forms_display_form_form_data', 'ninja_forms_admin_subject', 'ninja_forms_user_subject', 'ninja_forms_admin_email', 'ninja_forms_user_email', 'ninja_forms_save_msg', 'ninja_forms_display_script_field_data', 'ninja_forms_display_form_form_data', 'ninja_forms_enable_credit_card_field', 'ninja_forms_post_credit_card_field', 'ninja_forms_credit_card_field_desc_pos', 'ninja_forms_hide_cc_field', 'ninja_forms_display_list_options_span_class', 'nf_import_notification_meta', 'ninja_forms_labels/timed_submit_error', 'ninja_forms_form_list_template_function', 'nf_all_fields_field_value', 'nf_all_fields_table', 'nf_before_import_field', 'nf_delete_field_capabilities', 'nf_download_all_filename', 'nf_email_notification_attachment_types', 'nf_email_notification_attachments', 'nf_email_notification_process_setting', 'nf_general_settings_recaptcha', 'nf_new_field_capabilities', 'nf_notification_process_setting', 'nf_step_processing_labels', 'nf_sub_csv_bom', 'nf_sub_edit_status', 'nf_sub_human_time', 'nf_sub_table_row_actions', 'nf_sub_table_status', 'nf_sub_table_user_value_max_items', 'nf_sub_table_user_value_max_len', 'nf_sub_title_time', 'nf_subs_csv_field_label', 'nf_subs_csv_filename', 'nf_subs_csv_label_array_before_fields', 'nf_subs_csv_value_array', 'nf_subs_export_pre_value', 'nf_subs_table_qv', 'nf_success_msg', 'ninja_forms_admin_email_message_wpautop', 'ninja_forms_admin_metabox_rte', 'ninja_forms_ajax_url', 'ninja_forms_before_import_form', 'ninja_forms_cont_class', 'ninja_forms_credit_card_cvc_desc', 'ninja_forms_credit_card_cvc_label', 'ninja_forms_credit_card_exp_month_desc', 'ninja_forms_credit_card_exp_month_label', 'ninja_forms_credit_card_exp_year_desc', 'ninja_forms_credit_card_exp_year_label', 'ninja_forms_credit_card_name_desc', 'ninja_forms_credit_card_name_label', 'ninja_forms_credit_card_number_desc', 'ninja_forms_display_field_class', 'ninja_forms_display_field_desc_class', 'ninja_forms_display_field_processing_error_class', 'ninja_forms_display_fields_wrap_visibility', 'ninja_forms_display_form_visibility', 'ninja_forms_display_required_items_class', 'ninja_forms_display_response_message_class', 'ninja_forms_display_show_form', 'ninja_forms_dropdown_open_tag', 'ninja_forms_dropdown_placeholder', 'ninja_forms_edit_field_rte', 'ninja_forms_field_post_process_user_value', 'ninja_forms_field_pre_process_user_value', 'ninja_forms_field_process_user_value', 'ninja_forms_field_shortcode', 'ninja_forms_field_wrap_class', 'ninja_forms_fields_wrap_class', 'ninja_forms_form_class', 'ninja_forms_form_list_forms', 'ninja_forms_form_wrap_class', 'ninja_forms_label_class', 'ninja_forms_labels/currency_symbol', 'ninja_forms_labels/date_format', 'ninja_forms_labels/honeypot_error', 'ninja_forms_labels/invalid_email', 'ninja_forms_labels/javascript_error', 'ninja_forms_labels/password_mismatch', 'ninja_forms_labels/process_label', 'ninja_forms_labels/req_div_label', 'ninja_forms_labels/req_error_label', 'ninja_forms_labels/req_field_error', 'ninja_forms_labels/req_field_symbol', 'ninja_forms_labels/spam_error', 'ninja_forms_display_fields_array');
foreach ($hooks as $hook) {
apply_filters($hook, '');
// add_action() is just a wrapper for add_filter(), so use add_filter() for both.
if (!isset($wp_filter[$hook]) || !$wp_filter[$hook]) {
continue;
}
Ninja_Forms::deprecated_notice($hook, '3.0', null);
}
}
示例7: display
public function display()
{
Ninja_Forms::template('admin-menu-add-field.html.php');
wp_enqueue_style('nf-builder', Ninja_Forms::$url . 'assets/css/builder.css');
wp_enqueue_style('qtip2', Ninja_Forms::$url . 'assets/css/jquery.qtip.css');
wp_enqueue_script('backbone-marionette', Ninja_Forms::$url . 'assets/js/lib/backbone.marionette.min.js', array('jquery', 'backbone'));
wp_enqueue_script('backbone-radio', Ninja_Forms::$url . 'assets/js/lib/backbone.radio.min.js', array('jquery', 'backbone'));
wp_enqueue_script('jquery-perfect-scrollbar', Ninja_Forms::$url . 'assets/js/lib/perfect-scrollbar.jquery.min.js', array('jquery'));
wp_enqueue_script('jquery-hotkeys-new', Ninja_Forms::$url . 'assets/js/lib/jquery.hotkeys.js');
wp_enqueue_script('jquery-qtip2', Ninja_Forms::$url . 'assets/js/lib/jquery.qtip.js');
wp_enqueue_script('requirejs', Ninja_Forms::$url . 'assets/js/lib/require.js', array('jquery', 'backbone'));
wp_enqueue_script('nf-builder', Ninja_Forms::$url . 'assets/js/builder/main.js', array('jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable'));
wp_localize_script('nf-builder', 'nfAdmin', array('ajaxNonce' => wp_create_nonce('ninja_forms_ajax_nonce'), 'requireBaseUrl' => Ninja_Forms::$url . 'assets/js/'));
}
示例8: display
public function display()
{
$tabs = apply_filters('ninja_forms_settings_tabs', array('settings' => __('Settings', 'ninja-forms'), 'licenses' => __('Licenses', 'ninja-forms')));
$tab_keys = array_keys($tabs);
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : reset($tab_keys);
wp_enqueue_style('nf-admin-settings', Ninja_Forms::$url . 'assets/css/admin-settings.css');
$groups = Ninja_Forms()->config('PluginSettingsGroups');
$grouped_settings = $this->get_settings();
$save_button_text = __('Save Settings', 'ninja-forms');
$setting_defaults = Ninja_Forms()->get_settings();
$errors = array();
foreach ($grouped_settings as $group => $settings) {
foreach ($settings as $id => $setting) {
$value = isset($setting_defaults[$id]) ? $setting_defaults[$id] : '';
$grouped_settings[$group][$id]['id'] = $this->prefix($grouped_settings[$group][$id]['id']);
$grouped_settings[$group][$id]['value'] = $value;
$grouped_settings[$group][$id] = apply_filters('ninja_forms_check_setting_' . $id, $grouped_settings[$group][$id]);
if (!isset($grouped_settings[$group][$id]['errors']) || !$grouped_settings[$group][$id]['errors']) {
continue;
}
if (!is_array($grouped_settings[$group][$id]['errors'])) {
$grouped_settings[$group][$id]['errors'] = array($grouped_settings[$group][$id]['errors']);
}
foreach ($grouped_settings[$group][$id]['errors'] as $old_key => $error) {
$new_key = $grouped_settings[$group][$id]['id'] . "[" . $old_key . "]";
$errors[$new_key] = $error;
$grouped_settings[$group][$id]['errors'][$new_key] = $error;
unset($grouped_settings[$group][$id]['errors'][$old_key]);
}
}
}
$grouped_settings['general']['version']['value'] = Ninja_Forms::VERSION;
$saved_fields = Ninja_Forms()->form()->get_fields(array('saved' => 1));
foreach ($saved_fields as $saved_field) {
$saved_field_id = $saved_field->get_id();
$grouped_settings['saved_fields'][] = array('id' => '', 'type' => 'html', 'html' => '<a class="js-delete-saved-field button button-secondary" data-id="' . $saved_field_id . '">' . __('Delete') . '</a>', 'label' => $saved_field->get_setting('label'));
}
if ($saved_fields) {
wp_register_script('ninja_forms_admin_menu_settings', Ninja_Forms::$url . 'assets/js/admin-settings.js', array('jquery'), FALSE, TRUE);
wp_localize_script('ninja_forms_admin_menu_settings', 'nf_settings', array('ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce("ninja_forms_settings_nonce")));
wp_enqueue_script('ninja_forms_admin_menu_settings');
}
Ninja_Forms::template('admin-menu-settings.html.php', compact('tabs', 'active_tab', 'groups', 'grouped_settings', 'save_button_text', 'errors'));
}
示例9: display
public function display()
{
wp_enqueue_style('nf-admin-addons', Ninja_Forms::$url . 'assets/css/admin-addons.css');
$items = wp_remote_get('https://ninjaforms.com/?extend_feed=jlhrbgf89734go7387o4g3h');
$items = wp_remote_retrieve_body($items);
$items = json_decode($items, true);
//shuffle( $items );
$notices = array();
foreach ($items as $item) {
$plugin_data = array();
if (!empty($item['plugin']) && file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) {
$plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $item['plugin'], false, true);
}
$version = isset($plugin_data['Version']) ? $plugin_data['Version'] : '';
if (!empty($version) && $version < $item['version']) {
$notices[] = array('title' => $item['title'], 'old_version' => $version, 'new_version' => $item['version']);
}
}
Ninja_Forms::template('admin-menu-addons.html.php', compact('items', 'notices'));
}
示例10: update_settings
public function update_settings()
{
if (!current_user_can(apply_filters('ninja_forms_admin_form_settings_capabilities', 'manage_options'))) {
return;
}
if (!isset($_POST[$this->_prefix])) {
return;
}
$settings = $_POST['ninja_forms'];
if (isset($settings['currency'])) {
$currency = sanitize_text_field($settings['currency']);
$currency_symbols = Ninja_Forms::config('CurrencySymbol');
$settings['currency_symbol'] = isset($currency_symbols[$currency]) ? $currency_symbols[$currency] : '';
}
foreach ($settings as $id => $value) {
$value = sanitize_text_field($value);
$value = apply_filters('ninja_forms_update_setting_' . $id, $value);
Ninja_Forms()->update_setting($id, $value);
do_action('ninja_forms_save_setting_' . $id, $value);
}
}
示例11:
<div class="nf-select">
<select>
<option>Character</option>
<option>Words</option>
</select>
</div>
</div>
<div class="nf-full">
<label>Text to appear after counter</label>
<input type="text" value="character(s) left" />
</div>
</fieldset>
</div>
</section>
<section class="nf-settings">
<h3><span class="dashicons dashicons-arrow-right"></span>Advanced Settings</h3>
</section>
<section class="nf-settings">
<h3><span class="dashicons dashicons-arrow-right"></span>Conditional Settings</h3>
</section>
<?php
Ninja_Forms::template('ui-nf-toggle-drawer.html.php');
?>
<?php
Ninja_Forms::template('ui-nf-drawer-buttons.html.php');
?>
</div>
</div>
示例12: _localize_form_settings
protected function _localize_form_settings()
{
$form_settings_types = Ninja_Forms::config('FormSettingsTypes');
$form_settings['display'] = Ninja_Forms::config('FormDisplaySettings');
$form_settings['restrictions'] = Ninja_Forms::config('FormRestrictionSettings');
$form_settings['calculations'] = Ninja_Forms::config('FormCalculationSettings');
$form_settings = apply_filters('ninja_forms_localize_forms_settings', $form_settings);
$groups = Ninja_Forms::config('SettingsGroups');
$master_settings = array();
foreach ($form_settings_types as $id => $type) {
$unique_settings = $this->_unique_settings($form_settings[$id]);
$master_settings = array_merge($master_settings, $unique_settings);
$form_settings_types[$id]['settingGroups'] = $this->_group_settings($form_settings[$id], $groups);
$form_settings_types[$id]['settingDefaults'] = $this->_setting_defaults($unique_settings);
}
?>
<script>
var formSettingTypeData = <?php
echo wp_json_encode($form_settings_types);
?>
;
var formSettings = <?php
echo wp_json_encode(array_values($master_settings));
?>
;
</script>
<?php
}
示例13: load_settings
protected function load_settings($only_settings = array())
{
$settings = array();
// Loads a settings array from the FieldSettings configuration file.
$all_settings = Ninja_Forms::config('FieldSettings');
foreach ($only_settings as $setting) {
if (isset($all_settings[$setting])) {
$settings[$setting] = $all_settings[$setting];
}
}
return $settings;
}
示例14: display
public function display()
{
Ninja_Forms::template('admin-menu-edit-field.html.php');
wp_enqueue_style('nf-builder', Ninja_Forms::$url . 'assets/css/builder.css');
wp_enqueue_script('jquery-perfect-scrollbar', Ninja_Forms::$url . 'assets/js/lib/perfect-scrollbar.jquery.min.js', array('jquery'));
}
示例15: add_filters
/**
* Add Filters
*
* @return bool
*/
public function add_filters()
{
global $typenow;
// Bail if we aren't in our submission custom post type.
if ($typenow != 'nf_sub') {
return false;
}
$forms = Ninja_Forms()->form()->get_forms();
$form_options = array();
foreach ($forms as $form) {
$form_options[$form->get_id()] = $form->get_setting('title');
}
$form_options = apply_filters('ninja_forms_submission_filter_form_options', $form_options);
if (isset($_GET['form_id'])) {
$form_selected = $_GET['form_id'];
} else {
$form_selected = 0;
}
if (isset($_GET['begin_date'])) {
$begin_date = $_GET['begin_date'];
} else {
$begin_date = '';
}
if (isset($_GET['end_date'])) {
$end_date = $_GET['end_date'];
} else {
$end_date = '';
}
Ninja_Forms::template('admin-menu-subs-filter.html.php', compact('form_options', 'form_selected', 'begin_date', 'end_date'));
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_style('jquery-ui-datepicker', Ninja_Forms::$url . 'deprecated/assets/css/jquery-ui-fresh.min.css');
}