Warning: This function has been deprecated.

bp_core_add_admin_menu_page( $args = '' )

In BuddyPress 1.1 – 1.2.x, this function provided a better version of add_menu_page() that allowed positioning of menus. Deprecated in 1.5 in favor of a WP core function.


Description Description


Return Return

(string)


Top ↑

Source Source

File: bp-core/deprecated/1.5.php

function bp_core_add_admin_menu_page( $args = '' ) {
	global $_registered_pages, $admin_page_hooks, $menu;

	_deprecated_function( __FUNCTION__, '1.5', 'Use add_menu_page()' );

	$defaults = array(
		'access_level' => 2,
		'file'         => false,
		'function'     => false,
		'icon_url'     => false,
		'menu_title'   => '',
		'page_title'   => '',
		'position'     => 100
	);

	$r = wp_parse_args( $args, $defaults );
	extract( $r, EXTR_SKIP );

	$file     = plugin_basename( $file );
	$hookname = get_plugin_page_hookname( $file, '' );

	$admin_page_hooks[$file] = sanitize_title( $menu_title );

	if ( !empty( $function ) && !empty ( $hookname ) )
		add_action( $hookname, $function );

	if ( empty( $icon_url ) )
		$icon_url = 'images/generic.png';
	elseif ( is_ssl() && 0 === strpos( $icon_url, 'http://' ) )
		$icon_url = 'https://' . substr( $icon_url, 7 );

	do {
		$position++;
	} while ( !empty( $menu[$position] ) );

	$menu[$position] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
	$_registered_pages[$hookname] = true;

	return $hookname;
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 This function has been deprecated.
1.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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