Current File : /home/natitnen/crestassured.com/wp-admin/js/includes.tar |
class-wp-ms-sites-list-table.php 0000644 00000052735 15027563204 0012626 0 ustar 00 <?php
/**
* List Table API: WP_MS_Sites_List_Table class
*
* @package WordPress
* @subpackage Administration
* @since 3.1.0
*/
/**
* Core class used to implement displaying sites in a list table for the network admin.
*
* @since 3.1.0
*
* @see WP_List_Table
*/
class WP_MS_Sites_List_Table extends WP_List_Table {
/**
* Site status list.
*
* @since 4.3.0
* @var array
*/
public $status_list;
/**
* Constructor.
*
* @since 3.1.0
*
* @see WP_List_Table::__construct() for more information on default arguments.
*
* @param array $args An associative array of arguments.
*/
public function __construct( $args = array() ) {
$this->status_list = array(
'archived' => array( 'site-archived', __( 'Archived' ) ),
'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ),
'deleted' => array( 'site-deleted', __( 'Deleted' ) ),
'mature' => array( 'site-mature', __( 'Mature' ) ),
);
parent::__construct(
array(
'plural' => 'sites',
'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
)
);
}
/**
* @return bool
*/
public function ajax_user_can() {
return current_user_can( 'manage_sites' );
}
/**
* Prepares the list of sites for display.
*
* @since 3.1.0
*
* @global string $mode List table view mode.
* @global string $s
* @global wpdb $wpdb WordPress database abstraction object.
*/
public function prepare_items() {
global $mode, $s, $wpdb;
if ( ! empty( $_REQUEST['mode'] ) ) {
$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
set_user_setting( 'sites_list_mode', $mode );
} else {
$mode = get_user_setting( 'sites_list_mode', 'list' );
}
$per_page = $this->get_items_per_page( 'sites_network_per_page' );
$pagenum = $this->get_pagenum();
$s = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
$wild = '';
if ( str_contains( $s, '*' ) ) {
$wild = '*';
$s = trim( $s, '*' );
}
/*
* If the network is large and a search is not being performed, show only
* the latest sites with no paging in order to avoid expensive count queries.
*/
if ( ! $s && wp_is_large_network() ) {
if ( ! isset( $_REQUEST['orderby'] ) ) {
$_GET['orderby'] = '';
$_REQUEST['orderby'] = '';
}
if ( ! isset( $_REQUEST['order'] ) ) {
$_GET['order'] = 'DESC';
$_REQUEST['order'] = 'DESC';
}
}
$args = array(
'number' => (int) $per_page,
'offset' => (int) ( ( $pagenum - 1 ) * $per_page ),
'network_id' => get_current_network_id(),
);
if ( empty( $s ) ) {
// Nothing to do.
} elseif ( preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $s )
|| preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s )
|| preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s )
|| preg_match( '/^[0-9]{1,3}\.$/', $s )
) {
// IPv4 address.
$sql = $wpdb->prepare(
"SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE %s",
$wpdb->esc_like( $s ) . ( ! empty( $wild ) ? '%' : '' )
);
$reg_blog_ids = $wpdb->get_col( $sql );
if ( $reg_blog_ids ) {
$args['site__in'] = $reg_blog_ids;
}
} elseif ( is_numeric( $s ) && empty( $wild ) ) {
$args['ID'] = $s;
} else {
$args['search'] = $s;
if ( ! is_subdomain_install() ) {
$args['search_columns'] = array( 'path' );
}
}
$order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
if ( 'registered' === $order_by ) {
// 'registered' is a valid field name.
} elseif ( 'lastupdated' === $order_by ) {
$order_by = 'last_updated';
} elseif ( 'blogname' === $order_by ) {
if ( is_subdomain_install() ) {
$order_by = 'domain';
} else {
$order_by = 'path';
}
} elseif ( 'blog_id' === $order_by ) {
$order_by = 'id';
} elseif ( ! $order_by ) {
$order_by = false;
}
$args['orderby'] = $order_by;
if ( $order_by ) {
$args['order'] = ( isset( $_REQUEST['order'] ) && 'DESC' === strtoupper( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC';
}
if ( wp_is_large_network() ) {
$args['no_found_rows'] = true;
} else {
$args['no_found_rows'] = false;
}
// Take into account the role the user has selected.
$status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';
if ( in_array( $status, array( 'public', 'archived', 'mature', 'spam', 'deleted' ), true ) ) {
$args[ $status ] = 1;
}
/**
* Filters the arguments for the site query in the sites list table.
*
* @since 4.6.0
*
* @param array $args An array of get_sites() arguments.
*/
$args = apply_filters( 'ms_sites_list_table_query_args', $args );
$_sites = get_sites( $args );
if ( is_array( $_sites ) ) {
update_site_cache( $_sites );
$this->items = array_slice( $_sites, 0, $per_page );
}
$total_sites = get_sites(
array_merge(
$args,
array(
'count' => true,
'offset' => 0,
'number' => 0,
)
)
);
$this->set_pagination_args(
array(
'total_items' => $total_sites,
'per_page' => $per_page,
)
);
}
/**
*/
public function no_items() {
_e( 'No sites found.' );
}
/**
* Gets links to filter sites by status.
*
* @since 5.3.0
*
* @return array
*/
protected function get_views() {
$counts = wp_count_sites();
$statuses = array(
/* translators: %s: Number of sites. */
'all' => _nx_noop(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
'sites'
),
/* translators: %s: Number of sites. */
'public' => _n_noop(
'Public <span class="count">(%s)</span>',
'Public <span class="count">(%s)</span>'
),
/* translators: %s: Number of sites. */
'archived' => _n_noop(
'Archived <span class="count">(%s)</span>',
'Archived <span class="count">(%s)</span>'
),
/* translators: %s: Number of sites. */
'mature' => _n_noop(
'Mature <span class="count">(%s)</span>',
'Mature <span class="count">(%s)</span>'
),
/* translators: %s: Number of sites. */
'spam' => _nx_noop(
'Spam <span class="count">(%s)</span>',
'Spam <span class="count">(%s)</span>',
'sites'
),
/* translators: %s: Number of sites. */
'deleted' => _n_noop(
'Deleted <span class="count">(%s)</span>',
'Deleted <span class="count">(%s)</span>'
),
);
$view_links = array();
$requested_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';
$url = 'sites.php';
foreach ( $statuses as $status => $label_count ) {
if ( (int) $counts[ $status ] > 0 ) {
$label = sprintf(
translate_nooped_plural( $label_count, $counts[ $status ] ),
number_format_i18n( $counts[ $status ] )
);
$full_url = 'all' === $status ? $url : add_query_arg( 'status', $status, $url );
$view_links[ $status ] = array(
'url' => esc_url( $full_url ),
'label' => $label,
'current' => $requested_status === $status || ( '' === $requested_status && 'all' === $status ),
);
}
}
return $this->get_views_links( $view_links );
}
/**
* @return array
*/
protected function get_bulk_actions() {
$actions = array();
if ( current_user_can( 'delete_sites' ) ) {
$actions['delete'] = __( 'Delete' );
}
$actions['spam'] = _x( 'Mark as spam', 'site' );
$actions['notspam'] = _x( 'Not spam', 'site' );
return $actions;
}
/**
* @global string $mode List table view mode.
*
* @param string $which The location of the pagination nav markup: 'top' or 'bottom'.
*/
protected function pagination( $which ) {
global $mode;
parent::pagination( $which );
if ( 'top' === $which ) {
$this->view_switcher( $mode );
}
}
/**
* Displays extra controls between bulk actions and pagination.
*
* @since 5.3.0
*
* @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
*/
protected function extra_tablenav( $which ) {
?>
<div class="alignleft actions">
<?php
if ( 'top' === $which ) {
ob_start();
/**
* Fires before the Filter button on the MS sites list table.
*
* @since 5.3.0
*
* @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
*/
do_action( 'restrict_manage_sites', $which );
$output = ob_get_clean();
if ( ! empty( $output ) ) {
echo $output;
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'site-query-submit' ) );
}
}
?>
</div>
<?php
/**
* Fires immediately following the closing "actions" div in the tablenav for the
* MS sites list table.
*
* @since 5.3.0
*
* @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
*/
do_action( 'manage_sites_extra_tablenav', $which );
}
/**
* @return string[] Array of column titles keyed by their column name.
*/
public function get_columns() {
$sites_columns = array(
'cb' => '<input type="checkbox" />',
'blogname' => __( 'URL' ),
'lastupdated' => __( 'Last Updated' ),
'registered' => _x( 'Registered', 'site' ),
'users' => __( 'Users' ),
);
if ( has_filter( 'wpmublogsaction' ) ) {
$sites_columns['plugins'] = __( 'Actions' );
}
/**
* Filters the displayed site columns in Sites list table.
*
* @since MU (3.0.0)
*
* @param string[] $sites_columns An array of displayed site columns. Default 'cb',
* 'blogname', 'lastupdated', 'registered', 'users'.
*/
return apply_filters( 'wpmu_blogs_columns', $sites_columns );
}
/**
* @return array
*/
protected function get_sortable_columns() {
if ( is_subdomain_install() ) {
$blogname_abbr = __( 'Domain' );
$blogname_orderby_text = __( 'Table ordered by Site Domain Name.' );
} else {
$blogname_abbr = __( 'Path' );
$blogname_orderby_text = __( 'Table ordered by Site Path.' );
}
return array(
'blogname' => array( 'blogname', false, $blogname_abbr, $blogname_orderby_text ),
'lastupdated' => array( 'lastupdated', true, __( 'Last Updated' ), __( 'Table ordered by Last Updated.' ) ),
'registered' => array( 'blog_id', true, _x( 'Registered', 'site' ), __( 'Table ordered by Site Registered Date.' ), 'desc' ),
);
}
/**
* Handles the checkbox column output.
*
* @since 4.3.0
* @since 5.9.0 Renamed `$blog` to `$item` to match parent class for PHP 8 named parameter support.
*
* @param array $item Current site.
*/
public function column_cb( $item ) {
// Restores the more descriptive, specific name for use within this method.
$blog = $item;
if ( ! is_main_site( $blog['blog_id'] ) ) :
$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
?>
<input type="checkbox" id="blog_<?php echo $blog['blog_id']; ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ); ?>" />
<label for="blog_<?php echo $blog['blog_id']; ?>">
<span class="screen-reader-text">
<?php
/* translators: %s: Site URL. */
printf( __( 'Select %s' ), $blogname );
?>
</span>
</label>
<?php
endif;
}
/**
* Handles the ID column output.
*
* @since 4.4.0
*
* @param array $blog Current site.
*/
public function column_id( $blog ) {
echo $blog['blog_id'];
}
/**
* Handles the site name column output.
*
* @since 4.3.0
*
* @global string $mode List table view mode.
*
* @param array $blog Current site.
*/
public function column_blogname( $blog ) {
global $mode;
$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
?>
<strong>
<?php
printf(
'<a href="%1$s" class="edit">%2$s</a>',
esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ),
$blogname
);
$this->site_states( $blog );
?>
</strong>
<?php
if ( 'list' !== $mode ) {
switch_to_blog( $blog['blog_id'] );
echo '<p>';
printf(
/* translators: 1: Site title, 2: Site tagline. */
__( '%1$s – %2$s' ),
get_option( 'blogname' ),
'<em>' . get_option( 'blogdescription' ) . '</em>'
);
echo '</p>';
restore_current_blog();
}
}
/**
* Handles the lastupdated column output.
*
* @since 4.3.0
*
* @global string $mode List table view mode.
*
* @param array $blog Current site.
*/
public function column_lastupdated( $blog ) {
global $mode;
if ( 'list' === $mode ) {
$date = __( 'Y/m/d' );
} else {
$date = __( 'Y/m/d g:i:s a' );
}
if ( '0000-00-00 00:00:00' === $blog['last_updated'] ) {
_e( 'Never' );
} else {
echo mysql2date( $date, $blog['last_updated'] );
}
}
/**
* Handles the registered column output.
*
* @since 4.3.0
*
* @global string $mode List table view mode.
*
* @param array $blog Current site.
*/
public function column_registered( $blog ) {
global $mode;
if ( 'list' === $mode ) {
$date = __( 'Y/m/d' );
} else {
$date = __( 'Y/m/d g:i:s a' );
}
if ( '0000-00-00 00:00:00' === $blog['registered'] ) {
echo '—';
} else {
echo mysql2date( $date, $blog['registered'] );
}
}
/**
* Handles the users column output.
*
* @since 4.3.0
*
* @param array $blog Current site.
*/
public function column_users( $blog ) {
$user_count = wp_cache_get( $blog['blog_id'] . '_user_count', 'blog-details' );
if ( ! $user_count ) {
$blog_users = new WP_User_Query(
array(
'blog_id' => $blog['blog_id'],
'fields' => 'ID',
'number' => 1,
'count_total' => true,
)
);
$user_count = $blog_users->get_total();
wp_cache_set( $blog['blog_id'] . '_user_count', $user_count, 'blog-details', 12 * HOUR_IN_SECONDS );
}
printf(
'<a href="%1$s">%2$s</a>',
esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ),
number_format_i18n( $user_count )
);
}
/**
* Handles the plugins column output.
*
* @since 4.3.0
*
* @param array $blog Current site.
*/
public function column_plugins( $blog ) {
if ( has_filter( 'wpmublogsaction' ) ) {
/**
* Fires inside the auxiliary 'Actions' column of the Sites list table.
*
* By default this column is hidden unless something is hooked to the action.
*
* @since MU (3.0.0)
*
* @param int $blog_id The site ID.
*/
do_action( 'wpmublogsaction', $blog['blog_id'] );
}
}
/**
* Handles output for the default column.
*
* @since 4.3.0
* @since 5.9.0 Renamed `$blog` to `$item` to match parent class for PHP 8 named parameter support.
*
* @param array $item Current site.
* @param string $column_name Current column name.
*/
public function column_default( $item, $column_name ) {
// Restores the more descriptive, specific name for use within this method.
$blog = $item;
/**
* Fires for each registered custom column in the Sites list table.
*
* @since 3.1.0
*
* @param string $column_name The name of the column to display.
* @param int $blog_id The site ID.
*/
do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
}
/**
* @global string $mode List table view mode.
*/
public function display_rows() {
foreach ( $this->items as $blog ) {
$blog = $blog->to_array();
$class = '';
reset( $this->status_list );
foreach ( $this->status_list as $status => $col ) {
if ( '1' === $blog[ $status ] ) {
$class = " class='{$col[0]}'";
}
}
echo "<tr{$class}>";
$this->single_row_columns( $blog );
echo '</tr>';
}
}
/**
* Determines whether to output comma-separated site states.
*
* @since 5.3.0
*
* @param array $site
*/
protected function site_states( $site ) {
$site_states = array();
// $site is still an array, so get the object.
$_site = WP_Site::get_instance( $site['blog_id'] );
if ( is_main_site( $_site->id ) ) {
$site_states['main'] = __( 'Main' );
}
reset( $this->status_list );
$site_status = isset( $_REQUEST['status'] ) ? wp_unslash( trim( $_REQUEST['status'] ) ) : '';
foreach ( $this->status_list as $status => $col ) {
if ( '1' === $_site->{$status} && $site_status !== $status ) {
$site_states[ $col[0] ] = $col[1];
}
}
/**
* Filters the default site display states for items in the Sites list table.
*
* @since 5.3.0
*
* @param string[] $site_states An array of site states. Default 'Main',
* 'Archived', 'Mature', 'Spam', 'Deleted'.
* @param WP_Site $site The current site object.
*/
$site_states = apply_filters( 'display_site_states', $site_states, $_site );
if ( ! empty( $site_states ) ) {
$state_count = count( $site_states );
$i = 0;
echo ' — ';
foreach ( $site_states as $state ) {
++$i;
$separator = ( $i < $state_count ) ? ', ' : '';
echo "<span class='post-state'>{$state}{$separator}</span>";
}
}
}
/**
* Gets the name of the default primary column.
*
* @since 4.3.0
*
* @return string Name of the default primary column, in this case, 'blogname'.
*/
protected function get_default_primary_column_name() {
return 'blogname';
}
/**
* Generates and displays row action links.
*
* @since 4.3.0
* @since 5.9.0 Renamed `$blog` to `$item` to match parent class for PHP 8 named parameter support.
*
* @param array $item Site being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output for sites in Multisite, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $item, $column_name, $primary ) {
if ( $primary !== $column_name ) {
return '';
}
// Restores the more descriptive, specific name for use within this method.
$blog = $item;
$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
// Preordered.
$actions = array(
'edit' => '',
'backend' => '',
'activate' => '',
'deactivate' => '',
'archive' => '',
'unarchive' => '',
'spam' => '',
'unspam' => '',
'delete' => '',
'visit' => '',
);
$actions['edit'] = sprintf(
'<a href="%1$s">%2$s</a>',
esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ),
__( 'Edit' )
);
$actions['backend'] = sprintf(
'<a href="%1$s" class="edit">%2$s</a>',
esc_url( get_admin_url( $blog['blog_id'] ) ),
__( 'Dashboard' )
);
if ( ! is_main_site( $blog['blog_id'] ) ) {
if ( '1' === $blog['deleted'] ) {
$actions['activate'] = sprintf(
'<a href="%1$s">%2$s</a>',
esc_url(
wp_nonce_url(
network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] ),
'activateblog_' . $blog['blog_id']
)
),
__( 'Activate' )
);
} else {
$actions['deactivate'] = sprintf(
'<a href="%1$s">%2$s</a>',
esc_url(
wp_nonce_url(
network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] ),
'deactivateblog_' . $blog['blog_id']
)
),
__( 'Deactivate' )
);
}
if ( '1' === $blog['archived'] ) {
$actions['unarchive'] = sprintf(
'<a href="%1$s">%2$s</a>',
esc_url(
wp_nonce_url(
network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] ),
'unarchiveblog_' . $blog['blog_id']
)
),
__( 'Unarchive' )
);
} else {
$actions['archive'] = sprintf(
'<a href="%1$s">%2$s</a>',
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' )
);
}
if ( '1' === $blog['spam'] ) {
$actions['unspam'] = sprintf(
'<a href="%1$s">%2$s</a>',
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' )
);
} else {
$actions['spam'] = sprintf(
'<a href="%1$s">%2$s</a>',
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' )
);
}
if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) {
$actions['delete'] = sprintf(
'<a href="%1$s">%2$s</a>',
esc_url(
wp_nonce_url(
network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] ),
'deleteblog_' . $blog['blog_id']
)
),
__( 'Delete' )
);
}
}
$actions['visit'] = sprintf(
'<a href="%1$s" rel="bookmark">%2$s</a>',
esc_url( get_home_url( $blog['blog_id'], '/' ) ),
__( 'Visit' )
);
/**
* Filters the action links displayed for each site in the Sites list table.
*
* The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
* default for each site. The site's status determines whether to show the
* 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
* 'Not Spam' or 'Spam' link for each site.
*
* @since 3.1.0
*
* @param string[] $actions An array of action links to be displayed.
* @param int $blog_id The site ID.
* @param string $blogname Site path, formatted depending on whether it is a sub-domain
* or subdirectory multisite installation.
*/
$actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
return $this->row_actions( $actions );
}
}
class-bulk-plugin-upgrader-skin.php.php.tar.gz 0000644 00000002020 15027563205 0015353 0 ustar 00 � �VMo�8�U���
فmٱ�n�m{��Zh�=�@K�M�"��7�d�NsYt?�|1ə7��q���i$�aFP%�jC�.Mlj̣m1"i�D�D�˔�(�?Z��~T�r�Ĩ,֊�T��=�bS�:� ��|~���������lzq>������� L�<~��X�B��?h�?c�:��iN��$���m����q\�ğ���4���mA�{���T�5�G�U]���ׯ��(��� ��:5��KÁeR�b��:w6���-� h
F3�C2N!S2����[��V�;0J=;-Z\=�����T?�_;��� DU&���x��pt��71�r� �f#S�2�m�̆i��l�ٸ���Q�ZZ
#������Sb��J�&�.��DQ�<�ڣc�LxI�G]Q�ya�e �]g��zt8�Ō:AQ�8K�[!��<D���s������Zc�_;APE�Y,Z;op#:��М����:kAr:��|,�
Mf{�
a��i�l�-��a|(�G�+!�Z�G�F0�*���J'^Q�0��O���L����>��v�ƬR�M����n�f�t���۞6��)���.�nN�l6dy�~u!C�"mw�հ׆���:a�#����o<_s�R|�r��Ld)��=��z�{a2)-��;V{A�B!�U7�ĭ���q�C.��%� 1��
�KE����>|c�~]���d�ӗY�CwVS��nť�M5n�`I��S˯�α�J�y`�����Cr�G ��{y�����(CO+N�>�I��k����q,���+ߤ��b�Zr�nC�� /��_ǖjw�9���g�Ž�@'+�(H����ڊ����u��&p�08|p�����ݗ�l��<i�1n��S�5њvA�����+�h3���n�՜:V3���8�4=��E�y���ӝ[8<�j���V�݃pԻ]o+���t�_
}`�)�A��D�;:OE��߷ο�1�b/�b/�?�� ��� update.php 0000644 00000105520 15027563205 0006547 0 ustar 00 <?php
/**
* WordPress Administration Update API
*
* @package WordPress
* @subpackage Administration
*/
/**
* Selects the first update version from the update_core option.
*
* @since 2.7.0
*
* @return object|array|false The response from the API on success, false on failure.
*/
function get_preferred_from_update_core() {
$updates = get_core_updates();
if ( ! is_array( $updates ) ) {
return false;
}
if ( empty( $updates ) ) {
return (object) array( 'response' => 'latest' );
}
return $updates[0];
}
/**
* Gets available core updates.
*
* @since 2.7.0
*
* @param array $options Set $options['dismissed'] to true to show dismissed upgrades too,
* set $options['available'] to false to skip not-dismissed updates.
* @return array|false Array of the update objects on success, false on failure.
*/
function get_core_updates( $options = array() ) {
$options = array_merge(
array(
'available' => true,
'dismissed' => false,
),
$options
);
$dismissed = get_site_option( 'dismissed_update_core' );
if ( ! is_array( $dismissed ) ) {
$dismissed = array();
}
$from_api = get_site_transient( 'update_core' );
if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {
return false;
}
$updates = $from_api->updates;
$result = array();
foreach ( $updates as $update ) {
if ( 'autoupdate' === $update->response ) {
continue;
}
if ( array_key_exists( $update->current . '|' . $update->locale, $dismissed ) ) {
if ( $options['dismissed'] ) {
$update->dismissed = true;
$result[] = $update;
}
} else {
if ( $options['available'] ) {
$update->dismissed = false;
$result[] = $update;
}
}
}
return $result;
}
/**
* Gets the best available (and enabled) Auto-Update for WordPress core.
*
* If there's 1.2.3 and 1.3 on offer, it'll choose 1.3 if the installation allows it, else, 1.2.3.
*
* @since 3.7.0
*
* @return object|false The core update offering on success, false on failure.
*/
function find_core_auto_update() {
$updates = get_site_transient( 'update_core' );
if ( ! $updates || empty( $updates->updates ) ) {
return false;
}
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$auto_update = false;
$upgrader = new WP_Automatic_Updater();
foreach ( $updates->updates as $update ) {
if ( 'autoupdate' !== $update->response ) {
continue;
}
if ( ! $upgrader->should_update( 'core', $update, ABSPATH ) ) {
continue;
}
if ( ! $auto_update || version_compare( $update->current, $auto_update->current, '>' ) ) {
$auto_update = $update;
}
}
return $auto_update;
}
/**
* Gets and caches the checksums for the given version of WordPress.
*
* @since 3.7.0
*
* @param string $version Version string to query.
* @param string $locale Locale to query.
* @return array|false An array of checksums on success, false on failure.
*/
function get_core_checksums( $version, $locale ) {
$http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), '', '&' );
$url = $http_url;
$ssl = wp_http_supports( array( 'ssl' ) );
if ( $ssl ) {
$url = set_url_scheme( $url, 'https' );
}
$options = array(
'timeout' => wp_doing_cron() ? 30 : 3,
);
$response = wp_remote_get( $url, $options );
if ( $ssl && is_wp_error( $response ) ) {
trigger_error(
sprintf(
/* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
__( 'https://wordpress.org/support/forums/' )
) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ),
headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
);
$response = wp_remote_get( $http_url, $options );
}
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
return false;
}
$body = trim( wp_remote_retrieve_body( $response ) );
$body = json_decode( $body, true );
if ( ! is_array( $body ) || ! isset( $body['checksums'] ) || ! is_array( $body['checksums'] ) ) {
return false;
}
return $body['checksums'];
}
/**
* Dismisses core update.
*
* @since 2.7.0
*
* @param object $update
* @return bool
*/
function dismiss_core_update( $update ) {
$dismissed = get_site_option( 'dismissed_update_core' );
$dismissed[ $update->current . '|' . $update->locale ] = true;
return update_site_option( 'dismissed_update_core', $dismissed );
}
/**
* Undismisses core update.
*
* @since 2.7.0
*
* @param string $version
* @param string $locale
* @return bool
*/
function undismiss_core_update( $version, $locale ) {
$dismissed = get_site_option( 'dismissed_update_core' );
$key = $version . '|' . $locale;
if ( ! isset( $dismissed[ $key ] ) ) {
return false;
}
unset( $dismissed[ $key ] );
return update_site_option( 'dismissed_update_core', $dismissed );
}
/**
* Finds the available update for WordPress core.
*
* @since 2.7.0
*
* @param string $version Version string to find the update for.
* @param string $locale Locale to find the update for.
* @return object|false The core update offering on success, false on failure.
*/
function find_core_update( $version, $locale ) {
$from_api = get_site_transient( 'update_core' );
if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {
return false;
}
$updates = $from_api->updates;
foreach ( $updates as $update ) {
if ( $update->current === $version && $update->locale === $locale ) {
return $update;
}
}
return false;
}
/**
* Returns core update footer message.
*
* @since 2.3.0
*
* @param string $msg
* @return string
*/
function core_update_footer( $msg = '' ) {
if ( ! current_user_can( 'update_core' ) ) {
/* translators: %s: WordPress version. */
return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
}
$cur = get_preferred_from_update_core();
if ( ! is_object( $cur ) ) {
$cur = new stdClass();
}
if ( ! isset( $cur->current ) ) {
$cur->current = '';
}
if ( ! isset( $cur->response ) ) {
$cur->response = '';
}
// Include an unmodified $wp_version.
require ABSPATH . WPINC . '/version.php';
$is_development_version = preg_match( '/alpha|beta|RC/', $wp_version );
if ( $is_development_version ) {
return sprintf(
/* translators: 1: WordPress version number, 2: URL to WordPress Updates screen. */
__( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ),
get_bloginfo( 'version', 'display' ),
network_admin_url( 'update-core.php' )
);
}
switch ( $cur->response ) {
case 'upgrade':
return sprintf(
'<strong><a href="%s">%s</a></strong>',
network_admin_url( 'update-core.php' ),
/* translators: %s: WordPress version. */
sprintf( __( 'Get Version %s' ), $cur->current )
);
case 'latest':
default:
/* translators: %s: WordPress version. */
return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
}
}
/**
* Returns core update notification message.
*
* @since 2.3.0
*
* @global string $pagenow The filename of the current screen.
* @return void|false
*/
function update_nag() {
global $pagenow;
if ( is_multisite() && ! current_user_can( 'update_core' ) ) {
return false;
}
if ( 'update-core.php' === $pagenow ) {
return;
}
$cur = get_preferred_from_update_core();
if ( ! isset( $cur->response ) || 'upgrade' !== $cur->response ) {
return false;
}
$version_url = sprintf(
/* translators: %s: WordPress version. */
esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
sanitize_title( $cur->current )
);
if ( current_user_can( 'update_core' ) ) {
$msg = sprintf(
/* translators: 1: URL to WordPress release notes, 2: New WordPress version, 3: URL to network admin, 4: Accessibility text. */
__( '<a href="%1$s">WordPress %2$s</a> is available! <a href="%3$s" aria-label="%4$s">Please update now</a>.' ),
$version_url,
$cur->current,
network_admin_url( 'update-core.php' ),
esc_attr__( 'Please update WordPress now' )
);
} else {
$msg = sprintf(
/* translators: 1: URL to WordPress release notes, 2: New WordPress version. */
__( '<a href="%1$s">WordPress %2$s</a> is available! Please notify the site administrator.' ),
$version_url,
$cur->current
);
}
wp_admin_notice(
$msg,
array(
'type' => 'warning',
'additional_classes' => array( 'update-nag', 'inline' ),
'paragraph_wrap' => false,
)
);
}
/**
* Displays WordPress version and active theme in the 'At a Glance' dashboard widget.
*
* @since 2.5.0
*/
function update_right_now_message() {
$theme_name = wp_get_theme();
if ( current_user_can( 'switch_themes' ) ) {
$theme_name = sprintf( '<a href="themes.php">%1$s</a>', $theme_name );
}
$msg = '';
if ( current_user_can( 'update_core' ) ) {
$cur = get_preferred_from_update_core();
if ( isset( $cur->response ) && 'upgrade' === $cur->response ) {
$msg .= sprintf(
'<a href="%s" class="button" aria-describedby="wp-version">%s</a> ',
network_admin_url( 'update-core.php' ),
/* translators: %s: WordPress version number, or 'Latest' string. */
sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) )
);
}
}
/* translators: 1: Version number, 2: Theme name. */
$content = __( 'WordPress %1$s running %2$s theme.' );
/**
* Filters the text displayed in the 'At a Glance' dashboard widget.
*
* Prior to 3.8.0, the widget was named 'Right Now'.
*
* @since 4.4.0
*
* @param string $content Default text.
*/
$content = apply_filters( 'update_right_now_text', $content );
$msg .= sprintf( '<span id="wp-version">' . $content . '</span>', get_bloginfo( 'version', 'display' ), $theme_name );
echo "<p id='wp-version-message'>$msg</p>";
}
/**
* Retrieves plugins with updates available.
*
* @since 2.9.0
*
* @return array
*/
function get_plugin_updates() {
$all_plugins = get_plugins();
$upgrade_plugins = array();
$current = get_site_transient( 'update_plugins' );
foreach ( (array) $all_plugins as $plugin_file => $plugin_data ) {
if ( isset( $current->response[ $plugin_file ] ) ) {
$upgrade_plugins[ $plugin_file ] = (object) $plugin_data;
$upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];
}
}
return $upgrade_plugins;
}
/**
* Adds a callback to display update information for plugins with updates available.
*
* @since 2.9.0
*/
function wp_plugin_update_rows() {
if ( ! current_user_can( 'update_plugins' ) ) {
return;
}
$plugins = get_site_transient( 'update_plugins' );
if ( isset( $plugins->response ) && is_array( $plugins->response ) ) {
$plugins = array_keys( $plugins->response );
foreach ( $plugins as $plugin_file ) {
add_action( "after_plugin_row_{$plugin_file}", 'wp_plugin_update_row', 10, 2 );
}
}
}
/**
* Displays update information for a plugin.
*
* @since 2.3.0
*
* @param string $file Plugin basename.
* @param array $plugin_data Plugin information.
* @return void|false
*/
function wp_plugin_update_row( $file, $plugin_data ) {
$current = get_site_transient( 'update_plugins' );
if ( ! isset( $current->response[ $file ] ) ) {
return false;
}
$response = $current->response[ $file ];
$plugins_allowedtags = array(
'a' => array(
'href' => array(),
'title' => array(),
),
'abbr' => array( 'title' => array() ),
'acronym' => array( 'title' => array() ),
'code' => array(),
'em' => array(),
'strong' => array(),
);
$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
$plugin_slug = isset( $response->slug ) ? $response->slug : $response->id;
if ( isset( $response->slug ) ) {
$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '§ion=changelog' );
} elseif ( isset( $response->url ) ) {
$details_url = $response->url;
} else {
$details_url = $plugin_data['PluginURI'];
}
$details_url = add_query_arg(
array(
'TB_iframe' => 'true',
'width' => 600,
'height' => 800,
),
$details_url
);
/** @var WP_Plugins_List_Table $wp_list_table */
$wp_list_table = _get_list_table(
'WP_Plugins_List_Table',
array(
'screen' => get_current_screen(),
)
);
if ( is_network_admin() || ! is_multisite() ) {
if ( is_network_admin() ) {
$active_class = is_plugin_active_for_network( $file ) ? ' active' : '';
} else {
$active_class = is_plugin_active( $file ) ? ' active' : '';
}
$requires_php = isset( $response->requires_php ) ? $response->requires_php : null;
$compatible_php = is_php_version_compatible( $requires_php );
$notice_type = $compatible_php ? 'notice-warning' : 'notice-error';
printf(
'<tr class="plugin-update-tr%s" id="%s" data-slug="%s" data-plugin="%s">' .
'<td colspan="%s" class="plugin-update colspanchange">' .
'<div class="update-message notice inline %s notice-alt"><p>',
$active_class,
esc_attr( $plugin_slug . '-update' ),
esc_attr( $plugin_slug ),
esc_attr( $file ),
esc_attr( $wp_list_table->get_column_count() ),
$notice_type
);
if ( ! current_user_can( 'update_plugins' ) ) {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
$plugin_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version )
);
} elseif ( empty( $response->package ) ) {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>' ),
$plugin_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version )
);
} else {
if ( $compatible_php ) {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
$plugin_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version ),
wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file, 'upgrade-plugin_' . $file ),
sprintf(
'class="update-link" aria-label="%s"',
/* translators: %s: Plugin name. */
esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $plugin_name ) )
)
);
} else {
printf(
/* translators: 1: Plugin name, 2: Details URL, 3: Additional link attributes, 4: Version number 5: URL to Update PHP page. */
__( 'There is a new version of %1$s available, but it does not work with your version of PHP. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s">learn more about updating PHP</a>.' ),
$plugin_name,
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Plugin name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_name, $response->new_version ) )
),
esc_attr( $response->new_version ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '<br><em>', '</em>' );
}
}
/**
* Fires at the end of the update message container in each
* row of the plugins list table.
*
* The dynamic portion of the hook name, `$file`, refers to the path
* of the plugin's primary file relative to the plugins directory.
*
* @since 2.8.0
*
* @param array $plugin_data An array of plugin metadata. See get_plugin_data()
* and the {@see 'plugin_row_meta'} filter for the list
* of possible values.
* @param object $response {
* An object of metadata about the available plugin update.
*
* @type string $id Plugin ID, e.g. `w.org/plugins/[plugin-name]`.
* @type string $slug Plugin slug.
* @type string $plugin Plugin basename.
* @type string $new_version New plugin version.
* @type string $url Plugin URL.
* @type string $package Plugin update package URL.
* @type string[] $icons An array of plugin icon URLs.
* @type string[] $banners An array of plugin banner URLs.
* @type string[] $banners_rtl An array of plugin RTL banner URLs.
* @type string $requires The version of WordPress which the plugin requires.
* @type string $tested The version of WordPress the plugin is tested against.
* @type string $requires_php The version of PHP which the plugin requires.
* }
*/
do_action( "in_plugin_update_message-{$file}", $plugin_data, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
echo '</p></div></td></tr>';
}
}
/**
* Retrieves themes with updates available.
*
* @since 2.9.0
*
* @return array
*/
function get_theme_updates() {
$current = get_site_transient( 'update_themes' );
if ( ! isset( $current->response ) ) {
return array();
}
$update_themes = array();
foreach ( $current->response as $stylesheet => $data ) {
$update_themes[ $stylesheet ] = wp_get_theme( $stylesheet );
$update_themes[ $stylesheet ]->update = $data;
}
return $update_themes;
}
/**
* Adds a callback to display update information for themes with updates available.
*
* @since 3.1.0
*/
function wp_theme_update_rows() {
if ( ! current_user_can( 'update_themes' ) ) {
return;
}
$themes = get_site_transient( 'update_themes' );
if ( isset( $themes->response ) && is_array( $themes->response ) ) {
$themes = array_keys( $themes->response );
foreach ( $themes as $theme ) {
add_action( "after_theme_row_{$theme}", 'wp_theme_update_row', 10, 2 );
}
}
}
/**
* Displays update information for a theme.
*
* @since 3.1.0
*
* @param string $theme_key Theme stylesheet.
* @param WP_Theme $theme Theme object.
* @return void|false
*/
function wp_theme_update_row( $theme_key, $theme ) {
$current = get_site_transient( 'update_themes' );
if ( ! isset( $current->response[ $theme_key ] ) ) {
return false;
}
$response = $current->response[ $theme_key ];
$details_url = add_query_arg(
array(
'TB_iframe' => 'true',
'width' => 1024,
'height' => 800,
),
$current->response[ $theme_key ]['url']
);
/** @var WP_MS_Themes_List_Table $wp_list_table */
$wp_list_table = _get_list_table( 'WP_MS_Themes_List_Table' );
$active = $theme->is_allowed( 'network' ) ? ' active' : '';
$requires_wp = isset( $response['requires'] ) ? $response['requires'] : null;
$requires_php = isset( $response['requires_php'] ) ? $response['requires_php'] : null;
$compatible_wp = is_wp_version_compatible( $requires_wp );
$compatible_php = is_php_version_compatible( $requires_php );
printf(
'<tr class="plugin-update-tr%s" id="%s" data-slug="%s">' .
'<td colspan="%s" class="plugin-update colspanchange">' .
'<div class="update-message notice inline notice-warning notice-alt"><p>',
$active,
esc_attr( $theme->get_stylesheet() . '-update' ),
esc_attr( $theme->get_stylesheet() ),
$wp_list_table->get_column_count()
);
if ( $compatible_wp && $compatible_php ) {
if ( ! current_user_can( 'update_themes' ) ) {
printf(
/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.' ),
$theme['Name'],
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Theme name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
),
$response['new_version']
);
} elseif ( empty( $response['package'] ) ) {
printf(
/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ),
$theme['Name'],
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Theme name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
),
$response['new_version']
);
} else {
printf(
/* translators: 1: Theme name, 2: Details URL, 3: Additional link attributes, 4: Version number, 5: Update URL, 6: Additional link attributes. */
__( 'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.' ),
$theme['Name'],
esc_url( $details_url ),
sprintf(
'class="thickbox open-plugin-details-modal" aria-label="%s"',
/* translators: 1: Theme name, 2: Version number. */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $theme['Name'], $response['new_version'] ) )
),
$response['new_version'],
wp_nonce_url( self_admin_url( 'update.php?action=upgrade-theme&theme=' ) . $theme_key, 'upgrade-theme_' . $theme_key ),
sprintf(
'class="update-link" aria-label="%s"',
/* translators: %s: Theme name. */
esc_attr( sprintf( _x( 'Update %s now', 'theme' ), $theme['Name'] ) )
)
);
}
} else {
if ( ! $compatible_wp && ! $compatible_php ) {
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ),
$theme['Name']
);
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
);
} elseif ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
}
} elseif ( ! $compatible_wp ) {
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it does not work with your version of WordPress.' ),
$theme['Name']
);
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
);
}
} elseif ( ! $compatible_php ) {
printf(
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it does not work with your version of PHP.' ),
$theme['Name']
);
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
}
}
}
/**
* Fires at the end of the update message container in each
* row of the themes list table.
*
* The dynamic portion of the hook name, `$theme_key`, refers to
* the theme slug as found in the WordPress.org themes repository.
*
* @since 3.1.0
*
* @param WP_Theme $theme The WP_Theme object.
* @param array $response {
* An array of metadata about the available theme update.
*
* @type string $new_version New theme version.
* @type string $url Theme URL.
* @type string $package Theme update package URL.
* }
*/
do_action( "in_theme_update_message-{$theme_key}", $theme, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
echo '</p></div></td></tr>';
}
/**
* Displays maintenance nag HTML message.
*
* @since 2.7.0
*
* @global int $upgrading
*
* @return void|false
*/
function maintenance_nag() {
// Include an unmodified $wp_version.
require ABSPATH . WPINC . '/version.php';
global $upgrading;
$nag = isset( $upgrading );
if ( ! $nag ) {
$failed = get_site_option( 'auto_core_update_failed' );
/*
* If an update failed critically, we may have copied over version.php but not other files.
* In that case, if the installation claims we're running the version we attempted, nag.
* This is serious enough to err on the side of nagging.
*
* If we simply failed to update before we tried to copy any files, then assume things are
* OK if they are now running the latest.
*
* This flag is cleared whenever a successful update occurs using Core_Upgrader.
*/
$comparison = ! empty( $failed['critical'] ) ? '>=' : '>';
if ( isset( $failed['attempted'] ) && version_compare( $failed['attempted'], $wp_version, $comparison ) ) {
$nag = true;
}
}
if ( ! $nag ) {
return false;
}
if ( current_user_can( 'update_core' ) ) {
$msg = sprintf(
/* translators: %s: URL to WordPress Updates screen. */
__( 'An automated WordPress update has failed to complete - <a href="%s">please attempt the update again now</a>.' ),
'update-core.php'
);
} else {
$msg = __( 'An automated WordPress update has failed to complete! Please notify the site administrator.' );
}
wp_admin_notice(
$msg,
array(
'type' => 'warning',
'additional_classes' => array( 'update-nag', 'inline' ),
'paragraph_wrap' => false,
)
);
}
/**
* Prints the JavaScript templates for update admin notices.
*
* @since 4.6.0
*
* Template takes one argument with four values:
*
* param {object} data {
* Arguments for admin notice.
*
* @type string id ID of the notice.
* @type string className Class names for the notice.
* @type string message The notice's message.
* @type string type The type of update the notice is for. Either 'plugin' or 'theme'.
* }
*/
function wp_print_admin_notice_templates() {
?>
<script id="tmpl-wp-updates-admin-notice" type="text/html">
<div <# if ( data.id ) { #>id="{{ data.id }}"<# } #> class="notice {{ data.className }}"><p>{{{ data.message }}}</p></div>
</script>
<script id="tmpl-wp-bulk-updates-admin-notice" type="text/html">
<div id="{{ data.id }}" class="{{ data.className }} notice <# if ( data.errors ) { #>notice-error<# } else { #>notice-success<# } #>">
<p>
<# if ( data.successes ) { #>
<# if ( 1 === data.successes ) { #>
<# if ( 'plugin' === data.type ) { #>
<?php
/* translators: %s: Number of plugins. */
printf( __( '%s plugin successfully updated.' ), '{{ data.successes }}' );
?>
<# } else { #>
<?php
/* translators: %s: Number of themes. */
printf( __( '%s theme successfully updated.' ), '{{ data.successes }}' );
?>
<# } #>
<# } else { #>
<# if ( 'plugin' === data.type ) { #>
<?php
/* translators: %s: Number of plugins. */
printf( __( '%s plugins successfully updated.' ), '{{ data.successes }}' );
?>
<# } else { #>
<?php
/* translators: %s: Number of themes. */
printf( __( '%s themes successfully updated.' ), '{{ data.successes }}' );
?>
<# } #>
<# } #>
<# } #>
<# if ( data.errors ) { #>
<button class="button-link bulk-action-errors-collapsed" aria-expanded="false">
<# if ( 1 === data.errors ) { #>
<?php
/* translators: %s: Number of failed updates. */
printf( __( '%s update failed.' ), '{{ data.errors }}' );
?>
<# } else { #>
<?php
/* translators: %s: Number of failed updates. */
printf( __( '%s updates failed.' ), '{{ data.errors }}' );
?>
<# } #>
<span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
_e( 'Show more details' );
?>
</span>
<span class="toggle-indicator" aria-hidden="true"></span>
</button>
<# } #>
</p>
<# if ( data.errors ) { #>
<ul class="bulk-action-errors hidden">
<# _.each( data.errorMessages, function( errorMessage ) { #>
<li>{{ errorMessage }}</li>
<# } ); #>
</ul>
<# } #>
</div>
</script>
<?php
}
/**
* Prints the JavaScript templates for update and deletion rows in list tables.
*
* @since 4.6.0
*
* The update template takes one argument with four values:
*
* param {object} data {
* Arguments for the update row
*
* @type string slug Plugin slug.
* @type string plugin Plugin base name.
* @type string colspan The number of table columns this row spans.
* @type string content The row content.
* }
*
* The delete template takes one argument with four values:
*
* param {object} data {
* Arguments for the update row
*
* @type string slug Plugin slug.
* @type string plugin Plugin base name.
* @type string name Plugin name.
* @type string colspan The number of table columns this row spans.
* }
*/
function wp_print_update_row_templates() {
?>
<script id="tmpl-item-update-row" type="text/template">
<tr class="plugin-update-tr update" id="{{ data.slug }}-update" data-slug="{{ data.slug }}" <# if ( data.plugin ) { #>data-plugin="{{ data.plugin }}"<# } #>>
<td colspan="{{ data.colspan }}" class="plugin-update colspanchange">
{{{ data.content }}}
</td>
</tr>
</script>
<script id="tmpl-item-deleted-row" type="text/template">
<tr class="plugin-deleted-tr inactive deleted" id="{{ data.slug }}-deleted" data-slug="{{ data.slug }}" <# if ( data.plugin ) { #>data-plugin="{{ data.plugin }}"<# } #>>
<td colspan="{{ data.colspan }}" class="plugin-update colspanchange">
<# if ( data.plugin ) { #>
<?php
printf(
/* translators: %s: Plugin name. */
_x( '%s was successfully deleted.', 'plugin' ),
'<strong>{{{ data.name }}}</strong>'
);
?>
<# } else { #>
<?php
printf(
/* translators: %s: Theme name. */
_x( '%s was successfully deleted.', 'theme' ),
'<strong>{{{ data.name }}}</strong>'
);
?>
<# } #>
</td>
</tr>
</script>
<?php
}
/**
* Displays a notice when the user is in recovery mode.
*
* @since 5.2.0
*/
function wp_recovery_mode_nag() {
if ( ! wp_is_recovery_mode() ) {
return;
}
$url = wp_login_url();
$url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url );
$url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION );
$message = sprintf(
/* translators: %s: Recovery Mode exit link. */
__( 'You are in recovery mode. This means there may be an error with a theme or plugin. To exit recovery mode, log out or use the Exit button. <a href="%s">Exit Recovery Mode</a>' ),
esc_url( $url )
);
wp_admin_notice( $message, array( 'type' => 'info' ) );
}
/**
* Checks whether auto-updates are enabled.
*
* @since 5.5.0
*
* @param string $type The type of update being checked: 'theme' or 'plugin'.
* @return bool True if auto-updates are enabled for `$type`, false otherwise.
*/
function wp_is_auto_update_enabled_for_type( $type ) {
if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php';
}
$updater = new WP_Automatic_Updater();
$enabled = ! $updater->is_disabled();
switch ( $type ) {
case 'plugin':
/**
* Filters whether plugins auto-update is enabled.
*
* @since 5.5.0
*
* @param bool $enabled True if plugins auto-update is enabled, false otherwise.
*/
return apply_filters( 'plugins_auto_update_enabled', $enabled );
case 'theme':
/**
* Filters whether themes auto-update is enabled.
*
* @since 5.5.0
*
* @param bool $enabled True if themes auto-update is enabled, false otherwise.
*/
return apply_filters( 'themes_auto_update_enabled', $enabled );
}
return false;
}
/**
* Checks whether auto-updates are forced for an item.
*
* @since 5.6.0
*
* @param string $type The type of update being checked: 'theme' or 'plugin'.
* @param bool|null $update Whether to update. The value of null is internally used
* to detect whether nothing has hooked into this filter.
* @param object $item The update offer.
* @return bool True if auto-updates are forced for `$item`, false otherwise.
*/
function wp_is_auto_update_forced_for_item( $type, $update, $item ) {
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
return apply_filters( "auto_update_{$type}", $update, $item );
}
/**
* Determines the appropriate auto-update message to be displayed.
*
* @since 5.5.0
*
* @return string The update message to be shown.
*/
function wp_get_auto_update_message() {
$next_update_time = wp_next_scheduled( 'wp_version_check' );
// Check if the event exists.
if ( false === $next_update_time ) {
$message = __( 'Automatic update not scheduled. There may be a problem with WP-Cron.' );
} else {
$time_to_next_update = human_time_diff( (int) $next_update_time );
// See if cron is overdue.
$overdue = ( time() - $next_update_time ) > 0;
if ( $overdue ) {
$message = sprintf(
/* translators: %s: Duration that WP-Cron has been overdue. */
__( 'Automatic update overdue by %s. There may be a problem with WP-Cron.' ),
$time_to_next_update
);
} else {
$message = sprintf(
/* translators: %s: Time until the next update. */
__( 'Automatic update scheduled in %s.' ),
$time_to_next_update
);
}
}
return $message;
}
class-wp-ms-users-list-table.php 0000644 00000035514 15027563205 0012635 0 ustar 00 <?php
/**
* List Table API: WP_MS_Users_List_Table class
*
* @package WordPress
* @subpackage Administration
* @since 3.1.0
*/
/**
* Core class used to implement displaying users in a list table for the network admin.
*
* @since 3.1.0
*
* @see WP_List_Table
*/
class WP_MS_Users_List_Table extends WP_List_Table {
/**
* @return bool
*/
public function ajax_user_can() {
return current_user_can( 'manage_network_users' );
}
/**
* @global string $mode List table view mode.
* @global string $usersearch
* @global string $role
*/
public function prepare_items() {
global $mode, $usersearch, $role;
if ( ! empty( $_REQUEST['mode'] ) ) {
$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
set_user_setting( 'network_users_list_mode', $mode );
} else {
$mode = get_user_setting( 'network_users_list_mode', 'list' );
}
$usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : '';
$users_per_page = $this->get_items_per_page( 'users_network_per_page' );
$role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';
$paged = $this->get_pagenum();
$args = array(
'number' => $users_per_page,
'offset' => ( $paged - 1 ) * $users_per_page,
'search' => $usersearch,
'blog_id' => 0,
'fields' => 'all_with_meta',
);
if ( wp_is_large_network( 'users' ) ) {
$args['search'] = ltrim( $args['search'], '*' );
} elseif ( '' !== $args['search'] ) {
$args['search'] = trim( $args['search'], '*' );
$args['search'] = '*' . $args['search'] . '*';
}
if ( 'super' === $role ) {
$args['login__in'] = get_super_admins();
}
/*
* If the network is large and a search is not being performed,
* show only the latest users with no paging in order to avoid
* expensive count queries.
*/
if ( ! $usersearch && wp_is_large_network( 'users' ) ) {
if ( ! isset( $_REQUEST['orderby'] ) ) {
$_GET['orderby'] = 'id';
$_REQUEST['orderby'] = 'id';
}
if ( ! isset( $_REQUEST['order'] ) ) {
$_GET['order'] = 'DESC';
$_REQUEST['order'] = 'DESC';
}
$args['count_total'] = false;
}
if ( isset( $_REQUEST['orderby'] ) ) {
$args['orderby'] = $_REQUEST['orderby'];
}
if ( isset( $_REQUEST['order'] ) ) {
$args['order'] = $_REQUEST['order'];
}
/** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
$args = apply_filters( 'users_list_table_query_args', $args );
// Query the user IDs for this page.
$wp_user_search = new WP_User_Query( $args );
$this->items = $wp_user_search->get_results();
$this->set_pagination_args(
array(
'total_items' => $wp_user_search->get_total(),
'per_page' => $users_per_page,
)
);
}
/**
* @return array
*/
protected function get_bulk_actions() {
$actions = array();
if ( current_user_can( 'delete_users' ) ) {
$actions['delete'] = __( 'Delete' );
}
$actions['spam'] = _x( 'Mark as spam', 'user' );
$actions['notspam'] = _x( 'Not spam', 'user' );
return $actions;
}
/**
*/
public function no_items() {
_e( 'No users found.' );
}
/**
* @global string $role
* @return array
*/
protected function get_views() {
global $role;
$total_users = get_user_count();
$super_admins = get_super_admins();
$total_admins = count( $super_admins );
$role_links = array();
$role_links['all'] = array(
'url' => network_admin_url( 'users.php' ),
'label' => sprintf(
/* translators: Number of users. */
_nx(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
$total_users,
'users'
),
number_format_i18n( $total_users )
),
'current' => 'super' !== $role,
);
$role_links['super'] = array(
'url' => network_admin_url( 'users.php?role=super' ),
'label' => sprintf(
/* translators: Number of users. */
_n(
'Super Admin <span class="count">(%s)</span>',
'Super Admins <span class="count">(%s)</span>',
$total_admins
),
number_format_i18n( $total_admins )
),
'current' => 'super' === $role,
);
return $this->get_views_links( $role_links );
}
/**
* @global string $mode List table view mode.
*
* @param string $which
*/
protected function pagination( $which ) {
global $mode;
parent::pagination( $which );
if ( 'top' === $which ) {
$this->view_switcher( $mode );
}
}
/**
* @return string[] Array of column titles keyed by their column name.
*/
public function get_columns() {
$users_columns = array(
'cb' => '<input type="checkbox" />',
'username' => __( 'Username' ),
'name' => __( 'Name' ),
'email' => __( 'Email' ),
'registered' => _x( 'Registered', 'user' ),
'blogs' => __( 'Sites' ),
);
/**
* Filters the columns displayed in the Network Admin Users list table.
*
* @since MU (3.0.0)
*
* @param string[] $users_columns An array of user columns. Default 'cb', 'username',
* 'name', 'email', 'registered', 'blogs'.
*/
return apply_filters( 'wpmu_users_columns', $users_columns );
}
/**
* @return array
*/
protected function get_sortable_columns() {
return array(
'username' => array( 'login', false, __( 'Username' ), __( 'Table ordered by Username.' ), 'asc' ),
'name' => array( 'name', false, __( 'Name' ), __( 'Table ordered by Name.' ) ),
'email' => array( 'email', false, __( 'E-mail' ), __( 'Table ordered by E-mail.' ) ),
'registered' => array( 'id', false, _x( 'Registered', 'user' ), __( 'Table ordered by User Registered Date.' ) ),
);
}
/**
* Handles the checkbox column output.
*
* @since 4.3.0
* @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support.
*
* @param WP_User $item The current WP_User object.
*/
public function column_cb( $item ) {
// Restores the more descriptive, specific name for use within this method.
$user = $item;
if ( is_super_admin( $user->ID ) ) {
return;
}
?>
<input type="checkbox" id="blog_<?php echo $user->ID; ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ); ?>" />
<label for="blog_<?php echo $user->ID; ?>">
<span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. %s: User login. */
printf( __( 'Select %s' ), $user->user_login );
?>
</span>
</label>
<?php
}
/**
* Handles the ID column output.
*
* @since 4.4.0
*
* @param WP_User $user The current WP_User object.
*/
public function column_id( $user ) {
echo $user->ID;
}
/**
* Handles the username column output.
*
* @since 4.3.0
*
* @param WP_User $user The current WP_User object.
*/
public function column_username( $user ) {
$super_admins = get_super_admins();
$avatar = get_avatar( $user->user_email, 32 );
echo $avatar;
if ( current_user_can( 'edit_user', $user->ID ) ) {
$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
$edit = "<a href=\"{$edit_link}\">{$user->user_login}</a>";
} else {
$edit = $user->user_login;
}
?>
<strong>
<?php
echo $edit;
if ( in_array( $user->user_login, $super_admins, true ) ) {
echo ' — ' . __( 'Super Admin' );
}
?>
</strong>
<?php
}
/**
* Handles the name column output.
*
* @since 4.3.0
*
* @param WP_User $user The current WP_User object.
*/
public function column_name( $user ) {
if ( $user->first_name && $user->last_name ) {
printf(
/* translators: 1: User's first name, 2: Last name. */
_x( '%1$s %2$s', 'Display name based on first name and last name' ),
$user->first_name,
$user->last_name
);
} elseif ( $user->first_name ) {
echo $user->first_name;
} elseif ( $user->last_name ) {
echo $user->last_name;
} else {
echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
_x( 'Unknown', 'name' ) .
'</span>';
}
}
/**
* Handles the email column output.
*
* @since 4.3.0
*
* @param WP_User $user The current WP_User object.
*/
public function column_email( $user ) {
echo "<a href='" . esc_url( "mailto:$user->user_email" ) . "'>$user->user_email</a>";
}
/**
* Handles the registered date column output.
*
* @since 4.3.0
*
* @global string $mode List table view mode.
*
* @param WP_User $user The current WP_User object.
*/
public function column_registered( $user ) {
global $mode;
if ( 'list' === $mode ) {
$date = __( 'Y/m/d' );
} else {
$date = __( 'Y/m/d g:i:s a' );
}
echo mysql2date( $date, $user->user_registered );
}
/**
* @since 4.3.0
*
* @param WP_User $user
* @param string $classes
* @param string $data
* @param string $primary
*/
protected function _column_blogs( $user, $classes, $data, $primary ) {
echo '<td class="', $classes, ' has-row-actions" ', $data, '>';
echo $this->column_blogs( $user );
echo $this->handle_row_actions( $user, 'blogs', $primary );
echo '</td>';
}
/**
* Handles the sites column output.
*
* @since 4.3.0
*
* @param WP_User $user The current WP_User object.
*/
public function column_blogs( $user ) {
$blogs = get_blogs_of_user( $user->ID, true );
if ( ! is_array( $blogs ) ) {
return;
}
foreach ( $blogs as $site ) {
if ( ! can_edit_network( $site->site_id ) ) {
continue;
}
$path = ( '/' === $site->path ) ? '' : $site->path;
$site_classes = array( 'site-' . $site->site_id );
/**
* Filters the span class for a site listing on the mulisite user list table.
*
* @since 5.2.0
*
* @param string[] $site_classes Array of class names used within the span tag. Default "site-#" with the site's network ID.
* @param int $site_id Site ID.
* @param int $network_id Network ID.
* @param WP_User $user WP_User object.
*/
$site_classes = apply_filters( 'ms_user_list_site_class', $site_classes, $site->userblog_id, $site->site_id, $user );
if ( is_array( $site_classes ) && ! empty( $site_classes ) ) {
$site_classes = array_map( 'sanitize_html_class', array_unique( $site_classes ) );
echo '<span class="' . esc_attr( implode( ' ', $site_classes ) ) . '">';
} else {
echo '<span>';
}
echo '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $site->userblog_id ) ) . '">' . str_replace( '.' . get_network()->domain, '', $site->domain . $path ) . '</a>';
echo ' <small class="row-actions">';
$actions = array();
$actions['edit'] = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $site->userblog_id ) ) . '">' . __( 'Edit' ) . '</a>';
$class = '';
if ( 1 === (int) $site->spam ) {
$class .= 'site-spammed ';
}
if ( 1 === (int) $site->mature ) {
$class .= 'site-mature ';
}
if ( 1 === (int) $site->deleted ) {
$class .= 'site-deleted ';
}
if ( 1 === (int) $site->archived ) {
$class .= 'site-archived ';
}
$actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $site->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
/**
* Filters the action links displayed next the sites a user belongs to
* in the Network Admin Users list table.
*
* @since 3.1.0
*
* @param string[] $actions An array of action links to be displayed. Default 'Edit', 'View'.
* @param int $userblog_id The site ID.
*/
$actions = apply_filters( 'ms_user_list_site_actions', $actions, $site->userblog_id );
$action_count = count( $actions );
$i = 0;
foreach ( $actions as $action => $link ) {
++$i;
$separator = ( $i < $action_count ) ? ' | ' : '';
echo "<span class='$action'>{$link}{$separator}</span>";
}
echo '</small></span><br />';
}
}
/**
* Handles the default column output.
*
* @since 4.3.0
* @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support.
*
* @param WP_User $item The current WP_User object.
* @param string $column_name The current column name.
*/
public function column_default( $item, $column_name ) {
// Restores the more descriptive, specific name for use within this method.
$user = $item;
/** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
}
public function display_rows() {
foreach ( $this->items as $user ) {
$class = '';
$status_list = array(
'spam' => 'site-spammed',
'deleted' => 'site-deleted',
);
foreach ( $status_list as $status => $col ) {
if ( $user->$status ) {
$class .= " $col";
}
}
?>
<tr class="<?php echo trim( $class ); ?>">
<?php $this->single_row_columns( $user ); ?>
</tr>
<?php
}
}
/**
* Gets the name of the default primary column.
*
* @since 4.3.0
*
* @return string Name of the default primary column, in this case, 'username'.
*/
protected function get_default_primary_column_name() {
return 'username';
}
/**
* Generates and displays row action links.
*
* @since 4.3.0
* @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support.
*
* @param WP_User $item User being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output for users in Multisite, or an empty string
* if the current column is not the primary column.
*/
protected function handle_row_actions( $item, $column_name, $primary ) {
if ( $primary !== $column_name ) {
return '';
}
// Restores the more descriptive, specific name for use within this method.
$user = $item;
$super_admins = get_super_admins();
$actions = array();
if ( current_user_can( 'edit_user', $user->ID ) ) {
$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
$actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
}
if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins, true ) ) {
$actions['delete'] = '<a href="' . esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
}
/**
* Filters the action links displayed under each user in the Network Admin Users list table.
*
* @since 3.2.0
*
* @param string[] $actions An array of action links to be displayed. Default 'Edit', 'Delete'.
* @param WP_User $user WP_User object.
*/
$actions = apply_filters( 'ms_user_row_actions', $actions, $user );
return $this->row_actions( $actions );
}
}
media.php.php.tar.gz 0000644 00000067255 15027563205 0010352 0 ustar 00 � �k{�F�(|�J�a�LHʗ$3�,y5�3��<�9��IHBLZ���oݺ�hP��d3{�g&&��TWWWWW��,��۳���Y:�-ҢL�b�H�Q>�>����4�mg��d9N��i:Β��l�����m�[�~��w���w�o���7o�o��/7oE�����0�t�{���}�rs��7������)�@�gE� ��g�#�����>Ò�1OF����U���rh>�-���M�ͽ�$��ET���8=I��2"����I���2��H/�n���_7�i�\�"h<��c�Ԉ���y���rjw���{�����H��.ڋ��"�honl���<�#��ۏ�v��ȧ��|:_��"�:�h{;�)��'�"J��byr���*�`T�o˾il�\Lb���b;X�4�@3�����
�d�E���xh�c������w��c6@�ɛ$�$�IJȉ�������"j�i�b�#0���y[��<�ۗ�d�L�+�<�12��D�i�yِ�K������!զ)�Vۅ!~�$t0�}��!�^T��0� �(���?E�L�2�M�Y���N'�0�D���0ڢ��2N������H�L��tT�5�xb � M��ut��gv$���i{9(ҁTD,��A�q� G���QVi �����b�n���c�G57�3.��Y=�9�0SH�&ecK�����fe'غ����ζ�t���iZ�$��y�������w�Q����;яϞ<����"������.����G���G� �e}�a&�3� ���P�ڸ��pwd�4�t:// D=����� 1+&I�/������r:N�I.-�Z�{Q1�uY��=f��b]���<�E�xOa���}=���Xr�s�au+�ɲ�Xh�R��ыk�3f(����٧v�`��
�ۚ����= ���y�Z#fFe1�T���з��l�����Y�r]��,(P���x�^���-l��.ѭ�5Z.��!m|��I�z��~�|���I�Yٗ*�z�b0���YVD̲��h���H'�w+(�{�l�L�~V�~��q0sD����I�H�B#3;�%�F@��a��½n�,�0ͮ̑�eOՕ*�N+�_{��[C��u�HOp0����%��dqڦ�(�� �#R��+e
��9I ��6�q��;��i6M,�T�OW���~7�&��5��v��Vԏ�b�"��܁W����Oؾ���3nx��,oO2Z$�:p��-@Fώ�%-�S���'�$������D^PL�Y
�"}#2$�?>z�����F
�6����
ӡg8<�=��у{�ͪ d*��9�)�$O���2�郟K����j�$;��jw�?��
A7_��tQ^4׆Y�O�dҗv��EҾ����v�y>yo�Tm��d�F�6#�f����b�S�%J���>�$밿��A!��;
���h��aJf �)0�t����f�4�"<��O�����$3��4;=�I��go�=�������8]t�p��-��,����)���;� _��i+FDg u,J$��:P*�V��.�A��XW@�RtW��+��e:B��eR�v"��g���AbQb��鞕S��.�S�!��r��#j��G��l�Ɓ�d�>�#5�b�I�~���6��S+����aK"��pMl�VL#�� g"�
b�e-��e�$5����a��*<!ˍ��X?�)�8M���0g��9jARB�k6� ͋����B_ED�)��%�JO����?��W����l�W�tc��K�>-�n�cX��CoV�0\�հ\zE-Ý]�"_. �Ț�ժ��Y
rHQz\�݅)�k�E�`�b��Wa���;ABF��a��D��Ԋٓ\+�Nd�f�U��#DN�Ż�0D�V��1��'l���8��(�� 0D
K�A���*�حy�EU_SW�z�xV�:Q{��ѲHǝ`叕x�rzPYJ�uh֓/.�T=���W+�W��䑁����$�)�Xr�;th7�i� �x���N��VO�$�t�O��'�т�i>�L�ԤlN
!j���fE�1�<�Èl`�3�# �"*���LT�HS������7���Sl<�F��A��a}":�
���&��+��4i���ʊ�d�C^g�hbwz��M�Q
*�Bje%Џ��t�R�Pb���:�̓�z��xa�xZ���?ׁ�~6(aQ�r��{e�5�D�5��̱�O_h���_�!i��*�i���o*��e�kt=��d�NtG�=$E�Q������`���3�z�v������}t����7�m�R��X {���
�*���|��Ҷ\�D��8�w��)+��!j�k���&F����>Jz�}��z��Nt�����w��aă�$Mf���
b�3����n>{��)��IFd2�fi4\���i�pm��C���������/g��%X�b�_#�T�h�J����_/�����������|�@��Us������u�L a��[�۱�xz�-�4����X7�>2�fc>�����pn��7Eߘ��<�>�N5=����Ѷ<�M\�͓��i-�v��X�a�2�mӁvD.�s��ت��k T��Ḑ��
�WEV�2
��K��d4�ۮ97�d�[�o�2��h���=A)�4}�ː�s�"��$��
IɒJ�i^�m͒�Ѣ}�N�7|��+��:�-L)���% �,r#X���
�b����#}=人GM!���r��zgs�v1Zds�G.��^w��_�7 �mA�7 �3\���q~އF'���t�WU���=�M~ɍ�*�9�}�ӯB@6)h��_
��t�Dh�ۍ�����̀ �di����J��� �q�iA�^�Y��>�T=}�H�N�t��D�)�E��C��H9Y�>����P@
y��\I����J�ΰ"
���(�_���� �r��=���T���_�ee
�Fާ�{G�n�X���I����Z��e��@�5�p��,Ǔ0Yag��~m���n[i%���w��F�5M
��C��[,`��vf�ᜑ�\��;0���M�KƲ @���/0��N�w�D�_�G�zN�l�\TM����--�+ޮF���D
̼���s �7uW/f7���7M�B�#^y]�Nb�g�6X#�?���c.�3p7K_x����x�\k�@^�j8\xsTtaޠA�OuJ�˓K:�M�{�8�oŰu�G��µY��T}ö�H��p� z���Z�(KQ����W'�H�[���t��j�����Gq�t�l��f鹥�\7r�n���zP;FW�5��b�F7�[x�Ea-��Nr ��jOz��'���ux���O�K�0t4!�'[��������0��hJD]Ҭ�/t�G����Wj�&��d����t�a#����sg��cP�t17ςx�������/��(�)-".p��
�%�.�7p����j5�f{���z�O�;��h�$��Ss�^��(��� �5n�D80|�fH�r� o�a�|��-һ��rܡ�_��h]��U�x;�vs���ѵ[[E��9�f�C�6�\;����>b<�Ʊ؟2/3��F�C�n�
�zj`�F�ҝ��6�0��K�
�L4U_���
.�@��P�5_(��Z���Ь)%�6�.|�&z�����G<����Ŕ�~tm��Z �Q�p)�}kN��c���g\�6�l�k��P�����|ƫ>