WP_MS_Sites_List_Table::column_blogname() WordPress Method

The WP_MS_Sites_List_Table::column_blogname() method is used to display the name of a site in the WordPress Multisite network. This method takes one parameter, which is the site ID. The method first checks if the site is a network site. If it is, then the method retrieves the site's name from the database and displays it. Otherwise, the method returns false.

WP_MS_Sites_List_Table::column_blogname( array $blog ) #

Handles the site name column output.


Parameters

$blog

(array)(Required)Current site.


Top ↑

Source

File: wp-admin/includes/class-wp-ms-sites-list-table.php

	public function column_blogname( $blog ) {
		global $mode;

		$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );

		?>
		<strong>
			<a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname; ?></a>
			<?php $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 &#8211; %2$s' ),
				get_option( 'blogname' ),
				'<em>' . get_option( 'blogdescription' ) . '</em>'
			);
			echo '</p>';
			restore_current_blog();
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.