On this page
WP_MS_Sites_List_Table::column_blogname( array $blog )
Handles the site name column output.
Parameters
$blogarray Required-
Current site.
Source
File: wp-admin/includes/class-wp-ms-sites-list-table.php. View all references
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 – %2$s' ),
get_option( 'blogname' ),
'<em>' . get_option( 'blogdescription' ) . '</em>'
);
echo '</p>';
restore_current_blog();
}
}
Related
Uses
| Uses | Description |
|---|---|
| WP_MS_Sites_List_Table::site_states() wp-admin/includes/class-wp-ms-sites-list-table.php | Maybe output comma-separated site states. |
| untrailingslashit() wp-includes/formatting.php | Removes trailing forward slashes and backslashes if they exist. |
| network_admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the network. |
| switch_to_blog() wp-includes/ms-blogs.php | Switch the current blog. |
| restore_current_blog() wp-includes/ms-blogs.php | Restore the current blog, after calling switch_to_blog() . |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| esc_url() wp-includes/formatting.php | Checks and cleans a URL. |
| get_option() wp-includes/option.php | Retrieves an option value based on an option name. |
Changelog
| Version | Description |
|---|---|
| 4.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_ms_sites_list_table/column_blogname