本文整理汇总了PHP中ninja_forms_esc_html_deep函数的典型用法代码示例。如果您正苦于以下问题:PHP ninja_forms_esc_html_deep函数的具体用法?PHP ninja_forms_esc_html_deep怎么用?PHP ninja_forms_esc_html_deep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ninja_forms_esc_html_deep函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ninja_forms_filter_restore_progress
function ninja_forms_filter_restore_progress($data, $field_id)
{
global $ninja_forms_processing, $ninja_forms_fields;
$field_row = ninja_forms_get_field_by_id($field_id);
$field_type = $field_row['type'];
if (isset($ninja_forms_fields[$field_type]['esc_html'])) {
$esc_html = $ninja_forms_fields[$field_type]['esc_html'];
} else {
$esc_html = true;
}
if (is_object($ninja_forms_processing)) {
$clear_form = $ninja_forms_processing->get_form_setting('clear_complete');
$process_complete = $ninja_forms_processing->get_form_setting('processing_complete');
if ($process_complete != 1 or $process_complete == 1 and $clear_form != 1) {
if ($ninja_forms_processing->get_field_value($field_id) !== false) {
if ($esc_html) {
if (is_array($ninja_forms_processing->get_field_value($field_id))) {
$default_value = ninja_forms_esc_html_deep($ninja_forms_processing->get_field_value($field_id));
} else {
$default_value = esc_html($ninja_forms_processing->get_field_value($field_id));
}
} else {
$default_value = $ninja_forms_processing->get_field_value($field_id);
}
$data['default_value'] = $default_value;
}
}
}
return $data;
}
示例2: nf_save_sub
function nf_save_sub()
{
global $ninja_forms_processing, $ninja_forms_fields;
// save forms by default
$save = true;
// check if there's some legacy save settings saved in the database
if (0 === $ninja_forms_processing->get_form_setting('save_subs')) {
$save = false;
}
$save = apply_filters('ninja_forms_save_submission', $save, $ninja_forms_processing->get_form_ID());
if ($save) {
$action = $ninja_forms_processing->get_action();
$user_id = $ninja_forms_processing->get_user_ID();
$sub_id = $ninja_forms_processing->get_form_setting('sub_id');
$form_id = $ninja_forms_processing->get_form_ID();
$field_data = $ninja_forms_processing->get_all_fields();
// If we don't have a submission ID already, create a submission post.
if (empty($sub_id)) {
$sub_id = Ninja_Forms()->subs()->create($form_id);
Ninja_Forms()->sub($sub_id)->update_user_id($user_id);
do_action('nf_create_sub', $sub_id);
// Update our legacy $ninja_forms_processing with the new sub_id
$ninja_forms_processing->update_form_setting('sub_id', $sub_id);
}
do_action('nf_before_save_sub', $sub_id);
Ninja_Forms()->sub($sub_id)->update_action($action);
if (is_array($field_data) && !empty($field_data)) {
// Loop through our submitted data and add the values found there.
// Maintain backwards compatibility with older extensions that use the ninja_forms_save_sub_args filter.
$data = array();
//
foreach ($field_data as $field_id => $user_value) {
$field_row = $ninja_forms_processing->get_field_settings($field_id);
$field_type = $field_row['type'];
if (isset($ninja_forms_fields[$field_type]['save_sub'])) {
$save_sub = $ninja_forms_fields[$field_type]['save_sub'];
if ($save_sub) {
$user_value = apply_filters('nf_save_sub_user_value', $user_value, $field_id);
if (is_array($user_value)) {
$user_value = ninja_forms_esc_html_deep($user_value);
} else {
$user_value = esc_html($user_value);
}
// Add our submitted field value.
Ninja_Forms()->sub($sub_id)->add_field($field_id, $user_value);
// Maintain backwards compatibility with older extensions that use the ninja_forms_save_sub_args filter.
$data[] = array('field_id' => $field_id, 'user_value' => $user_value);
//
}
}
}
}
// Maintain backwards compatibility with older extensions that still use the ninja_forms_save_sub_args filter.
$args = apply_filters('ninja_forms_save_sub_args', array('sub_id' => $sub_id, 'form_id' => $form_id, 'data' => serialize($data)));
ninja_forms_update_sub($args);
//
do_action('nf_save_sub', $sub_id);
}
}
示例3: ninja_forms_save_impexp_fields
function ninja_forms_save_impexp_fields($data)
{
global $wpdb, $ninja_forms_admin_update_message;
$plugin_settings = nf_get_settings();
$update_message = '';
if ($_POST['submit'] == __('Export Fields', 'ninja-forms')) {
if (isset($_POST['ninja_forms_fav']) and !empty($_POST['ninja_forms_fav'])) {
$fav_ids = ninja_forms_esc_html_deep($_POST['ninja_forms_fav']);
if (isset($plugin_settings['date_format'])) {
$date_format = $plugin_settings['date_format'];
} else {
$date_format = 'm/d/Y';
}
//$today = date($date_format);
$current_time = current_time('timestamp');
$today = date($date_format, $current_time);
$favorites = array();
if (is_array($fav_ids) and !empty($fav_ids)) {
$x = 0;
foreach ($fav_ids as $fav_id) {
$fav_row = ninja_forms_get_fav_by_id($fav_id);
$fav_row['id'] = NULL;
$favorites[$x] = $fav_row;
$x++;
}
}
$favorites = serialize($favorites);
header("Content-type: application/csv");
header("Content-Disposition: attachment; filename=favorites-" . $today . ".nff");
header("Pragma: no-cache");
header("Expires: 0");
echo $favorites;
die;
} else {
$update_message = __('Please select favorite fields to export.', 'ninja-forms');
}
} elseif ($_POST['submit'] == __('Import Favorites', 'ninja-forms')) {
if ($_FILES['userfile']['error'] == UPLOAD_ERR_OK and is_uploaded_file($_FILES['userfile']['tmp_name'])) {
$file = file_get_contents($_FILES['userfile']['tmp_name']);
$favorites = unserialize($file);
if (is_array($favorites)) {
foreach ($favorites as $fav) {
$fav['data'] = serialize($fav['data']);
$wpdb->insert(NINJA_FORMS_FAV_FIELDS_TABLE_NAME, $fav);
}
}
$update_message = __('Favorites imported successfully.', 'ninja-forms');
} else {
$update_message = __('Please select a valid favorite fields file.', 'ninja-forms');
}
}
return $update_message;
}
示例4: ninja_forms_save_sub
function ninja_forms_save_sub()
{
global $ninja_forms_processing, $ninja_forms_fields;
// save forms by default
$save = true;
// check if there's some legacy save settings saved in the database
if (0 === $ninja_forms_processing->get_form_setting('save_subs')) {
$save = false;
}
$save = apply_filters('ninja_forms_save_submission', $save, $ninja_forms_processing->get_form_ID());
if ($save) {
$action = $ninja_forms_processing->get_action();
$user_id = $ninja_forms_processing->get_user_ID();
$sub_id = $ninja_forms_processing->get_form_setting('sub_id');
$form_id = $ninja_forms_processing->get_form_ID();
$field_data = $ninja_forms_processing->get_all_fields();
$sub_data = array();
if (is_array($field_data) and !empty($field_data)) {
foreach ($field_data as $field_id => $user_value) {
$field_row = $ninja_forms_processing->get_field_settings($field_id);
$field_type = $field_row['type'];
if (isset($ninja_forms_fields[$field_type]['save_sub'])) {
$save_sub = $ninja_forms_fields[$field_type]['save_sub'];
if ($save_sub) {
ninja_forms_remove_from_array($sub_data, "field_id", $field_id, TRUE);
$user_value = apply_filters('ninja_forms_save_sub', $user_value, $field_id);
if (is_array($user_value)) {
$user_value = ninja_forms_esc_html_deep($user_value);
} else {
$user_value = esc_html($user_value);
}
array_push($sub_data, array('field_id' => $field_id, 'user_value' => $user_value));
}
}
}
}
$args = array('form_id' => $form_id, 'user_id' => $user_id, 'action' => $action, 'data' => serialize($sub_data), 'status' => 1);
$args = apply_filters('ninja_forms_save_sub_args', $args);
if ($sub_id != '') {
$args['sub_id'] = $sub_id;
ninja_forms_update_sub($args);
do_action('ninja_forms_update_sub', $sub_id);
} else {
$sub_id = ninja_forms_insert_sub($args);
$ninja_forms_processing->update_form_setting('sub_id', $sub_id);
do_action('ninja_forms_insert_sub', $sub_id);
}
}
}
示例5: custom_columns
/**
* Add our custom column data
*
* @access public
* @since 2.7
* @return void
*/
public function custom_columns($column, $sub_id)
{
if (isset($_GET['form_id'])) {
$form_id = $_GET['form_id'];
if ($column == 'id') {
echo apply_filters('nf_sub_table_seq_num', Ninja_Forms()->sub($sub_id)->get_seq_num(), $sub_id, $column);
echo '<div class="locked-info"><span class="locked-avatar"></span> <span class="locked-text"></span></div>';
if (!isset($_GET['post_status']) || $_GET['post_status'] == 'all') {
echo '<div class="row-actions">';
do_action('nf_sub_table_before_row_actions', $sub_id, $column);
echo '<span class="edit"><a href="post.php?post=' . $sub_id . '&action=edit&ref=' . urlencode(add_query_arg(array())) . '" title="' . __('Edit this item', 'ninja-forms') . '">' . __('Edit', 'ninja-forms') . '</a> | </span>
<span class="edit"><a href="' . add_query_arg(array('export_single' => $sub_id)) . '" title="' . __('Export this item', 'ninja-forms') . '">' . __('Export', 'ninja-forms') . '</a> | </span>';
$row_actions = apply_filters('nf_sub_table_row_actions', array(), $sub_id, $form_id);
if (!empty($row_actions)) {
echo implode(" | ", $row_actions);
echo '| ';
}
echo '<span class="trash"><a class="submitdelete" title="' . __('Move this item to the Trash', 'ninja-forms') . '" href="' . get_delete_post_link($sub_id) . '">' . __('Trash', 'ninja-forms') . '</a> </span>';
do_action('nf_sub_table_after_row_actions', $sub_id, $column);
echo '</div>';
} else {
echo '<div class="row-actions">';
do_action('nf_sub_table_before_row_actions_trash', $sub_id, $column);
echo '<span class="untrash"><a title="' . esc_attr(__('Restore this item from the Trash')) . '" href="' . wp_nonce_url(sprintf(get_edit_post_link($sub_id) . '&action=untrash', $sub_id), 'untrash-post_' . $sub_id) . '">' . __('Restore') . '</a> | </span>
<span class="delete"><a class="submitdelete" title="' . esc_attr(__('Delete this item permanently')) . '" href="' . get_delete_post_link($sub_id, '', true) . '">' . __('Delete Permanently') . '</a></span>';
do_action('nf_sub_table_after_row_actions_trash', $sub_id, $column);
echo '</div>';
}
} else {
if ($column == 'sub_date') {
$post = get_post($sub_id);
if ('0000-00-00 00:00:00' == $post->post_date) {
$t_time = $h_time = __('Unpublished');
$time_diff = 0;
} else {
$t_time = get_the_time(__('Y/m/d g:i:s A'));
$m_time = $post->post_date;
$time = get_post_time('G', true, $post);
$time_diff = time() - $time;
if ($time_diff > 0 && $time_diff < DAY_IN_SECONDS) {
$h_time = sprintf(__('%s ago'), human_time_diff($time));
} else {
$h_time = mysql2date(__('Y/m/d'), $m_time);
}
}
$t_time = apply_filters('nf_sub_title_time', $t_time);
$h_time = apply_filters('nf_sub_human_time', $h_time);
/** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */
echo '<abbr title="' . $t_time . '">' . $h_time . '</abbr>';
echo '<br />';
echo apply_filters('nf_sub_table_status', __('Submitted', 'ninja-forms'), $sub_id);
} else {
if (strpos($column, '_field_') !== false) {
global $ninja_forms_fields;
$field_id = str_replace('form_' . $form_id . '_field_', '', $column);
//if ( apply_filters( 'nf_add_sub_value', Ninja_Forms()->field( $field_id )->type->add_to_sub, $field_id ) ) {
$field = Ninja_Forms()->form($form_id)->fields[$field_id];
$field_type = $field['type'];
if (isset($ninja_forms_fields[$field_type])) {
$reg_field = $ninja_forms_fields[$field_type];
} else {
$reg_field = array();
}
if (isset($reg_field['sub_table_value'])) {
$edit_value_function = $reg_field['sub_table_value'];
} else {
$edit_value_function = 'nf_field_text_sub_table_value';
}
$user_value = Ninja_Forms()->sub($sub_id)->get_field($field_id);
$args['field_id'] = $field_id;
$args['user_value'] = ninja_forms_esc_html_deep($user_value);
$args['field'] = $field;
call_user_func_array($edit_value_function, $args);
//}
}
}
}
}
}
示例6: ninja_forms_output_tab_metabox
//.........这里部分代码省略.........
<?php
if ($style != '') {
?>
style="<?php
echo $style;
?>
"<?php
}
?>
>
<?php
if ($s['type'] == 'desc' and !$label) {
?>
<td colspan="2">
<?php
} else {
?>
<th scope="row">
<label for="<?php
echo $name;
?>
"><?php
echo $label;
?>
</label>
</th>
<td>
<?php
}
?>
<?php
switch ($s['type']) {
case 'text':
$value = ninja_forms_esc_html_deep($value);
?>
<input type="text" class="code widefat <?php
echo $class;
?>
" name="<?php
echo $name;
?>
" id="<?php
echo $name;
?>
" value="<?php
echo $value;
?>
" />
<?php
if ($help_text != '') {
?>
<a href="#" class="tooltip">
<img id="" class='ninja-forms-help-text' src="<?php
echo NINJA_FORMS_URL;
?>
images/question-ico.gif" title="">
<span>
<img class="callout" src="<?php
echo NINJA_FORMS_URL;
?>
/images/callout.gif" />
<?php
echo $help_text;
?>
</span>
示例7: ninja_forms_edit_field_output_li
function ninja_forms_edit_field_output_li($field_id, $new = false)
{
global $wpdb, $ninja_forms_fields, $nf_rte_editors;
$field_row = ninja_forms_get_field_by_id($field_id);
$current_tab = ninja_forms_get_current_tab();
if (isset($_REQUEST['page'])) {
$current_page = esc_html($_REQUEST['page']);
} else {
$current_page = '';
}
$field_type = $field_row['type'];
$field_data = $field_row['data'];
$plugin_settings = nf_get_settings();
if (isset($ninja_forms_fields[$field_type]['use_li']) && $ninja_forms_fields[$field_type]['use_li']) {
if (isset($field_row['fav_id']) && $field_row['fav_id'] != 0) {
$fav_id = $field_row['fav_id'];
$fav_row = ninja_forms_get_fav_by_id($fav_id);
if (empty($fav_row['name'])) {
$args = array('update_array' => array('fav_id' => ''), 'where' => array('id' => $field_id));
ninja_forms_update_field($args);
$fav_id = '';
}
} else {
$fav_id = '';
}
if (isset($field_row['def_id']) && $field_row['def_id'] != 0) {
$def_id = $field_row['def_id'];
} else {
$def_id = '';
}
$form_id = $field_row['form_id'];
if (isset($ninja_forms_fields[$field_type])) {
$reg_field = $ninja_forms_fields[$field_type];
$type_name = $reg_field['name'];
$edit_function = $reg_field['edit_function'];
$edit_options = $reg_field['edit_options'];
$li_class = $reg_field['li_class'];
if ($reg_field['nesting']) {
$nesting_class = 'ninja-forms-nest';
} else {
$nesting_class = 'ninja-forms-no-nest';
}
$conditional = $reg_field['conditional'];
$type_class = $field_type . '-li';
if ($def_id != 0 && $def_id != '') {
$def_row = ninja_forms_get_def_by_id($def_id);
if (!empty($def_row['name'])) {
$type_name = $def_row['name'];
}
}
if ($fav_id != 0 && $fav_id != '') {
$fav_row = ninja_forms_get_fav_by_id($fav_id);
if (!empty($fav_row['name'])) {
$fav_class = 'ninja-forms-field-remove-fav';
$type_name = $fav_row['name'];
}
} else {
$fav_class = 'ninja-forms-field-add-fav';
}
if (isset($field_data['label']) && $field_data['label'] != '') {
$li_label = $field_data['label'];
} else {
$li_label = $type_name;
}
$li_label = apply_filters('ninja_forms_edit_field_li_label', $li_label, $field_id);
$li_label = stripslashes($li_label);
$li_label = ninja_forms_esc_html_deep($li_label);
if (isset($reg_field) && isset($reg_field['conditional']) && isset($reg_field['conditional']['value']) && isset($reg_field['conditional']['value']['type'])) {
$conditional_value_type = $reg_field['conditional']['value']['type'];
} else {
$conditional_value_type = '';
}
?>
<li id="ninja_forms_field_<?php
echo $field_id;
?>
" class="<?php
echo $li_class;
?>
<?php
echo $nesting_class;
?>
<?php
echo $type_class;
?>
">
<input type="hidden" id="ninja_forms_field_<?php
echo $field_id;
?>
_conditional_value_type" value="<?php
echo $conditional_value_type;
?>
">
<input type="hidden" id="ninja_forms_field_<?php
echo $field_id;
?>
_fav_id" name="" class="ninja-forms-field-fav-id" value="<?php
echo $fav_id;
?>
">
//.........这里部分代码省略.........
示例8: export_listen
/**
* Listen for exporting subs
*
* @access public
* @since 2.7.3
* @return void
*/
public function export_listen()
{
// Bail if we aren't in the admin
if (!is_admin()) {
return false;
}
if (!isset($_REQUEST['form_id']) || empty($_REQUEST['form_id'])) {
return false;
}
if (isset($_REQUEST['export_single']) && !empty($_REQUEST['export_single'])) {
Ninja_Forms()->sub(esc_html($_REQUEST['export_single']))->export();
}
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'export' || isset($_REQUEST['action2']) && $_REQUEST['action2'] == 'export') {
Ninja_Forms()->subs()->export(ninja_forms_esc_html_deep($_REQUEST['post']));
}
if (isset($_REQUEST['download_file']) && !empty($_REQUEST['download_file'])) {
// Open our download all file
$filename = esc_html($_REQUEST['download_file']);
$upload_dir = wp_upload_dir();
$file_path = trailingslashit($upload_dir['path']) . $filename . '.csv';
if (file_exists($file_path)) {
$myfile = file_get_contents($file_path);
} else {
$redirect = esc_url_raw(remove_query_arg(array('download_file', 'download_all')));
wp_redirect($redirect);
die;
}
unlink($file_path);
$form_name = Ninja_Forms()->form(absint($_REQUEST['form_id']))->get_setting('form_title');
$form_name = sanitize_title($form_name);
$today = date('Y-m-d', current_time('timestamp'));
$filename = apply_filters('nf_download_all_filename', $form_name . '-all-subs-' . $today);
header('Content-type: application/csv');
header('Content-Disposition: attachment; filename="' . $filename . '.csv"');
header('Pragma: no-cache');
header('Expires: 0');
echo $myfile;
die;
}
}
示例9: ninja_forms_edit_field_el_output
function ninja_forms_edit_field_el_output($field_id, $type, $label = '', $name = '', $value = '', $width = 'wide', $options = '', $class = '', $desc = '', $label_class = '')
{
global $ninja_forms_fields, $nf_rte_editors;
$field_row = ninja_forms_get_field_by_id($field_id);
$field_type = $field_row['type'];
$reg_field = $ninja_forms_fields[$field_type];
$class = 'code ninja-forms-' . $field_type . '-' . $name . ' ' . $class;
$id = 'ninja_forms_field_' . $field_id . '_' . $name;
if (strpos($name, '[') !== false) {
str_replace(']', '', $name);
$name = explode('[', $name);
if (is_array($name)) {
$tmp_name = 'ninja_forms_field_' . $field_id;
foreach ($name as $n) {
$tmp_name .= '[' . $n . ']';
}
$name = $tmp_name;
} else {
$name = 'ninja_forms_field_' . $field_id . '[' . $name . ']';
}
} else {
$name = 'ninja_forms_field_' . $field_id . '[' . $name . ']';
}
?>
<div class="description description-<?php
echo $width;
?>
<?php
echo $type;
?>
" id="<?php
echo $name;
?>
_p">
<?php
if ($type != 'rte') {
$value = ninja_forms_esc_html_deep($value);
?>
<span class="field-option">
<?php
}
if ($type != 'checkbox' and $type != 'desc') {
?>
<label for="<?php
echo $id;
?>
" id="<?php
echo $id;
?>
_label" class="<?php
echo $label_class;
?>
">
<?php
_e($label, 'ninja-forms');
?>
</label><br/>
<?php
}
switch ($type) {
case 'text':
?>
<input type="text" class="<?php
echo $class;
?>
" name="<?php
echo $name;
?>
" id="<?php
echo $id;
?>
" value="<?php
echo $value;
?>
" />
<?php
break;
case 'number':
?>
<input type="number" class="<?php
echo $class;
?>
" name="<?php
echo $name;
?>
" id="<?php
echo $id;
?>
" value="<?php
echo $value;
?>
" />
<?php
break;
case 'checkbox':
?>
<label for="<?php
echo $id;
?>
" id="<?php
//.........这里部分代码省略.........
示例10: ninja_forms_edit_field_output_li
function ninja_forms_edit_field_output_li($field_id)
{
global $wpdb, $ninja_forms_fields, $nf_rte_editors;
$field_row = ninja_forms_get_field_by_id($field_id);
$current_tab = ninja_forms_get_current_tab();
if (isset($_REQUEST['page'])) {
$current_page = esc_html($_REQUEST['page']);
} else {
$current_page = '';
}
$field_type = $field_row['type'];
$field_data = $field_row['data'];
$plugin_settings = nf_get_settings();
if (isset($ninja_forms_fields[$field_type]['use_li']) and $ninja_forms_fields[$field_type]['use_li']) {
if (isset($field_row['fav_id']) and $field_row['fav_id'] != 0) {
$fav_id = $field_row['fav_id'];
$fav_row = ninja_forms_get_fav_by_id($fav_id);
if (empty($fav_row['name'])) {
$args = array('update_array' => array('fav_id' => ''), 'where' => array('id' => $field_id));
ninja_forms_update_field($args);
$fav_id = '';
}
} else {
$fav_id = '';
}
if (isset($field_row['def_id']) and $field_row['def_id'] != 0) {
$def_id = $field_row['def_id'];
} else {
$def_id = '';
}
$form_id = $field_row['form_id'];
$field_results = ninja_forms_get_fields_by_form_id($form_id);
if (isset($ninja_forms_fields[$field_type])) {
$reg_field = $ninja_forms_fields[$field_type];
$type_name = $reg_field['name'];
$edit_function = $reg_field['edit_function'];
$edit_options = $reg_field['edit_options'];
if ($reg_field['nesting']) {
$nesting_class = 'ninja-forms-nest';
} else {
$nesting_class = 'ninja-forms-no-nest';
}
$conditional = $reg_field['conditional'];
$type_class = $field_type . '-li';
if ($def_id != 0 and $def_id != '') {
$def_row = ninja_forms_get_def_by_id($def_id);
if (!empty($def_row['name'])) {
$type_name = $def_row['name'];
}
}
if ($fav_id != 0 and $fav_id != '') {
$fav_row = ninja_forms_get_fav_by_id($fav_id);
if (!empty($fav_row['name'])) {
$fav_class = 'ninja-forms-field-remove-fav';
$type_name = $fav_row['name'];
}
} else {
$fav_class = 'ninja-forms-field-add-fav';
}
if (isset($field_data['label']) and $field_data['label'] != '') {
$li_label = $field_data['label'];
} else {
$li_label = $type_name;
}
$li_label = apply_filters('ninja_forms_edit_field_li_label', $li_label, $field_id);
$li_label = stripslashes($li_label);
$li_label = ninja_forms_esc_html_deep($li_label);
if (isset($reg_field) && isset($reg_field['conditional']) && isset($reg_field['conditional']['value']) && isset($reg_field['conditional']['value']['type'])) {
$conditional_value_type = $reg_field['conditional']['value']['type'];
} else {
$conditional_value_type = '';
}
?>
<li id="ninja_forms_field_<?php
echo $field_id;
?>
" class="<?php
echo $nesting_class;
?>
<?php
echo $type_class;
?>
">
<input type="hidden" id="ninja_forms_field_<?php
echo $field_id;
?>
_conditional_value_type" value="<?php
echo $conditional_value_type;
?>
">
<input type="hidden" id="ninja_forms_field_<?php
echo $field_id;
?>
_fav_id" name="" class="ninja-forms-field-fav-id" value="<?php
echo $fav_id;
?>
">
<dl class="menu-item-bar">
<dt class="menu-item-handle" id="ninja_forms_metabox_field_<?php
echo $field_id;
//.........这里部分代码省略.........
示例11: ninja_forms_side_sortable
function ninja_forms_side_sortable()
{
// Bail if we aren't in the admin
if (!is_admin()) {
return false;
}
check_ajax_referer('nf_ajax', 'nf_ajax_nonce');
$plugin_settings = nf_get_settings();
$page = esc_html($_REQUEST['page']);
$tab = esc_html($_REQUEST['tab']);
$order = ninja_forms_esc_html_deep($_REQUEST['order']);
$plugin_settings['sidebars'][$page][$tab] = $order;
update_option('ninja_forms_settings', $plugin_settings);
die;
}
示例12: ninja_forms_save_view_subs
function ninja_forms_save_view_subs($form_id, $data = array())
{
global $ninja_forms_admin_update_message;
$plugin_settings = get_option("ninja_forms_settings");
if (isset($_POST['submit']) and $_REQUEST['page'] == 'ninja-forms-subs') {
switch ($_POST['submit']) {
case __('Apply', 'ninja-forms'):
if (isset($_POST['bulk_action'])) {
if ($_POST['bulk_action'] == 'delete') {
if (isset($_POST['ninja_forms_sub']) and is_array($_POST['ninja_forms_sub']) and !empty($_POST['ninja_forms_sub'])) {
$subs = ninja_forms_esc_html_deep($_POST['ninja_forms_sub']);
foreach ($subs as $sub_id) {
ninja_forms_delete_sub($sub_id);
}
$ninja_forms_admin_update_message = count($_POST['ninja_forms_sub']) . ' ';
if (count($_POST['ninja_forms_sub']) > 1) {
$ninja_forms_admin_update_message .= __('Submissions Deleted', 'ninja-forms');
} else {
$ninja_forms_admin_update_message .= __('Submission Deleted', 'ninja-forms');
}
}
} elseif ($_POST['bulk_action'] == 'export') {
if (isset($_POST['ninja_forms_sub']) and is_array($_POST['ninja_forms_sub']) and !empty($_POST['ninja_forms_sub'])) {
$subs = ninja_forms_esc_html_deep($_POST['ninja_forms_sub']);
ninja_forms_export_subs_to_csv($subs);
}
}
}
break;
case __('Download All Submissions', 'ninja-forms'):
if (isset($plugin_settings['date_format']) and $plugin_settings['date_format'] != '') {
$date_format = $plugin_settings['date_format'];
} else {
$date_format = 'm/d/Y';
}
if (isset($_REQUEST['form_id']) and !empty($_REQUEST['form_id'])) {
$form_id = absint($_REQUEST['form_id']);
} else {
$form_id = '';
}
if (isset($_REQUEST['ninja_forms_begin_date']) and !empty($_REQUEST['ninja_forms_begin_date'])) {
$begin_date = esc_html($_REQUEST['ninja_forms_begin_date']);
} else {
$begin_date = '';
}
if (isset($_REQUEST['ninja_forms_end_date']) and !empty($_REQUEST['ninja_forms_end_date'])) {
$end_date = esc_html($_REQUEST['ninja_forms_end_date']);
} else {
$end_date = '';
}
$args = array('form_id' => $form_id, 'begin_date' => $begin_date, 'end_date' => $end_date);
$sub_results = ninja_forms_get_subs($args);
$sub_results = apply_filters('ninja_forms_download_all_subs_results', $sub_results);
if (is_array($sub_results) and !empty($sub_results)) {
$sub_ids = array();
foreach ($sub_results as $sub) {
$sub_ids[] = $sub['id'];
}
ninja_forms_export_subs_to_csv($sub_ids);
}
break;
case __('Save Sub', 'ninja-forms'):
break;
case __('View Submissions', 'ninja-forms'):
break;
}
}
}
示例13: ninja_forms_side_sortable
function ninja_forms_side_sortable()
{
$plugin_settings = get_option('ninja_forms_settings');
$page = esc_html($_REQUEST['page']);
$tab = esc_html($_REQUEST['tab']);
$order = ninja_forms_esc_html_deep($_REQUEST['order']);
$plugin_settings['sidebars'][$page][$tab] = $order;
update_option('ninja_forms_settings', $plugin_settings);
die;
}