has_excerpt

Definition:
function has_excerpt( $id = 0 ) {}

Whether post has excerpt.

Parameters

  • int $id: Optional. Post ID.

Source code

function has_excerpt( $id = 0 ) {

	$post = &get_post( $id );

	return ( !empty( $post->post_excerpt ) );

}

1929

has_action

Definition:
function has_action($tag, $function_to_check = false) {}

Check if any action has been registered for a hook.

Parameters

  • string $tag: The name of the action hook.
  • callback $function_to_check: optional. If specified, return the priority of that function on this hook or false if not attached.

Return values

returns:Optionally returns the priority on that hook for the specified function.

Source code

function has_action($tag, $function_to_check = false) {

	return has_filter($tag, $function_to_check);

}

1927

gzip_compression

Definition:
function gzip_compression() {}

Unused function.

Source code

function gzip_compression() {

	_deprecated_function( __FUNCTION__, '2.5' );

	return false;

}

1925

grant_super_admin

Definition:
function grant_super_admin( $user_id ) {}

Grants super admin privileges.

Parameters

  • int $user_id

Defined actions

  • grant_super_admin
    do_action( 'grant_super_admin', $user_id );
  • granted_super_admin
    do_action( 'granted_super_admin', $user_id );

Source code

function grant_super_admin( $user_id ) {

	global $super_admins;



	// If global super_admins override is defined, there is nothing to do here.

	if ( isset($super_admins) )

		return false;



	do_action( 'grant_super_admin', $user_id );



	// Directly fetch site_admins instead of using get_super_admins()

	$super_admins = get_site_option( 'site_admins', array( 'admin' ) );



	$user = new WP_User( $user_id );

	if ( ! in_array( $user->user_login, $super_admins ) ) {

		$super_admins[] = $user->user_login;

		update_site_option( 'site_admins' , $super_admins );

		do_action( 'granted_super_admin', $user_id );

		return true;

	}

	return false;

}

1923

graceful_fail

Definition:
function graceful_fail( $message ) {}

Parameters

  • $message

Defined filters

  • graceful_fail
    apply_filters( 'graceful_fail', $message )
  • graceful_fail_template
    apply_filters( 'graceful_fail_template',

    '<!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <title>Error!</title>

    <style type="text/css">

    img {

    border: 0;

    }

    body {

    line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;

    text-align: center;

    }

    .message {

    font-size: 22px;

    width: 350px;

    margin: auto;

    }

    </style>

    </head>

    <body>

    <p class="message">%s</p>

    </body>

    </html>' )

Source code

function graceful_fail( $message ) {

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

	$message = apply_filters( 'graceful_fail', $message );

	$message_template = apply_filters( 'graceful_fail_template',

'<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Error!</title>

<style type="text/css">

img {

	border: 0;

}

body {

line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;

text-align: center;

}

.message {

	font-size: 22px;

	width: 350px;

	margin: auto;

}

</style>

</head>

<body>

<p class="message">%s</p>

</body>

</html>' );

	die( sprintf( $message_template, $message ) );

}

1921