Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../deprecat.../includes/admin
File: scripts.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
//Load up our WP Ninja Custom Form JS files.
[1] Fix | Delete
function ninja_forms_admin_css(){
[2] Fix | Delete
$plugin_settings = nf_get_settings();
[3] Fix | Delete
[4] Fix | Delete
wp_enqueue_style( 'jquery-smoothness', NINJA_FORMS_URL .'css/smoothness/jquery-smoothness.css' );
[5] Fix | Delete
wp_enqueue_style( 'ninja-forms-admin', NINJA_FORMS_URL .'css/ninja-forms-admin.css?nf_ver=' . NF_PLUGIN_VERSION );
[6] Fix | Delete
wp_enqueue_style( 'nf-admin-modal', NINJA_FORMS_URL .'assets/css/admin-modal.css?nf_ver=' . NF_PLUGIN_VERSION );
[7] Fix | Delete
[8] Fix | Delete
add_filter('admin_body_class', 'ninja_forms_add_class');
[9] Fix | Delete
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
function ninja_forms_add_class($classes) {
[13] Fix | Delete
// add 'class-name' to the $classes array
[14] Fix | Delete
$classes .= ' nav-menus-php';
[15] Fix | Delete
// return the $classes array
[16] Fix | Delete
return $classes;
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
function ninja_forms_admin_js(){
[20] Fix | Delete
global $version_compare, $public_query_vars;
[21] Fix | Delete
[22] Fix | Delete
$form_id = isset ( $_REQUEST['form_id'] ) ? absint( $_REQUEST['form_id'] ) : '';
[23] Fix | Delete
[24] Fix | Delete
if ( defined( 'NINJA_FORMS_JS_DEBUG' ) && NINJA_FORMS_JS_DEBUG ) {
[25] Fix | Delete
$suffix = '';
[26] Fix | Delete
$src = 'dev';
[27] Fix | Delete
} else {
[28] Fix | Delete
$suffix = '.min';
[29] Fix | Delete
$src = 'min';
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
$plugin_settings = nf_get_settings();
[33] Fix | Delete
if(isset($plugin_settings['date_format'])){
[34] Fix | Delete
$date_format = $plugin_settings['date_format'];
[35] Fix | Delete
}else{
[36] Fix | Delete
$date_format = 'm/d/Y';
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
$date_format = ninja_forms_date_to_datepicker($date_format);
[40] Fix | Delete
[41] Fix | Delete
$datepicker_args = array();
[42] Fix | Delete
if ( !empty( $date_format ) ) {
[43] Fix | Delete
$datepicker_args['dateFormat'] = $date_format;
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
wp_enqueue_script('ninja-forms-admin',
[47] Fix | Delete
NINJA_FORMS_URL . 'js/' . $src .'/ninja-forms-admin' . $suffix . '.js?nf_ver=' . NF_PLUGIN_VERSION,
[48] Fix | Delete
array('jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'nf-admin-modal' ) );
[49] Fix | Delete
[50] Fix | Delete
wp_localize_script( 'ninja-forms-admin', 'ninja_forms_settings', array( 'nf_ajax_nonce' => wp_create_nonce( 'nf_ajax'), 'form_id' => $form_id, 'datepicker_args' => apply_filters( 'ninja_forms_admin_forms_datepicker_args', $datepicker_args ), 'add_fav_prompt' => __( 'What would you like to name this favorite?', 'ninja-forms' ), 'add_fav_error' => __( 'You must supply a name for this favorite.', 'ninja-forms' ), 'deactivate_all_licenses_confirm' => __( 'Really deactivate all licenses?', 'ninja-forms' ) ) );
[51] Fix | Delete
wp_localize_script( 'ninja-forms-admin', 'nf_conversion_title', __( 'Reset the form conversion process for v2.9+', 'ninja-forms' ) );
[52] Fix | Delete
wp_localize_script( 'ninja-forms-admin', 'nf_nuke_title', __( 'Remove ALL Ninja Forms data upon uninstall?', 'ninja-forms' ) );
[53] Fix | Delete
[54] Fix | Delete
[55] Fix | Delete
if ( isset ( $_REQUEST['page'] ) && $_REQUEST['page'] == 'ninja-forms' && isset ( $_REQUEST['tab'] ) ) {
[56] Fix | Delete
wp_enqueue_script( 'nf-builder',
[57] Fix | Delete
NINJA_FORMS_URL . 'assets/js/' . $src .'/builder' . $suffix . '.js?nf_ver=' . NF_PLUGIN_VERSION,
[58] Fix | Delete
array( 'backbone' ) );
[59] Fix | Delete
[60] Fix | Delete
if ( '' != $form_id ) {
[61] Fix | Delete
$fields = Ninja_Forms()->form( $form_id )->fields;
[62] Fix | Delete
[63] Fix | Delete
$current_tab = ninja_forms_get_current_tab();
[64] Fix | Delete
$current_page = isset ( $_REQUEST['page'] ) ? esc_html( $_REQUEST['page'] ) : '';
[65] Fix | Delete
[66] Fix | Delete
foreach ( $fields as $field_id => $field ) {
[67] Fix | Delete
$fields[ $field_id ]['metabox_state'] = 0;
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
$form_status = Ninja_Forms()->form( $form_id )->get_setting( 'status' );
[71] Fix | Delete
$form_title = Ninja_Forms()->form( $form_id )->get_setting( 'form_title' );
[72] Fix | Delete
[73] Fix | Delete
wp_localize_script( 'nf-builder', 'nf_admin', array( 'edit_form_text' => __( 'Edit Form', 'ninja-forms' ), 'form_title' => $form_title, 'form_status' => $form_status, 'fields' => $fields, 'saved_text' => __( 'Saved', 'ninja-forms' ), 'save_text' => __( 'Save', 'ninja-forms' ), 'saving_text' => __( 'Saving...', 'ninja-forms' ), 'remove_field' => __( 'Remove this field? It will be removed even if you do not save.', 'ninja-forms' ) ) );
[74] Fix | Delete
[75] Fix | Delete
$reserved_terms = array(
[76] Fix | Delete
'attachment',
[77] Fix | Delete
'attachment_id',
[78] Fix | Delete
'author',
[79] Fix | Delete
'author_name',
[80] Fix | Delete
'calendar',
[81] Fix | Delete
'cat',
[82] Fix | Delete
'category',
[83] Fix | Delete
'category__and',
[84] Fix | Delete
'category__in',
[85] Fix | Delete
'category__not_in',
[86] Fix | Delete
'category_name',
[87] Fix | Delete
'comments_per_page',
[88] Fix | Delete
'comments_popup',
[89] Fix | Delete
'customize_messenger_channel',
[90] Fix | Delete
'customized',
[91] Fix | Delete
'cpage',
[92] Fix | Delete
'day',
[93] Fix | Delete
'debug',
[94] Fix | Delete
'error',
[95] Fix | Delete
'exact',
[96] Fix | Delete
'feed',
[97] Fix | Delete
'hour',
[98] Fix | Delete
'link_category',
[99] Fix | Delete
'm',
[100] Fix | Delete
'minute',
[101] Fix | Delete
'monthnum',
[102] Fix | Delete
'more',
[103] Fix | Delete
'name',
[104] Fix | Delete
'nav_menu',
[105] Fix | Delete
'nonce',
[106] Fix | Delete
'nopaging',
[107] Fix | Delete
'offset',
[108] Fix | Delete
'order',
[109] Fix | Delete
'orderby',
[110] Fix | Delete
'p',
[111] Fix | Delete
'page',
[112] Fix | Delete
'page_id',
[113] Fix | Delete
'paged',
[114] Fix | Delete
'pagename',
[115] Fix | Delete
'pb',
[116] Fix | Delete
'perm',
[117] Fix | Delete
'post',
[118] Fix | Delete
'post__in',
[119] Fix | Delete
'post__not_in',
[120] Fix | Delete
'post_format',
[121] Fix | Delete
'post_mime_type',
[122] Fix | Delete
'post_status',
[123] Fix | Delete
'post_tag',
[124] Fix | Delete
'post_type',
[125] Fix | Delete
'posts',
[126] Fix | Delete
'posts_per_archive_page',
[127] Fix | Delete
'posts_per_page',
[128] Fix | Delete
'preview',
[129] Fix | Delete
'robots',
[130] Fix | Delete
's',
[131] Fix | Delete
'search',
[132] Fix | Delete
'second',
[133] Fix | Delete
'sentence',
[134] Fix | Delete
'showposts',
[135] Fix | Delete
'static',
[136] Fix | Delete
'subpost',
[137] Fix | Delete
'subpost_id',
[138] Fix | Delete
'tag',
[139] Fix | Delete
'tag__and',
[140] Fix | Delete
'tag__in',
[141] Fix | Delete
'tag__not_in',
[142] Fix | Delete
'tag_id',
[143] Fix | Delete
'tag_slug__and',
[144] Fix | Delete
'tag_slug__in',
[145] Fix | Delete
'taxonomy',
[146] Fix | Delete
'tb',
[147] Fix | Delete
'term',
[148] Fix | Delete
'theme',
[149] Fix | Delete
'type',
[150] Fix | Delete
'w',
[151] Fix | Delete
'withcomments',
[152] Fix | Delete
'withoutcomments',
[153] Fix | Delete
'year',
[154] Fix | Delete
);
[155] Fix | Delete
[156] Fix | Delete
wp_localize_script( 'nf-builder', 'wp_reserved_terms', $reserved_terms );
[157] Fix | Delete
}
[158] Fix | Delete
}
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function