Changeset 55656
- Timestamp:
- 04/18/2023 08:35:11 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php
r54378 r55656 110 110 if ( empty( $s ) ) { 111 111 // Nothing to do. 112 } elseif ( preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $s ) || 113 preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) || 114 preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) || 115 preg_match( '/^[0-9]{1,3}\.$/', $s ) ) { 112 } elseif ( preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $s ) 113 || preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) 114 || preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) 115 || preg_match( '/^[0-9]{1,3}\.$/', $s ) 116 ) { 116 117 // IPv4 address. 117 $sql = $wpdb->prepare( "SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s", $wpdb->esc_like( $s ) . ( ! empty( $wild ) ? '%' : '' ) ); 118 $sql = $wpdb->prepare( 119 "SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s", 120 $wpdb->esc_like( $s ) . ( ! empty( $wild ) ? '%' : '' ) 121 ); 122 118 123 $reg_blog_ids = $wpdb->get_col( $sql ); 119 124 … … 263 268 foreach ( $statuses as $status => $label_count ) { 264 269 if ( (int) $counts[ $status ] > 0 ) { 265 $label = sprintf( translate_nooped_plural( $label_count, $counts[ $status ] ), number_format_i18n( $counts[ $status ] ) ); 270 $label = sprintf( 271 translate_nooped_plural( $label_count, $counts[ $status ] ), 272 number_format_i18n( $counts[ $status ] ) 273 ); 274 266 275 $full_url = 'all' === $status ? $url : add_query_arg( 'status', $status, $url ); 267 276 … … 409 418 ?> 410 419 </label> 411 <input type="checkbox" id="blog_<?php echo $blog['blog_id']; ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ); ?>" /> 420 <input type="checkbox" id="blog_<?php echo $blog['blog_id']; ?>" name="allblogs[]" 421 value="<?php echo esc_attr( $blog['blog_id'] ); ?>" /> 412 422 <?php 413 423 endif; … … 441 451 ?> 442 452 <strong> 443 <a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname; ?></a> 444 <?php $this->site_states( $blog ); ?> 453 <?php 454 printf( 455 '<a href="%1$s" class="edit">%2$s</a>', 456 esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ), 457 $blogname 458 ); 459 460 $this->site_states( $blog ); 461 ?> 445 462 </strong> 446 463 <?php … … 477 494 } 478 495 479 echo ( '0000-00-00 00:00:00' === $blog['last_updated'] ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] ); 496 if ( '0000-00-00 00:00:00' === $blog['last_updated'] ) { 497 _e( 'Never' ); 498 } else { 499 echo mysql2date( $date, $blog['last_updated'] ); 500 } 480 501 } 481 502 … … 528 549 529 550 printf( 530 '<a href="% s">%s</a>',551 '<a href="%1$s">%2$s</a>', 531 552 esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ), 532 553 number_format_i18n( $user_count ) … … 587 608 588 609 foreach ( $this->status_list as $status => $col ) { 589 if ( 1== $blog[ $status ] ) {610 if ( '1' === $blog[ $status ] ) { 590 611 $class = " class='{$col[0]}'"; 591 612 } … … 621 642 $site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : ''; 622 643 foreach ( $this->status_list as $status => $col ) { 623 if ( ( 1 === (int) $_site->{$status} ) && ( $site_status !== $status )) {644 if ( '1' === $_site->{$status} && $site_status !== $status ) { 624 645 $site_states[ $col[0] ] = $col[1]; 625 646 } … … 700 721 ); 701 722 702 $actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a>'; 703 $actions['backend'] = "<a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a>'; 704 if ( get_network()->site_id != $blog['blog_id'] ) { 705 if ( '1' == $blog['deleted'] ) { 706 $actions['activate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a>'; 723 $actions['edit'] = sprintf( 724 '<a href="%1$s">%2$s</a>', 725 esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ), 726 __( 'Edit' ) 727 ); 728 729 $actions['backend'] = sprintf( 730 '<a href="%1$s" class="edit">%2$s</a>', 731 esc_url( get_admin_url( $blog['blog_id'] ) ), 732 __( 'Dashboard' ) 733 ); 734 735 if ( get_network()->site_id !== (int) $blog['blog_id'] ) { 736 if ( '1' === $blog['deleted'] ) { 737 $actions['activate'] = sprintf( 738 '<a href="%1$s">%2$s</a>', 739 esc_url( 740 wp_nonce_url( 741 network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] ), 742 'activateblog_' . $blog['blog_id'] 743 ) 744 ), 745 __( 'Activate' ) 746 ); 707 747 } else { 708 $actions['deactivate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a>'; 709 } 710 711 if ( '1' == $blog['archived'] ) { 712 $actions['unarchive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a>'; 748 $actions['deactivate'] = sprintf( 749 '<a href="%1$s">%2$s</a>', 750 esc_url( 751 wp_nonce_url( 752 network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] ), 753 'deactivateblog_' . $blog['blog_id'] 754 ) 755 ), 756 __( 'Deactivate' ) 757 ); 758 } 759 760 if ( '1' === $blog['archived'] ) { 761 $actions['unarchive'] = sprintf( 762 '<a href="%1$s">%2$s</a>', 763 esc_url( 764 wp_nonce_url( 765 network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] ), 766 'unarchiveblog_' . $blog['blog_id'] 767 ) 768 ), 769 __( 'Unarchive' ) 770 ); 713 771 } else { 714 $actions['archive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a>'; 715 } 716 717 if ( '1' == $blog['spam'] ) { 718 $actions['unspam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a>'; 772 $actions['archive'] = sprintf( 773 '<a href="%1$s">%2$s</a>', 774 esc_url( 775 wp_nonce_url( 776 network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] ), 777 'archiveblog_' . $blog['blog_id'] 778 ) 779 ), 780 _x( 'Archive', 'verb; site' ) 781 ); 782 } 783 784 if ( '1' === $blog['spam'] ) { 785 $actions['unspam'] = sprintf( 786 '<a href="%1$s">%2$s</a>', 787 esc_url( 788 wp_nonce_url( 789 network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] ), 790 'unspamblog_' . $blog['blog_id'] 791 ) 792 ), 793 _x( 'Not Spam', 'site' ) 794 ); 719 795 } else { 720 $actions['spam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a>'; 796 $actions['spam'] = sprintf( 797 '<a href="%1$s">%2$s</a>', 798 esc_url( 799 wp_nonce_url( 800 network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] ), 801 'spamblog_' . $blog['blog_id'] 802 ) 803 ), 804 _x( 'Spam', 'site' ) 805 ); 721 806 } 722 807 723 808 if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) { 724 $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] ), 'deleteblog_' . $blog['blog_id'] ) ) . '">' . __( 'Delete' ) . '</a>'; 725 } 726 } 727 728 $actions['visit'] = "<a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='bookmark'>" . __( 'Visit' ) . '</a>'; 809 $actions['delete'] = sprintf( 810 '<a href="%1$s">%2$s</a>', 811 esc_url( 812 wp_nonce_url( 813 network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] ), 814 'deleteblog_' . $blog['blog_id'] 815 ) 816 ), 817 __( 'Delete' ) 818 ); 819 } 820 } 821 822 $actions['visit'] = sprintf( 823 '<a href="%1$s" rel="bookmark">%2$s</a>', 824 esc_url( get_home_url( $blog['blog_id'], '/' ) ), 825 __( 'Visit' ) 826 ); 729 827 730 828 /**
Note: See TracChangeset
for help on using the changeset viewer.