Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../includes/admin
File: admin.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Global admin related items and functionality.
[2] Fix | Delete
*
[3] Fix | Delete
* @since 1.3.9
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[7] Fix | Delete
exit;
[8] Fix | Delete
}
[9] Fix | Delete
[10] Fix | Delete
use WPForms\Admin\Notice;
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Load styles for all WPForms-related admin screens.
[14] Fix | Delete
*
[15] Fix | Delete
* @since 1.3.9
[16] Fix | Delete
*/
[17] Fix | Delete
function wpforms_admin_styles() {
[18] Fix | Delete
[19] Fix | Delete
if ( ! wpforms_is_admin_page() ) {
[20] Fix | Delete
return;
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
$min = wpforms_get_min_suffix();
[24] Fix | Delete
[25] Fix | Delete
// jQuery.Confirm Reloaded.
[26] Fix | Delete
wp_enqueue_style(
[27] Fix | Delete
'jquery-confirm',
[28] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/jquery.confirm/jquery-confirm.min.css',
[29] Fix | Delete
[],
[30] Fix | Delete
'1.0.0'
[31] Fix | Delete
);
[32] Fix | Delete
[33] Fix | Delete
// Minicolors (color picker).
[34] Fix | Delete
wp_enqueue_style(
[35] Fix | Delete
'minicolors',
[36] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/jquery.minicolors/jquery.minicolors.min.css',
[37] Fix | Delete
[],
[38] Fix | Delete
'2.3.6'
[39] Fix | Delete
);
[40] Fix | Delete
[41] Fix | Delete
// FontAwesome.
[42] Fix | Delete
wp_enqueue_style(
[43] Fix | Delete
'wpforms-font-awesome',
[44] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/font-awesome/font-awesome.min.css',
[45] Fix | Delete
null,
[46] Fix | Delete
'4.7.0'
[47] Fix | Delete
);
[48] Fix | Delete
[49] Fix | Delete
// Main admin styles.
[50] Fix | Delete
wp_enqueue_style(
[51] Fix | Delete
'wpforms-admin',
[52] Fix | Delete
WPFORMS_PLUGIN_URL . "assets/css/admin{$min}.css",
[53] Fix | Delete
[],
[54] Fix | Delete
WPFORMS_VERSION
[55] Fix | Delete
);
[56] Fix | Delete
[57] Fix | Delete
wp_enqueue_style(
[58] Fix | Delete
'wpforms-multiselect-checkboxes',
[59] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/wpforms-multiselect/wpforms-multiselect-checkboxes.min.css',
[60] Fix | Delete
[],
[61] Fix | Delete
'1.0.0'
[62] Fix | Delete
);
[63] Fix | Delete
[64] Fix | Delete
// Remove TinyMCE editor styles from third-party themes and plugins.
[65] Fix | Delete
remove_editor_styles();
[66] Fix | Delete
[67] Fix | Delete
// WordPress 5.7 color set.
[68] Fix | Delete
if ( version_compare( get_bloginfo( 'version' ), '5.7', '>=' ) ) {
[69] Fix | Delete
wp_enqueue_style(
[70] Fix | Delete
'wpforms-admin-wp5.7-color',
[71] Fix | Delete
WPFORMS_PLUGIN_URL . "assets/css/admin-wp5.7-colors{$min}.css",
[72] Fix | Delete
[ 'wpforms-admin' ],
[73] Fix | Delete
WPFORMS_VERSION
[74] Fix | Delete
);
[75] Fix | Delete
}
[76] Fix | Delete
}
[77] Fix | Delete
add_action( 'admin_enqueue_scripts', 'wpforms_admin_styles', 5 );
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* Load scripts for all WPForms-related admin screens.
[81] Fix | Delete
*
[82] Fix | Delete
* @since 1.3.9
[83] Fix | Delete
*/
[84] Fix | Delete
function wpforms_admin_scripts() {
[85] Fix | Delete
[86] Fix | Delete
if ( ! wpforms_is_admin_page() ) {
[87] Fix | Delete
return;
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
$min = wpforms_get_min_suffix();
[91] Fix | Delete
[92] Fix | Delete
wp_enqueue_media();
[93] Fix | Delete
[94] Fix | Delete
// jQuery.Confirm Reloaded.
[95] Fix | Delete
wp_enqueue_script(
[96] Fix | Delete
'jquery-confirm',
[97] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/jquery.confirm/jquery-confirm.min.js',
[98] Fix | Delete
[ 'jquery' ],
[99] Fix | Delete
'1.0.0',
[100] Fix | Delete
false
[101] Fix | Delete
);
[102] Fix | Delete
[103] Fix | Delete
// Minicolors (color picker).
[104] Fix | Delete
wp_enqueue_script(
[105] Fix | Delete
'minicolors',
[106] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/jquery.minicolors/jquery.minicolors.min.js',
[107] Fix | Delete
[ 'jquery' ],
[108] Fix | Delete
'2.3.6',
[109] Fix | Delete
false
[110] Fix | Delete
);
[111] Fix | Delete
[112] Fix | Delete
// Choices.js.
[113] Fix | Delete
wp_enqueue_script(
[114] Fix | Delete
'choicesjs',
[115] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/choices.min.js',
[116] Fix | Delete
[],
[117] Fix | Delete
'10.2.0',
[118] Fix | Delete
false
[119] Fix | Delete
);
[120] Fix | Delete
[121] Fix | Delete
// jQuery Conditionals.
[122] Fix | Delete
wp_enqueue_script(
[123] Fix | Delete
'jquery-conditionals',
[124] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/jquery.conditionals.min.js',
[125] Fix | Delete
[ 'jquery' ],
[126] Fix | Delete
'1.0.1',
[127] Fix | Delete
false
[128] Fix | Delete
);
[129] Fix | Delete
[130] Fix | Delete
wp_enqueue_script(
[131] Fix | Delete
'wpforms-generic-utils',
[132] Fix | Delete
WPFORMS_PLUGIN_URL . "assets/js/share/utils{$min}.js",
[133] Fix | Delete
[ 'jquery' ],
[134] Fix | Delete
WPFORMS_VERSION,
[135] Fix | Delete
true
[136] Fix | Delete
);
[137] Fix | Delete
[138] Fix | Delete
// Load admin utils JS.
[139] Fix | Delete
wp_enqueue_script(
[140] Fix | Delete
'wpforms-admin-utils',
[141] Fix | Delete
WPFORMS_PLUGIN_URL . "assets/js/admin/share/admin-utils{$min}.js",
[142] Fix | Delete
[ 'jquery' ],
[143] Fix | Delete
WPFORMS_VERSION,
[144] Fix | Delete
true
[145] Fix | Delete
);
[146] Fix | Delete
[147] Fix | Delete
// Main admin script.
[148] Fix | Delete
wp_enqueue_script(
[149] Fix | Delete
'wpforms-admin',
[150] Fix | Delete
WPFORMS_PLUGIN_URL . "assets/js/admin/admin{$min}.js",
[151] Fix | Delete
[ 'jquery' ],
[152] Fix | Delete
WPFORMS_VERSION,
[153] Fix | Delete
false
[154] Fix | Delete
);
[155] Fix | Delete
[156] Fix | Delete
wp_enqueue_script(
[157] Fix | Delete
'wpforms-multiselect-checkboxes',
[158] Fix | Delete
WPFORMS_PLUGIN_URL . 'assets/lib/wpforms-multiselect/wpforms-multiselect-checkboxes.min.js',
[159] Fix | Delete
[],
[160] Fix | Delete
WPFORMS_VERSION,
[161] Fix | Delete
true
[162] Fix | Delete
);
[163] Fix | Delete
[164] Fix | Delete
$default_choicesjs_loading_text = esc_html__( 'Loading...', 'wpforms-lite' );
[165] Fix | Delete
$default_choicesjs_no_results_text = esc_html__( 'No results found', 'wpforms-lite' );
[166] Fix | Delete
$default_choicesjs_no_choices_text = esc_html__( 'No choices to choose from', 'wpforms-lite' );
[167] Fix | Delete
[168] Fix | Delete
$image_extensions = wpforms_chain( get_allowed_mime_types() )
[169] Fix | Delete
->map(
[170] Fix | Delete
static function ( $mime ) {
[171] Fix | Delete
[172] Fix | Delete
return strpos( $mime, 'image/' ) === 0 ? $mime : '';
[173] Fix | Delete
}
[174] Fix | Delete
)
[175] Fix | Delete
->array_filter()
[176] Fix | Delete
->array_values()
[177] Fix | Delete
->value();
[178] Fix | Delete
[179] Fix | Delete
$strings = [
[180] Fix | Delete
'addon_activate' => esc_html__( 'Activate', 'wpforms-lite' ),
[181] Fix | Delete
'addon_activated' => esc_html__( 'Activated', 'wpforms-lite' ),
[182] Fix | Delete
'addon_active' => esc_html__( 'Active', 'wpforms-lite' ),
[183] Fix | Delete
'addon_deactivate' => esc_html__( 'Deactivate', 'wpforms-lite' ),
[184] Fix | Delete
'addon_inactive' => esc_html__( 'Inactive', 'wpforms-lite' ),
[185] Fix | Delete
'addon_install' => esc_html__( 'Install Addon', 'wpforms-lite' ),
[186] Fix | Delete
'addon_error' => sprintf(
[187] Fix | Delete
wp_kses( /* translators: %1$s - addon download URL, %2$s - link to manual installation guide, %3$s - link to contact support. */
[188] Fix | Delete
__( 'Could not install the addon. Please <a href="%1$s" target="_blank" rel="noopener noreferrer">download it from wpforms.com</a> and <a href="%2$s" target="_blank" rel="noopener noreferrer">install it manually</a>, or <a href="%3$s" target="_blank" rel="noopener noreferrer">contact support</a> for assistance.', 'wpforms-lite' ),
[189] Fix | Delete
[
[190] Fix | Delete
'a' => [
[191] Fix | Delete
'href' => true,
[192] Fix | Delete
'target' => true,
[193] Fix | Delete
'rel' => true,
[194] Fix | Delete
],
[195] Fix | Delete
]
[196] Fix | Delete
),
[197] Fix | Delete
esc_url( wpforms_utm_link( 'https://wpforms.com/account/licenses/', 'Licenses', 'Addons Error' ) ),
[198] Fix | Delete
esc_url( wpforms_utm_link( 'https://wpforms.com/docs/how-to-manually-install-addons-in-wpforms/', 'Addons Doc', 'Addons Error' ) ),
[199] Fix | Delete
esc_url( wpforms_utm_link( 'https://wpforms.com/contact/', 'Contact', 'Addons Error' ) )
[200] Fix | Delete
),
[201] Fix | Delete
'plugin_error' => esc_html__( 'Could not install the plugin automatically. Please download and install it manually.', 'wpforms-lite' ),
[202] Fix | Delete
'addon_search' => esc_html__( 'Searching Addons', 'wpforms-lite' ),
[203] Fix | Delete
'ajax_url' => admin_url( 'admin-ajax.php' ),
[204] Fix | Delete
'cancel' => esc_html__( 'Cancel', 'wpforms-lite' ),
[205] Fix | Delete
'continue' => esc_html__( 'Continue', 'wpforms-lite' ),
[206] Fix | Delete
'close' => esc_html__( 'Close', 'wpforms-lite' ),
[207] Fix | Delete
'close_refresh' => esc_html__( 'Close and Refresh', 'wpforms-lite' ),
[208] Fix | Delete
'column_selector_title' => esc_html__( 'Change columns to display', 'wpforms-lite' ),
[209] Fix | Delete
'column_selector_no_fields' => esc_html__( 'Sorry, there are no form fields that match your criteria.', 'wpforms-lite' ),
[210] Fix | Delete
'column_selector_no_meta' => esc_html__( 'Sorry, there is no entry meta that match your criteria.', 'wpforms-lite' ),
[211] Fix | Delete
'entry_delete_confirm' => esc_html__( 'Are you sure you want to delete this entry? This will also remove all associated files, notes, and logs.', 'wpforms-lite' ),
[212] Fix | Delete
'entry_delete_all_confirm' => esc_html__( 'Are you sure you want to delete ALL entries? This will also remove all associated files, notes, and logs.', 'wpforms-lite' ),
[213] Fix | Delete
'entry_delete_n_confirm' => sprintf( /* translators: %s - entry count. */
[214] Fix | Delete
esc_html__( 'Are you sure you want to delete %s entries? This will also remove all associated files, notes, and logs.', 'wpforms-lite' ),
[215] Fix | Delete
'{entry_count}'
[216] Fix | Delete
),
[217] Fix | Delete
'entry_trash_confirm' => esc_html__( 'Are you sure you want to trash this entry? This will also remove all associated files, notes, and logs.', 'wpforms-lite' ),
[218] Fix | Delete
'entry_trash_all_confirm' => esc_html__( 'Are you sure you want to trash ALL entries? This will also remove all associated files, notes, and logs.', 'wpforms-lite' ),
[219] Fix | Delete
'entry_trash_n_confirm' => sprintf( /* translators: %s - entry count. */
[220] Fix | Delete
esc_html__( 'Are you sure you want to trash %s entries? This will also remove all associated files, notes, and logs.', 'wpforms-lite' ),
[221] Fix | Delete
'{entry_count}'
[222] Fix | Delete
),
[223] Fix | Delete
'entry_empty_fields_hide' => esc_html__( 'Hide Empty Fields', 'wpforms-lite' ),
[224] Fix | Delete
'entry_empty_fields_show' => esc_html__( 'Show Empty Fields', 'wpforms-lite' ),
[225] Fix | Delete
'entry_note_delete_confirm' => esc_html__( 'Are you sure you want to delete this note?', 'wpforms-lite' ),
[226] Fix | Delete
'entry_unstar' => esc_html__( 'Unstar entry', 'wpforms-lite' ),
[227] Fix | Delete
'entry_star' => esc_html__( 'Star entry', 'wpforms-lite' ),
[228] Fix | Delete
'entry_read' => esc_html__( 'Mark entry read', 'wpforms-lite' ),
[229] Fix | Delete
'entry_unread' => esc_html__( 'Mark entry unread', 'wpforms-lite' ),
[230] Fix | Delete
'form_delete_confirm' => esc_html__( 'Are you sure you want to delete this form and all its entries?', 'wpforms-lite' ),
[231] Fix | Delete
'form_delete_n_confirm' => esc_html__( 'Are you sure you want to delete the selected forms and all their entries?', 'wpforms-lite' ),
[232] Fix | Delete
'form_delete_all_confirm' => esc_html__( 'Are you sure you want to delete ALL the forms in the trash and all their entries?', 'wpforms-lite' ),
[233] Fix | Delete
'form_duplicate_confirm' => esc_html__( 'Are you sure you want to duplicate this form?', 'wpforms-lite' ),
[234] Fix | Delete
'template_duplicate_confirm' => esc_html__( 'Are you sure you want to duplicate this template?', 'wpforms-lite' ),
[235] Fix | Delete
'heads_up' => esc_html__( 'Heads up!', 'wpforms-lite' ),
[236] Fix | Delete
'importer_forms_required' => esc_html__( 'Please select at least one form to import.', 'wpforms-lite' ),
[237] Fix | Delete
'isPro' => wpforms()->is_pro(),
[238] Fix | Delete
'nonce' => wp_create_nonce( 'wpforms-admin' ),
[239] Fix | Delete
'almost_done' => esc_html__( 'Almost Done', 'wpforms-lite' ),
[240] Fix | Delete
'thanks_for_interest' => esc_html__( 'Thanks for your interest in WPForms Pro!', 'wpforms-lite' ),
[241] Fix | Delete
'oops' => esc_html__( 'Oops!', 'wpforms-lite' ),
[242] Fix | Delete
'uh_oh' => esc_html__( 'Uh oh!', 'wpforms-lite' ),
[243] Fix | Delete
'ok' => esc_html__( 'OK', 'wpforms-lite' ),
[244] Fix | Delete
'plugin_install_activate_btn' => esc_html__( 'Install and Activate', 'wpforms-lite' ),
[245] Fix | Delete
'plugin_install_activate_confirm' => esc_html__( 'needs to be installed and activated to import its forms. Would you like us to install and activate it for you?', 'wpforms-lite' ),
[246] Fix | Delete
'plugin_activate_btn' => esc_html__( 'Activate', 'wpforms-lite' ),
[247] Fix | Delete
'plugin_activate_confirm' => esc_html__( 'needs to be activated to import its forms. Would you like us to activate it for you?', 'wpforms-lite' ),
[248] Fix | Delete
'provider_delete_confirm' => esc_html__( 'Are you sure you want to disconnect this account?', 'wpforms-lite' ),
[249] Fix | Delete
'provider_delete_error' => esc_html__( 'Could not disconnect this account.', 'wpforms-lite' ),
[250] Fix | Delete
'provider_auth_error' => esc_html__( 'Could not authenticate with the provider.', 'wpforms-lite' ),
[251] Fix | Delete
'connecting' => esc_html__( 'Connecting...', 'wpforms-lite' ),
[252] Fix | Delete
'save_refresh' => esc_html__( 'Save and Refresh', 'wpforms-lite' ),
[253] Fix | Delete
'save_changes' => esc_html__( 'Save Changes', 'wpforms-lite' ),
[254] Fix | Delete
'server_error' => esc_html__( 'Unfortunately there was a server connection error.', 'wpforms-lite' ),
[255] Fix | Delete
'unknown_error' => esc_html__( 'Unknown error.', 'wpforms-lite' ),
[256] Fix | Delete
'settings_form_style_base' => sprintf(
[257] Fix | Delete
wp_kses( /* translators: %s - WPForms.com docs page URL. */
[258] Fix | Delete
__( 'You\'ve selected <strong>Base Styling Only</strong>, which may result in styling issues. <a href="%s" target="_blank" rel="noopener noreferrer">Please check out our tutorial</a> for common issues and recommendations.', 'wpforms-lite' ),
[259] Fix | Delete
[
[260] Fix | Delete
'strong' => [],
[261] Fix | Delete
'a' => [
[262] Fix | Delete
'href' => [],
[263] Fix | Delete
'target' => [],
[264] Fix | Delete
'rel' => [],
[265] Fix | Delete
],
[266] Fix | Delete
]
[267] Fix | Delete
),
[268] Fix | Delete
esc_url( wpforms_utm_link( 'https://wpforms.com/docs/how-to-choose-an-include-form-styling-setting/', 'settings-license-modal', 'Base Styling Only' ) )
[269] Fix | Delete
),
[270] Fix | Delete
'settings_form_style_none' => sprintf(
[271] Fix | Delete
wp_kses( /* translators: %s - WPForms.com docs page URL. */
[272] Fix | Delete
__( 'You\'ve selected <strong>No Styling</strong>, which will likely result in significant styling issues and is recommended only for developers. <a href="%s" target="_blank" rel="noopener noreferrer">Please check out our tutorial</a> for more details and recommendations.', 'wpforms-lite' ),
[273] Fix | Delete
[
[274] Fix | Delete
'strong' => [],
[275] Fix | Delete
'a' => [
[276] Fix | Delete
'href' => [],
[277] Fix | Delete
'target' => [],
[278] Fix | Delete
'rel' => [],
[279] Fix | Delete
],
[280] Fix | Delete
]
[281] Fix | Delete
),
[282] Fix | Delete
esc_url( wpforms_utm_link( 'https://wpforms.com/docs/how-to-choose-an-include-form-styling-setting/', 'settings-license-modal', 'No Styling' ) )
[283] Fix | Delete
),
[284] Fix | Delete
'testing' => esc_html__( 'Testing', 'wpforms-lite' ),
[285] Fix | Delete
'upgrade_completed' => esc_html__( 'Upgrade was successfully completed!', 'wpforms-lite' ),
[286] Fix | Delete
'upload_image_title' => esc_html__( 'Upload or Choose Your Image', 'wpforms-lite' ),
[287] Fix | Delete
'upload_image_button' => esc_html__( 'Use Image', 'wpforms-lite' ),
[288] Fix | Delete
'upload_image_extensions' => $image_extensions,
[289] Fix | Delete
'upload_image_extensions_error' => esc_html__( 'You tried uploading a file type that is not allowed. Please try again.', 'wpforms-lite' ),
[290] Fix | Delete
'upgrade_modal' => wpforms_get_upgrade_modal_text(),
[291] Fix | Delete
'choicesjs_loading' => $default_choicesjs_loading_text,
[292] Fix | Delete
'choicesjs_no_results' => $default_choicesjs_no_results_text,
[293] Fix | Delete
'choicesjs_no_choices' => $default_choicesjs_no_choices_text,
[294] Fix | Delete
'debug' => wpforms_debug(),
[295] Fix | Delete
'edit_license' => esc_html__( 'To edit the License Key, please first click the Remove Key button. Please note that removing this key will remove access to updates, addons, and support.', 'wpforms-lite' ),
[296] Fix | Delete
'something_went_wrong' => esc_html__( 'Something went wrong', 'wpforms-lite' ),
[297] Fix | Delete
'success' => esc_html__( 'Success', 'wpforms-lite' ),
[298] Fix | Delete
'loading' => esc_html__( 'Loading...', 'wpforms-lite' ),
[299] Fix | Delete
'use_default_template' => esc_html__( 'Use Default Template', 'wpforms-lite' ),
[300] Fix | Delete
'error_select_template' => esc_html__( 'Something went wrong while applying the form template. Please try again. If the error persists, contact our support team.', 'wpforms-lite' ),
[301] Fix | Delete
'try_again' => sprintf(
[302] Fix | Delete
wp_kses( /* translators: %s - link to WPForms.com docs page. */
[303] Fix | Delete
__( 'Something went wrong. Please try again, and if the problem persists, <a href="%1$s" target="_blank" rel="noopener noreferrer">contact our support team</a>.', 'wpforms-lite' ),
[304] Fix | Delete
[
[305] Fix | Delete
'a' => [
[306] Fix | Delete
'href' => [],
[307] Fix | Delete
'target' => [],
[308] Fix | Delete
'rel' => [],
[309] Fix | Delete
],
[310] Fix | Delete
]
[311] Fix | Delete
),
[312] Fix | Delete
esc_url( wpforms_utm_link( 'https://wpforms.com/contact/', 'error-modal', 'contact our support team' ) )
[313] Fix | Delete
),
[314] Fix | Delete
];
[315] Fix | Delete
[316] Fix | Delete
/**
[317] Fix | Delete
* Allow theme/plugin developers to adjust main strings on backend/admin part.
[318] Fix | Delete
*
[319] Fix | Delete
* @since 1.3.9
[320] Fix | Delete
*
[321] Fix | Delete
* @param array $strings Main admin localized strings.
[322] Fix | Delete
*/
[323] Fix | Delete
$strings = (array) apply_filters( 'wpforms_admin_strings', $strings );
[324] Fix | Delete
[325] Fix | Delete
/**
[326] Fix | Delete
* Allow theme/plugin developers to adjust Choices.js settings on backend/admin part.
[327] Fix | Delete
*
[328] Fix | Delete
* @see https://github.com/Choices-js/Choices#setup For configuration options.
[329] Fix | Delete
*
[330] Fix | Delete
* @since 1.7.3
[331] Fix | Delete
*
[332] Fix | Delete
* @param array $choicesjs_config Choicesjs configuration.
[333] Fix | Delete
*/
[334] Fix | Delete
$choicesjs_config = (array) apply_filters(
[335] Fix | Delete
'wpforms_admin_scripts_choicesjs_config',
[336] Fix | Delete
[
[337] Fix | Delete
'searchEnabled' => false,
[338] Fix | Delete
// Forces the search to look for exact matches anywhere in the string.
[339] Fix | Delete
'fuseOptions' => [
[340] Fix | Delete
'threshold' => 0.1,
[341] Fix | Delete
'distance' => 1000,
[342] Fix | Delete
],
[343] Fix | Delete
'loadingText' => ! empty( $strings['choicesjs_loading'] ) ? $strings['choicesjs_loading'] : $default_choicesjs_loading_text,
[344] Fix | Delete
'noResultsText' => ! empty( $strings['choicesjs_no_results'] ) ? $strings['choicesjs_no_results'] : $default_choicesjs_no_results_text,
[345] Fix | Delete
'noChoicesText' => ! empty( $strings['choicesjs_no_choices'] ) ? $strings['choicesjs_no_choices'] : $default_choicesjs_no_choices_text,
[346] Fix | Delete
]
[347] Fix | Delete
);
[348] Fix | Delete
[349] Fix | Delete
wp_localize_script(
[350] Fix | Delete
'wpforms-admin',
[351] Fix | Delete
'wpforms_admin_choicesjs_config',
[352] Fix | Delete
$choicesjs_config
[353] Fix | Delete
);
[354] Fix | Delete
[355] Fix | Delete
wp_localize_script(
[356] Fix | Delete
'wpforms-admin',
[357] Fix | Delete
'wpforms_admin',
[358] Fix | Delete
$strings
[359] Fix | Delete
);
[360] Fix | Delete
}
[361] Fix | Delete
add_action( 'admin_enqueue_scripts', 'wpforms_admin_scripts' );
[362] Fix | Delete
[363] Fix | Delete
/**
[364] Fix | Delete
* Add body class to WPForms admin pages for easy reference.
[365] Fix | Delete
*
[366] Fix | Delete
* @since 1.3.9
[367] Fix | Delete
*
[368] Fix | Delete
* @param string $classes CSS classes, space separated.
[369] Fix | Delete
*
[370] Fix | Delete
* @return string
[371] Fix | Delete
*/
[372] Fix | Delete
function wpforms_admin_body_class( $classes ) {
[373] Fix | Delete
[374] Fix | Delete
if ( ! wpforms_is_admin_page() ) {
[375] Fix | Delete
return $classes;
[376] Fix | Delete
}
[377] Fix | Delete
[378] Fix | Delete
return "$classes wpforms-admin-page";
[379] Fix | Delete
}
[380] Fix | Delete
add_filter( 'admin_body_class', 'wpforms_admin_body_class', 10, 1 );
[381] Fix | Delete
[382] Fix | Delete
/**
[383] Fix | Delete
* Output the WPForms admin header.
[384] Fix | Delete
*
[385] Fix | Delete
* @since 1.3.9
[386] Fix | Delete
*/
[387] Fix | Delete
function wpforms_admin_header() {
[388] Fix | Delete
[389] Fix | Delete
// Bail if we're not on a WPForms screen or page (also exclude form builder).
[390] Fix | Delete
if ( ! wpforms_is_admin_page() ) {
[391] Fix | Delete
return;
[392] Fix | Delete
}
[393] Fix | Delete
[394] Fix | Delete
/**
[395] Fix | Delete
* Prevent admin header outputting if needed.
[396] Fix | Delete
*
[397] Fix | Delete
* @since 1.5.7
[398] Fix | Delete
*
[399] Fix | Delete
* @param bool $is_admin_header_visible True if admin page header should be outputted.
[400] Fix | Delete
*/
[401] Fix | Delete
if ( ! apply_filters( 'wpforms_admin_header', true ) ) {
[402] Fix | Delete
return;
[403] Fix | Delete
}
[404] Fix | Delete
[405] Fix | Delete
// Omit header from Welcome activation screen.
[406] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
[407] Fix | Delete
if ( sanitize_key( $_REQUEST['page'] ) === 'wpforms-getting-started' ) {
[408] Fix | Delete
return;
[409] Fix | Delete
}
[410] Fix | Delete
[411] Fix | Delete
/**
[412] Fix | Delete
* Fire before the admin header is outputted.
[413] Fix | Delete
*
[414] Fix | Delete
* @since 1.5.7
[415] Fix | Delete
*/
[416] Fix | Delete
do_action( 'wpforms_admin_header_before' );
[417] Fix | Delete
?>
[418] Fix | Delete
<div id="wpforms-header-temp"></div>
[419] Fix | Delete
<div id="wpforms-header" class="wpforms-header">
[420] Fix | Delete
<img class="wpforms-header-logo" src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/logo.png' ); ?>" alt="WPForms Logo">
[421] Fix | Delete
</div>
[422] Fix | Delete
<?php
[423] Fix | Delete
/**
[424] Fix | Delete
* Fire after the admin header is outputted.
[425] Fix | Delete
*
[426] Fix | Delete
* @since 1.5.7
[427] Fix | Delete
*/
[428] Fix | Delete
do_action( 'wpforms_admin_header_after' );
[429] Fix | Delete
}
[430] Fix | Delete
add_action( 'in_admin_header', 'wpforms_admin_header', 100 );
[431] Fix | Delete
[432] Fix | Delete
/**
[433] Fix | Delete
* Remove non-WPForms notices from WPForms pages.
[434] Fix | Delete
*
[435] Fix | Delete
* @since 1.3.9
[436] Fix | Delete
* @since 1.6.9 Added callback for removing on `admin_footer` hook.
[437] Fix | Delete
*/
[438] Fix | Delete
function wpforms_admin_hide_unrelated_notices() { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.MaxExceeded, Generic.Metrics.NestingLevel.MaxExceeded
[439] Fix | Delete
[440] Fix | Delete
if ( ! wpforms_is_admin_page() ) {
[441] Fix | Delete
return;
[442] Fix | Delete
}
[443] Fix | Delete
[444] Fix | Delete
global $wp_filter;
[445] Fix | Delete
[446] Fix | Delete
// Define rules to remove callbacks.
[447] Fix | Delete
$rules = [
[448] Fix | Delete
'user_admin_notices' => [], // remove all callbacks.
[449] Fix | Delete
'admin_notices' => [],
[450] Fix | Delete
'all_admin_notices' => [],
[451] Fix | Delete
'admin_footer' => [
[452] Fix | Delete
'render_delayed_admin_notices', // remove this particular callback.
[453] Fix | Delete
],
[454] Fix | Delete
];
[455] Fix | Delete
[456] Fix | Delete
// Extra deny callbacks (will be removed for each hook tag defined in $rules).
[457] Fix | Delete
$common_deny_callbacks = [
[458] Fix | Delete
'wpformsdb_admin_notice', // 'Database for WPForms' plugin.
[459] Fix | Delete
];
[460] Fix | Delete
[461] Fix | Delete
$notice_types = array_keys( $rules );
[462] Fix | Delete
[463] Fix | Delete
foreach ( $notice_types as $notice_type ) {
[464] Fix | Delete
if ( empty( $wp_filter[ $notice_type ]->callbacks ) || ! is_array( $wp_filter[ $notice_type ]->callbacks ) ) {
[465] Fix | Delete
continue;
[466] Fix | Delete
}
[467] Fix | Delete
[468] Fix | Delete
$remove_all_filters = empty( $rules[ $notice_type ] );
[469] Fix | Delete
[470] Fix | Delete
foreach ( $wp_filter[ $notice_type ]->callbacks as $priority => $hooks ) {
[471] Fix | Delete
foreach ( $hooks as $name => $arr ) {
[472] Fix | Delete
if ( is_object( $arr['function'] ) && is_callable( $arr['function'] ) ) {
[473] Fix | Delete
if ( $remove_all_filters ) {
[474] Fix | Delete
unset( $wp_filter[ $notice_type ]->callbacks[ $priority ][ $name ] );
[475] Fix | Delete
}
[476] Fix | Delete
continue;
[477] Fix | Delete
}
[478] Fix | Delete
[479] Fix | Delete
$class = ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) ? strtolower( get_class( $arr['function'][0] ) ) : '';
[480] Fix | Delete
[481] Fix | Delete
// Remove all callbacks except WPForms notices.
[482] Fix | Delete
if ( $remove_all_filters && strpos( $class, 'wpforms' ) === false ) {
[483] Fix | Delete
unset( $wp_filter[ $notice_type ]->callbacks[ $priority ][ $name ] );
[484] Fix | Delete
continue;
[485] Fix | Delete
}
[486] Fix | Delete
[487] Fix | Delete
$cb = is_array( $arr['function'] ) ? $arr['function'][1] : $arr['function'];
[488] Fix | Delete
[489] Fix | Delete
// Remove a specific callback.
[490] Fix | Delete
if ( ! $remove_all_filters ) {
[491] Fix | Delete
if ( in_array( $cb, $rules[ $notice_type ], true ) ) {
[492] Fix | Delete
unset( $wp_filter[ $notice_type ]->callbacks[ $priority ][ $name ] );
[493] Fix | Delete
}
[494] Fix | Delete
continue;
[495] Fix | Delete
}
[496] Fix | Delete
[497] Fix | Delete
// Remove non-WPForms callbacks from `$common_deny_callbacks` denylist.
[498] Fix | Delete
if ( in_array( $cb, $common_deny_callbacks, true ) ) {
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function