W3cubDocs

/WordPress

WP_MS_Sites_List_Table::column_cb( array $item )

Handles the checkbox column output.

Parameters

$itemarrayrequired
Current site.

Source

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;
}

Changelog

Version Description
5.9.0 Renamed $blog to $item to match parent class for PHP 8 named parameter support.
4.3.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_ms_sites_list_table/column_cb