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/clone/wp-conte.../plugins/wp-bulk-.../assets/js
File: wp-bulk-delete-admin.js
(function( $ ) {
[0] Fix | Delete
'use strict';
[1] Fix | Delete
[2] Fix | Delete
/**
[3] Fix | Delete
* All of the code for your admin-facing JavaScript source
[4] Fix | Delete
* should reside in this file.
[5] Fix | Delete
*
[6] Fix | Delete
* Note: It has been assumed you will write jQuery code here, so the
[7] Fix | Delete
* $ function reference has been prepared for usage within the scope
[8] Fix | Delete
* of this function.
[9] Fix | Delete
*
[10] Fix | Delete
* This enables you to define handlers, for when the DOM is ready:
[11] Fix | Delete
*
[12] Fix | Delete
* $(function() {
[13] Fix | Delete
*
[14] Fix | Delete
* });
[15] Fix | Delete
*
[16] Fix | Delete
* When the window is loaded:
[17] Fix | Delete
*
[18] Fix | Delete
* $( window ).load(function() {
[19] Fix | Delete
*
[20] Fix | Delete
* });
[21] Fix | Delete
*
[22] Fix | Delete
* ...and/or other possibilities.
[23] Fix | Delete
*
[24] Fix | Delete
* Ideally, it is not considered best practise to attach more than a
[25] Fix | Delete
* single DOM-ready or window-load handler for a particular page.
[26] Fix | Delete
* Although scripts in the WordPress core, Plugins and Themes may be
[27] Fix | Delete
* practising this, we should strive to set a better example in our own work.
[28] Fix | Delete
*/
[29] Fix | Delete
jQuery(document).ready(function(){
[30] Fix | Delete
jQuery('.delete_all_datepicker').datepicker({
[31] Fix | Delete
changeMonth: true,
[32] Fix | Delete
changeYear: true,
[33] Fix | Delete
dateFormat: 'yy-mm-dd'
[34] Fix | Delete
});
[35] Fix | Delete
});
[36] Fix | Delete
[37] Fix | Delete
// Delete posts form handle.
[38] Fix | Delete
jQuery(document).ready(function() {
[39] Fix | Delete
jQuery('#delete_posts_submit').on( 'click', function() {
[40] Fix | Delete
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
[41] Fix | Delete
jQuery("#delete_posts_form").submit();
[42] Fix | Delete
return;
[43] Fix | Delete
}
[44] Fix | Delete
var deleteform = jQuery("#delete_posts_form").serialize();
[45] Fix | Delete
var data = {
[46] Fix | Delete
'action': 'delete_posts_count',
[47] Fix | Delete
'form': deleteform
[48] Fix | Delete
};
[49] Fix | Delete
jQuery(".spinner").addClass("is-active");
[50] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[51] Fix | Delete
if( response != '' ){
[52] Fix | Delete
var response = jQuery.parseJSON( response );
[53] Fix | Delete
if( response.status == 0 ){
[54] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
[55] Fix | Delete
} else if( response.status == 2 ){
[56] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
[57] Fix | Delete
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
[58] Fix | Delete
} else if( response.status == 1 ){
[59] Fix | Delete
if ( confirm( response.post_count + ' posts will be delete. Would you like to proceed further?' ) ){
[60] Fix | Delete
jQuery("#delete_posts_form").submit();
[61] Fix | Delete
}
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
jQuery(".spinner").removeClass("is-active");
[65] Fix | Delete
});
[66] Fix | Delete
});
[67] Fix | Delete
});
[68] Fix | Delete
[69] Fix | Delete
// Render Dynamic taxomony.
[70] Fix | Delete
jQuery(document).ready(function() {
[71] Fix | Delete
jQuery('#delete_post_type').on( 'change', function() {
[72] Fix | Delete
var post_type = jQuery(this).val();
[73] Fix | Delete
var data = {
[74] Fix | Delete
'action': 'render_taxonomy_by_posttype',
[75] Fix | Delete
'post_type': post_type
[76] Fix | Delete
};
[77] Fix | Delete
[78] Fix | Delete
var taxomony_space = jQuery('.post_taxonomy');
[79] Fix | Delete
jQuery('.taxo_terms_title').html('');
[80] Fix | Delete
jQuery('.post_taxo_terms').html('');
[81] Fix | Delete
taxomony_space.html('<span class="spinner is-active" style="float: none;"></span>');
[82] Fix | Delete
// send ajax request.
[83] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[84] Fix | Delete
if( response != '' ){
[85] Fix | Delete
taxomony_space.html( response );
[86] Fix | Delete
}else{
[87] Fix | Delete
taxomony_space.html( '' );
[88] Fix | Delete
}
[89] Fix | Delete
});
[90] Fix | Delete
});
[91] Fix | Delete
});
[92] Fix | Delete
[93] Fix | Delete
// Render Dynamic Terms.
[94] Fix | Delete
jQuery(document).ready(function() {
[95] Fix | Delete
jQuery(document).on( 'change', '.post_taxonomy_radio', function() {
[96] Fix | Delete
[97] Fix | Delete
var post_taxomony = jQuery(this).val();
[98] Fix | Delete
var xt_taxonomy_title = jQuery(this).attr( 'title' );
[99] Fix | Delete
jQuery('.taxo_terms_title').html( xt_taxonomy_title + ':');
[100] Fix | Delete
var data = {
[101] Fix | Delete
'action': 'render_terms_by_taxonomy',
[102] Fix | Delete
'post_taxomony': post_taxomony
[103] Fix | Delete
};
[104] Fix | Delete
[105] Fix | Delete
var terms_space = jQuery('.post_taxo_terms');
[106] Fix | Delete
terms_space.html('<span class="spinner is-active" style="float: none;"></span>');
[107] Fix | Delete
// send ajax request.
[108] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[109] Fix | Delete
if( response != '' ){
[110] Fix | Delete
terms_space.html( response );
[111] Fix | Delete
jQuery(".taxonomy_terms_select").chosen({placeholder_text_multiple:"Select "+xt_taxonomy_title });
[112] Fix | Delete
}else{
[113] Fix | Delete
terms_space.html( '' );
[114] Fix | Delete
}
[115] Fix | Delete
});
[116] Fix | Delete
});
[117] Fix | Delete
});
[118] Fix | Delete
[119] Fix | Delete
[120] Fix | Delete
// Delete users form handle.
[121] Fix | Delete
jQuery(document).ready(function() {
[122] Fix | Delete
jQuery('#delete_users_submit').on( 'click', function() {
[123] Fix | Delete
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
[124] Fix | Delete
jQuery("#delete_users_form").submit();
[125] Fix | Delete
return;
[126] Fix | Delete
}
[127] Fix | Delete
var deleteuserform = jQuery("#delete_users_form").serialize();
[128] Fix | Delete
var data = {
[129] Fix | Delete
'action': 'delete_users_count',
[130] Fix | Delete
'form': deleteuserform
[131] Fix | Delete
};
[132] Fix | Delete
jQuery(".spinner").addClass("is-active");
[133] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[134] Fix | Delete
if( response != '' ){
[135] Fix | Delete
var response = jQuery.parseJSON( response );
[136] Fix | Delete
if( response.status == 0 ){
[137] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
[138] Fix | Delete
} else if( response.status == 2 ){
[139] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
[140] Fix | Delete
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
[141] Fix | Delete
} else if( response.status == 1 ){
[142] Fix | Delete
if ( confirm( response.post_count + ' users will be delete. Would you like to proceed further?' ) ){
[143] Fix | Delete
jQuery("#delete_users_form").submit();
[144] Fix | Delete
}
[145] Fix | Delete
}
[146] Fix | Delete
}
[147] Fix | Delete
jQuery(".spinner").removeClass("is-active");
[148] Fix | Delete
});
[149] Fix | Delete
});
[150] Fix | Delete
});
[151] Fix | Delete
[152] Fix | Delete
// Delete comments form handle.
[153] Fix | Delete
jQuery(document).ready(function() {
[154] Fix | Delete
jQuery('#delete_comments_submit').on( 'click', function() {
[155] Fix | Delete
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
[156] Fix | Delete
jQuery("#delete_comments_form").submit();
[157] Fix | Delete
return;
[158] Fix | Delete
}
[159] Fix | Delete
var deletecommentform = jQuery("#delete_comments_form").serialize();
[160] Fix | Delete
var data = {
[161] Fix | Delete
'action': 'delete_comments_count',
[162] Fix | Delete
'form': deletecommentform
[163] Fix | Delete
};
[164] Fix | Delete
jQuery(".spinner").addClass("is-active");
[165] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[166] Fix | Delete
if( response != '' ){
[167] Fix | Delete
var response = jQuery.parseJSON( response );
[168] Fix | Delete
if( response.status == 0 ){
[169] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
[170] Fix | Delete
} else if( response.status == 2 ){
[171] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
[172] Fix | Delete
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
[173] Fix | Delete
} else if( response.status == 1 ){
[174] Fix | Delete
if ( confirm( response.post_count + ' comments will be delete. Would you like to proceed further?' ) ){
[175] Fix | Delete
jQuery("#delete_comments_form").submit();
[176] Fix | Delete
}
[177] Fix | Delete
}
[178] Fix | Delete
}
[179] Fix | Delete
jQuery(".spinner").removeClass("is-active");
[180] Fix | Delete
});
[181] Fix | Delete
});
[182] Fix | Delete
});
[183] Fix | Delete
[184] Fix | Delete
jQuery(document).ready(function(){
[185] Fix | Delete
jQuery('#with_custom_query').on('change', function(){
[186] Fix | Delete
if( jQuery('#with_custom_query').is(':checked') ){
[187] Fix | Delete
jQuery('input[name="delete_type"][value="permenant"]').prop('checked',true);
[188] Fix | Delete
jQuery('input[name=delete_type][value="trash"]').prop("disabled",true);
[189] Fix | Delete
}else{
[190] Fix | Delete
jQuery('input[name=delete_type][value="trash"]').prop("disabled",false);
[191] Fix | Delete
}
[192] Fix | Delete
});
[193] Fix | Delete
jQuery("#with_custom_query").trigger("checked");
[194] Fix | Delete
});
[195] Fix | Delete
[196] Fix | Delete
// Delete meta form handle.
[197] Fix | Delete
jQuery(document).ready(function() {
[198] Fix | Delete
jQuery('#delete_meta_submit').on( 'click', function() {
[199] Fix | Delete
if(jQuery('input[name="delete_time"]:checked').val() === "scheduled"){
[200] Fix | Delete
jQuery("#delete_meta_form").submit();
[201] Fix | Delete
return;
[202] Fix | Delete
}
[203] Fix | Delete
var metaform = jQuery("#delete_meta_form").serialize();
[204] Fix | Delete
var data = {
[205] Fix | Delete
'action': 'delete_meta_count',
[206] Fix | Delete
'form': metaform
[207] Fix | Delete
};
[208] Fix | Delete
jQuery(".spinner").addClass("is-active");
[209] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[210] Fix | Delete
if( response != '' ){
[211] Fix | Delete
var response = jQuery.parseJSON( response );
[212] Fix | Delete
if( response.status == 0 ){
[213] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
[214] Fix | Delete
} else if( response.status == 2 ){
[215] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
[216] Fix | Delete
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
[217] Fix | Delete
} else if( response.status == 1 ){
[218] Fix | Delete
if ( confirm( response.post_count + ' meta will be delete. Would you like to proceed further?' ) ){
[219] Fix | Delete
jQuery("#delete_meta_form").submit();
[220] Fix | Delete
}
[221] Fix | Delete
}
[222] Fix | Delete
}
[223] Fix | Delete
jQuery(".spinner").removeClass("is-active");
[224] Fix | Delete
});
[225] Fix | Delete
});
[226] Fix | Delete
});
[227] Fix | Delete
[228] Fix | Delete
[229] Fix | Delete
// Delete meta form handle.
[230] Fix | Delete
jQuery(document).ready(function() {
[231] Fix | Delete
jQuery('#delete_terms_submit').on( 'click', function() {
[232] Fix | Delete
var termform = jQuery("#delete_terms_form").serialize();
[233] Fix | Delete
var data = {
[234] Fix | Delete
'action': 'delete_terms_count',
[235] Fix | Delete
'form': termform
[236] Fix | Delete
};
[237] Fix | Delete
jQuery(".spinner").addClass("is-active");
[238] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[239] Fix | Delete
if( response != '' ){
[240] Fix | Delete
var response = jQuery.parseJSON( response );
[241] Fix | Delete
if( response.status == 0 ){
[242] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-error"><p><strong>' + response.messages + '</strong></p></div>');
[243] Fix | Delete
} else if( response.status == 2 ){
[244] Fix | Delete
jQuery(".delete_notice").html('<div class="notice notice-success"><p><strong>' + response.messages + '</strong></p></div>');
[245] Fix | Delete
jQuery("html, body").animate({ scrollTop: 0 }, "slow");
[246] Fix | Delete
} else if( response.status == 1 ){
[247] Fix | Delete
if ( confirm( response.post_count + ' Terms will be delete. Would you like to proceed further?' ) ){
[248] Fix | Delete
jQuery("#delete_terms_form").submit();
[249] Fix | Delete
}
[250] Fix | Delete
}
[251] Fix | Delete
}
[252] Fix | Delete
jQuery(".spinner").removeClass("is-active");
[253] Fix | Delete
});
[254] Fix | Delete
});
[255] Fix | Delete
});
[256] Fix | Delete
[257] Fix | Delete
//
[258] Fix | Delete
jQuery(document).ready(function(){
[259] Fix | Delete
jQuery("#reassign_user").chosen({max_selected_options: 1});
[260] Fix | Delete
jQuery(".chosen_select").chosen({max_selected_options: 1});
[261] Fix | Delete
});
[262] Fix | Delete
[263] Fix | Delete
// Render Dynamic post dropdown.
[264] Fix | Delete
jQuery(document).ready(function() {
[265] Fix | Delete
jQuery('#meta_post_type').on( 'change', function() {
[266] Fix | Delete
var post_type = jQuery(this).val();
[267] Fix | Delete
var data = {
[268] Fix | Delete
'action': 'render_postdropdown_by_posttype',
[269] Fix | Delete
'post_type': post_type
[270] Fix | Delete
};
[271] Fix | Delete
[272] Fix | Delete
var postdropdown_space = jQuery('.postdropdown_space');
[273] Fix | Delete
postdropdown_space.html('<span class="spinner is-active" style="float: none;"></span>');
[274] Fix | Delete
// send ajax request.
[275] Fix | Delete
jQuery.post(ajaxurl, data, function(response) {
[276] Fix | Delete
if( response != '' ){
[277] Fix | Delete
postdropdown_space.html( response );
[278] Fix | Delete
jQuery(".post_for_meta").chosen({placeholder_text_multiple:"Select posts"});
[279] Fix | Delete
}else{
[280] Fix | Delete
postdropdown_space.html( '' );
[281] Fix | Delete
}
[282] Fix | Delete
});
[283] Fix | Delete
});
[284] Fix | Delete
[285] Fix | Delete
jQuery('.date_type').on( 'change', function() {
[286] Fix | Delete
var date_type = jQuery(this).val();
[287] Fix | Delete
if( date_type === 'custom_date' ){
[288] Fix | Delete
jQuery(".wpbd_date_days").hide();
[289] Fix | Delete
jQuery(".wpbd_custom_interval").show();
[290] Fix | Delete
jQuery(".wpbd_date_range").hide();
[291] Fix | Delete
}else if( date_type === 'within_last' || date_type === 'older_than' ){
[292] Fix | Delete
jQuery(".wpbd_custom_interval").hide();
[293] Fix | Delete
jQuery(".wpbd_date_days").show();
[294] Fix | Delete
jQuery(".wpbd_date_range").hide();
[295] Fix | Delete
}else{
[296] Fix | Delete
jQuery(".wpbd_custom_interval").hide();
[297] Fix | Delete
jQuery(".wpbd_date_days").hide();
[298] Fix | Delete
jQuery(".wpbd_date_range").show();
[299] Fix | Delete
}
[300] Fix | Delete
});
[301] Fix | Delete
[302] Fix | Delete
jQuery('.mdate_type').on( 'change', function() {
[303] Fix | Delete
var mdate_type = jQuery(this).val();
[304] Fix | Delete
if( mdate_type === 'mcustom_date'){
[305] Fix | Delete
jQuery(".mwpbd_date_days").hide();
[306] Fix | Delete
jQuery(".mwpbd_custom_interval").show();
[307] Fix | Delete
}else{
[308] Fix | Delete
jQuery(".mwpbd_custom_interval").hide();
[309] Fix | Delete
jQuery(".mwpbd_date_days").show();
[310] Fix | Delete
}
[311] Fix | Delete
});
[312] Fix | Delete
[313] Fix | Delete
jQuery(".wpbd_schedule_name_wrap").show();
[314] Fix | Delete
});
[315] Fix | Delete
[316] Fix | Delete
jQuery(document).ready(function(){
[317] Fix | Delete
jQuery('.delete_all_datetimepicker').datetimepicker({
[318] Fix | Delete
dateFormat: 'yy-mm-dd',
[319] Fix | Delete
timeFormat: 'HH:mm:ss'
[320] Fix | Delete
});
[321] Fix | Delete
});
[322] Fix | Delete
[323] Fix | Delete
jQuery(document).ready(function(){
[324] Fix | Delete
jQuery("#user_who_has_no_order").change(function() {
[325] Fix | Delete
if( jQuery( "#user_who_has_no_order" ).is( ":checked" ) ) {
[326] Fix | Delete
var selectedRoles = [];
[327] Fix | Delete
jQuery( "input[name='delete_user_roles[]']:checked" ).each(function(){
[328] Fix | Delete
selectedRoles.push( jQuery(this).val() );
[329] Fix | Delete
});
[330] Fix | Delete
if( selectedRoles.length > 1 || ( selectedRoles.length === 1 && selectedRoles[0] !== "customer" ) ) {
[331] Fix | Delete
alert('The "User Who Has No Order" option only works with the Customer role.');
[332] Fix | Delete
}
[333] Fix | Delete
jQuery( "input[name='delete_user_roles[]']" ).each(function() {
[334] Fix | Delete
if( jQuery(this).val() !== "customer" ) {
[335] Fix | Delete
jQuery(this).prop( "checked", false );
[336] Fix | Delete
}
[337] Fix | Delete
});
[338] Fix | Delete
}
[339] Fix | Delete
});
[340] Fix | Delete
jQuery( "input[name='delete_user_roles[]']" ).change(function() {
[341] Fix | Delete
var userWhoHasNoOrderChecked = jQuery( "#user_who_has_no_order" ).is( ":checked" );
[342] Fix | Delete
if( userWhoHasNoOrderChecked ){
[343] Fix | Delete
if (jQuery(this).val() === "customer") {
[344] Fix | Delete
jQuery("input[name='delete_user_roles[]']").each(function() {
[345] Fix | Delete
if (jQuery(this).val() !== "customer") {
[346] Fix | Delete
jQuery(this).prop("checked", false);
[347] Fix | Delete
}
[348] Fix | Delete
});
[349] Fix | Delete
} else {
[350] Fix | Delete
alert('The "User Who Has No Order" option only works with the Customer role.');
[351] Fix | Delete
jQuery('#user_who_has_no_order').prop( 'checked', false );
[352] Fix | Delete
}
[353] Fix | Delete
}
[354] Fix | Delete
});
[355] Fix | Delete
});
[356] Fix | Delete
[357] Fix | Delete
})( jQuery );
[358] Fix | Delete
[359] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function