wpdb::get_blog_prefix( int $blog_id = null )

Gets blog prefix.


Description Description


Parameters Parameters

$blog_id

(int) (Optional)

Default value: null


Top ↑

Return Return

(string) Blog prefix.


Top ↑

Source Source

File: wp-includes/wp-db.php

	public function get_blog_prefix( $blog_id = null ) {
		if ( is_multisite() ) {
			if ( null === $blog_id )
				$blog_id = $this->blogid;
			$blog_id = (int) $blog_id;
			if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) )
				return $this->base_prefix;
			else
				return $this->base_prefix . $blog_id . '_';
		} else {
			return $this->base_prefix;
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.