Ticket #46872: 46872.5.diff
File 46872.5.diff, 11.5 KB (added by , 4 years ago) |
---|
-
src/js/_enqueues/admin/common.js
1220 1220 }); 1221 1221 1222 1222 /** 1223 * Marries the secondary bulk action controls to the primary controls. 1224 * 1225 * @return {void} 1226 */ 1227 (function(){ 1228 var topBulkActionSelector = $('#bulk-action-selector-top'), 1229 topBulkActionSubmit = $('#doaction'), 1230 bottomBulkActionSelector = $('#bulk-action-selector-bottom'), 1231 bottomBulkActionSubmit = $('#doaction2'); 1232 1233 /** 1234 * Updates the primary bulk action selector upon change of the secondary selector. 1235 * 1236 * @since 5.7.0 1237 * 1238 * @return {void} 1239 */ 1240 function updateTopBulkActionSelector() { 1241 topBulkActionSelector.val($(this).val()); 1242 } 1243 bottomBulkActionSelector.on('change', updateTopBulkActionSelector); 1244 1245 /** 1246 * Updates the secondary bulk action selector upon change of the primary selector. 1247 * 1248 * @since 5.7.0 1249 * 1250 * @return {void} 1251 */ 1252 function updateBottomBulkActionSelector() { 1253 bottomBulkActionSelector.val($(this).val()); 1254 } 1255 topBulkActionSelector.on('change', updateBottomBulkActionSelector); 1256 1257 1258 /** 1259 * Triggers the primary bulk action submit upon click of secondary button. 1260 * 1261 * @since 5.7.0 1262 * 1263 * @return {void} 1264 */ 1265 function triggerBulkActionSubmitClick(e) { 1266 e.preventDefault(); 1267 e.stopPropagation(); 1268 1269 topBulkActionSubmit.trigger('click'); 1270 } 1271 bottomBulkActionSubmit.on('click', triggerBulkActionSubmitClick); 1272 })(); 1273 1274 /** 1275 * Marries the secondary change role controls to the primary controls. 1276 * 1277 * @return {void} 1278 */ 1279 (function(){ 1280 var topChangeRoleSelector = $('#new_role'), 1281 topChangeRoleSubmit = $('#changeit'), 1282 bottomChangeRoleSelector = $('#new_role2'), 1283 bottomChangeRoleSubmit = $('#changeit2'); 1284 1285 /** 1286 * Updates the primary change role selector upon change of the secondary selector. 1287 * 1288 * @since 5.7.0 1289 * 1290 * @return {void} 1291 */ 1292 function updateTopChangeRoleSelector() { 1293 topChangeRoleSelector.val($(this).val()); 1294 } 1295 bottomChangeRoleSelector.on('change', updateTopChangeRoleSelector); 1296 1297 /** 1298 * Updates the secondary change role selector upon change of the primary selector. 1299 * 1300 * @since 5.7.0 1301 * 1302 * @return {void} 1303 */ 1304 function updateBottomChangeRoleSelector() { 1305 bottomChangeRoleSelector.val($(this).val()); 1306 } 1307 topChangeRoleSelector.on('change', updateBottomChangeRoleSelector); 1308 1309 1310 /** 1311 * Triggers the primary change role submit upon click of secondary button. 1312 * 1313 * @since 5.7.0 1314 * 1315 * @return {void} 1316 */ 1317 function triggerChangeRoleSubmitClick(e) { 1318 e.preventDefault(); 1319 e.stopPropagation(); 1320 1321 topChangeRoleSubmit.trigger('click'); 1322 } 1323 bottomChangeRoleSubmit.on('click', triggerChangeRoleSubmitClick); 1324 })(); 1325 1326 /** 1223 1327 * Shows row actions on focus of its parent container element or any other elements contained within. 1224 1328 * 1225 1329 * @return {void} … … 1321 1425 pageInput.closest('form').submit( function() { 1322 1426 /* 1323 1427 * action = bulk action dropdown at the top of the table 1324 * action2 = bulk action dropdow at the bottom of the table1325 1428 */ 1326 if ( $('select[name="action"]').val() == -1 && $('select[name="action2"]').val() == -1 &&pageInput.val() == currentPage )1429 if ( $('select[name="action"]').val() == -1 && pageInput.val() == currentPage ) 1327 1430 pageInput.val('1'); 1328 1431 }); 1329 1432 } -
src/js/_enqueues/admin/edit-comments.js
808 808 commentReply.toggle($(this).parent()); 809 809 }); 810 810 811 $('#doaction, # doaction2, #post-query-submit').click(function(){811 $('#doaction, #post-query-submit').click(function(){ 812 812 if ( $('#the-comment-list #replyrow').length > 0 ) 813 813 commentReply.close(); 814 814 }); -
src/js/_enqueues/admin/inline-edit-post.js
139 139 /** 140 140 * Adds onclick events to the apply buttons. 141 141 */ 142 $('#doaction , #doaction2').click(function(e){142 $('#doaction').click(function(e){ 143 143 var n; 144 144 145 145 t.whichBulkButtonId = $( this ).attr( 'id' ); -
src/js/_enqueues/admin/media.js
178 178 $( '#find-posts-close' ).click( findPosts.close ); 179 179 180 180 // Binds the bulk action events to the submit buttons. 181 $( '#doaction , #doaction2' ).click( function( event ) {181 $( '#doaction' ).click( function( event ) { 182 182 183 183 /* 184 * Retrieves all select elements for bulk actions that have a name starting with `action` 185 * and handle its action based on its value. 184 * Handle the bulk action based on its value. 186 185 */ 187 $( 'select[name ^="action"]' ).each( function() {186 $( 'select[name="action"]' ).each( function() { 188 187 var optionValue = $( this ).val(); 189 188 190 189 if ( 'attach' === optionValue ) { -
src/wp-admin/css/forms.css
492 492 margin: 0 8px 0 0; 493 493 } 494 494 495 /* @since 5.7.0 Secondary bulk action controls require JS. */ 496 .no-js label[for="bulk-action-selector-bottom"], 497 .no-js select#bulk-action-selector-bottom, 498 .no-js input#doaction2, 499 .no-js label[for="new_role2"], 500 .no-js select#new_role2, 501 .no-js input#changeit2 { 502 display: none; 503 } 504 495 505 .tablenav .actions select { 496 506 float: left; 497 507 margin-right: 6px; -
src/wp-admin/edit-comments.php
31 31 $doaction = 'delete'; 32 32 } elseif ( isset( $_REQUEST['delete_comments'] ) ) { 33 33 $comment_ids = $_REQUEST['delete_comments']; 34 $doaction = ( '-1' !== $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];34 $doaction = $_REQUEST['action']; 35 35 } elseif ( isset( $_REQUEST['ids'] ) ) { 36 36 $comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) ); 37 37 } elseif ( wp_get_referer() ) { -
src/wp-admin/edit.php
211 211 break; 212 212 } 213 213 214 $sendback = remove_query_arg( array( 'action', ' action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback );214 $sendback = remove_query_arg( array( 'action', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback ); 215 215 216 216 wp_redirect( $sendback ); 217 217 exit; -
src/wp-admin/includes/class-wp-list-table.php
526 526 return $_REQUEST['action']; 527 527 } 528 528 529 if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {530 return $_REQUEST['action2'];531 }532 533 529 return false; 534 530 } 535 531 -
src/wp-admin/includes/class-wp-terms-list-table.php
171 171 * @return string 172 172 */ 173 173 public function current_action() { 174 if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' === $_REQUEST['action'] || 'delete' === $_REQUEST['action2'] )) {174 if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && 'delete' === $_REQUEST['action'] ) { 175 175 return 'bulk-delete'; 176 176 } 177 177 -
src/wp-admin/includes/class-wp-users-list-table.php
335 335 * @return string The bulk action required. 336 336 */ 337 337 public function current_action() { 338 if ( ( isset( $_REQUEST['changeit'] ) || isset( $_REQUEST['changeit2'] ) ) && 339 ( ! empty( $_REQUEST['new_role'] ) || ! empty( $_REQUEST['new_role2'] ) ) ) { 338 if ( isset( $_REQUEST['changeit'] ) && ! empty( $_REQUEST['new_role'] ) ) { 340 339 return 'promote'; 341 340 } 342 341 -
src/wp-admin/network/site-users.php
140 140 case 'promote': 141 141 check_admin_referer( 'bulk-users' ); 142 142 $editable_roles = get_editable_roles(); 143 $role = false; 144 if ( ! empty( $_REQUEST['new_role2'] ) ) { 145 $role = $_REQUEST['new_role2']; 146 } elseif ( ! empty( $_REQUEST['new_role'] ) ) { 147 $role = $_REQUEST['new_role']; 148 } 143 $role = $_REQUEST['new_role']; 149 144 150 145 if ( empty( $editable_roles[ $role ] ) ) { 151 146 wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 ); -
src/wp-admin/network/sites.php
177 177 break; 178 178 179 179 case 'allblogs': 180 if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) )&& isset( $_POST['allblogs'] ) ) {181 $doaction = -1 != $_POST['action'] ? $_POST['action'] : $_POST['action2'];180 if ( isset( $_POST['action'] && isset( $_POST['allblogs'] ) ) { 181 $doaction = $_POST['action']; 182 182 183 183 foreach ( (array) $_POST['allblogs'] as $key => $val ) { 184 184 if ( '0' != $val && get_network()->site_id != $val ) { -
src/wp-admin/network/users.php
46 46 wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 ); 47 47 } 48 48 49 if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] )) && isset( $_POST['allusers'] ) ) {49 if ( isset( $_POST['action'] ) && isset( $_POST['allusers'] ) ) { 50 50 check_admin_referer( 'bulk-users-network' ); 51 51 52 $doaction = -1 != $_POST['action'] ? $_POST['action'] : $_POST['action2'];52 $doaction = $_POST['action']; 53 53 $userfunction = ''; 54 54 55 55 foreach ( (array) $_POST['allusers'] as $user_id ) { -
src/wp-admin/users.php
112 112 } 113 113 114 114 $editable_roles = get_editable_roles(); 115 $role = false; 116 if ( ! empty( $_REQUEST['new_role2'] ) ) { 117 $role = $_REQUEST['new_role2']; 118 } elseif ( ! empty( $_REQUEST['new_role'] ) ) { 119 $role = $_REQUEST['new_role']; 120 } 115 $role = $_REQUEST['new_role']; 121 116 122 117 if ( ! $role || empty( $editable_roles[ $role ] ) ) { 123 118 wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 );