wp_admin_bar_add_secondary_groups

Definition:
function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {}

Add secondary menus.

Parameters

  • $wp_admin_bar

Source code

function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {

	$wp_admin_bar->add_group( array(

		'id'     => 'top-secondary',

		'meta'   => array(

			'class' => 'ab-top-secondary',

		),

	) );



	$wp_admin_bar->add_group( array(

		'parent' => 'wp-logo',

		'id'     => 'wp-logo-external',

		'meta'   => array(

			'class' => 'ab-sub-secondary',

		),

	) );

}

17397

wp_add_inline_style

Definition:
function wp_add_inline_style( $handle, $data ) {}

Adds extra CSS.
Works only if the stylesheet has already been added. Accepts a string $data containing the CSS. If two or more CSS code blocks are added to the same stylesheet $handle, they will be printed in the order they were added, i.e. the latter added styles can redeclare the previous.

Parameters

  • $handle
  • $data

Source code

function wp_add_inline_style( $handle, $data ) {

	global $wp_styles;

	if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {

		if ( ! did_action( 'init' ) )

			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),

				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );

		$wp_styles = new WP_Styles();

	}



	return $wp_styles->add_inline_style( $handle, $data );

}

17393

wpmu_admin_redirect_add_updated_param

Definition:
function wpmu_admin_redirect_add_updated_param( $url = '' ) {}

Adds an ‘updated=true’ argument to a URL.

Parameters

  • string $url

Source code

function wpmu_admin_redirect_add_updated_param( $url = '' ) {

	_deprecated_function( __FUNCTION__, '3.3' );



	if ( strpos( $url, 'updated=true' ) === false ) {

		if ( strpos( $url, '?' ) === false )

			return $url . '?updated=true';

		else

			return $url . '&updated=true';

	}

	return $url;

}

17370

wpmu_admin_do_redirect

Definition:
function wpmu_admin_do_redirect( $url = '' ) {}

Redirect a user based on $_GET or $_POST arguments.
The function looks for redirect arguments in the following order: 1) $_GET[‘ref’] 2) $_POST[‘ref’] 3) $_SERVER[‘HTTP_REFERER’] 4) $_GET[‘redirect’] 5) $_POST[‘redirect’] 6) $url

Parameters

  • string $url

Source code

function wpmu_admin_do_redirect( $url = '' ) {

	_deprecated_function( __FUNCTION__, '3.3' );



	$ref = '';

	if ( isset( $_GET['ref'] ) )

		$ref = $_GET['ref'];

	if ( isset( $_POST['ref'] ) )

		$ref = $_POST['ref'];



	if ( $ref ) {

		$ref = wpmu_admin_redirect_add_updated_param( $ref );

		wp_redirect( $ref );

		exit();

	}

	if ( empty( $_SERVER['HTTP_REFERER'] ) == false ) {

		wp_redirect( $_SERVER['HTTP_REFERER'] );

		exit();

	}



	$url = wpmu_admin_redirect_add_updated_param( $url );

	if ( isset( $_GET['redirect'] ) ) {

		if ( substr( $_GET['redirect'], 0, 2 ) == 's_' )

			$url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );

	} elseif ( isset( $_POST['redirect'] ) ) {

		$url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );

	}

	wp_redirect( $url );

	exit();

}

17367