is_ssl

Determine if SSL is used.

Return values

returns:True if SSL, false if not used.

Source code

function is_ssl() {

	if ( isset($_SERVER['HTTPS']) ) {

		if ( 'on' == strtolower($_SERVER['HTTPS']) )

			return true;

		if ( '1' == $_SERVER['HTTPS'] )

			return true;

	} elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {

		return true;

	}

	return false;

}

2189

is_site_admin

Definition:
function is_site_admin( $user_login = '' ) {}

Determine if user is a site admin.
Plugins should use is_multisite() instead of checking if this function exists to determine if multisite is enabled.

Parameters

  • $user_login

Source code

function is_site_admin( $user_login = '' ) {

	_deprecated_function( __FUNCTION__, '3.0', 'is_super_admin()' );



	if ( empty( $user_login ) ) {

		$user_id = get_current_user_id();

		if ( !$user_id )

			return false;

	} else {

		$user = get_user_by( 'login', $user_login );

		if ( empty( $user->ID ) )

			return false;

		$user_id = $user->ID;

	}



	return is_super_admin( $user_id );

}

2187

is_singular

Definition:
function is_singular( $post_types = '' ) {}

Is the query for a single post of any post type (post, attachment, page, … )?
If the $post_types parameter is specified, this function will additionally check if the query is for one of the Posts Types specified.

Parameters

  • mixed $post_types: Optional. Post Type or array of Post Types

Source code

	function is_singular( $post_types = '' ) {

		if ( empty( $post_types ) || !$this->is_singular )

			return (bool) $this->is_singular;



		$post_obj = $this->get_queried_object();



		return in_array( $post_obj->post_type, (array) $post_types );

	}

2185

is_single

Definition:
function is_single( $post = '' ) {}

Is the query for a single post?
Works for any post type, except attachments and pages

Parameters

  • mixed $post: Post ID, title, slug, or array of such.

Source code

	function is_single( $post = '' ) {

		if ( !$this->is_single )

			return false;



		if ( empty($post) )

			return true;



		$post_obj = $this->get_queried_object();



		$post = (array) $post;



		if ( in_array( $post_obj->ID, $post ) )

			return true;

		elseif ( in_array( $post_obj->post_title, $post ) )

			return true;

		elseif ( in_array( $post_obj->post_name, $post ) )

			return true;



		return false;

	}

2183

is_server_error

Definition:
function is_server_error ($sc) {}

Parameters

  • $sc

Source code

function is_server_error ($sc) {

	return $sc >= 500 && $sc < 600;

}

2181