register_nav_menus

Definition:
function register_nav_menus( $locations = array() {}

Register navigation menus for a theme.

Parameters

  • array $locations: Associative array of menu location identifiers (like a slug) and descriptive text.

Source code

function register_nav_menus( $locations = array() ) {

	global $_wp_registered_nav_menus;



	add_theme_support( 'menus' );



	$_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations );

}

2669

register_nav_menu

Definition:
function register_nav_menu( $location, $description ) {}

Register a navigation menu for a theme.

Parameters

  • string $location: Menu location identifier, like a slug.
  • string $description: Menu location descriptive text.

Source code

function register_nav_menu( $location, $description ) {

	register_nav_menus( array( $location => $description ) );

}

2667

register_importer

Definition:
function register_importer( $id, $name, $description, $callback ) {}

Register importer for WordPress.

Parameters

  • string $id: Importer tag. Used to uniquely identify importer.
  • string $name: Importer name and title.
  • string $description: Importer description.
  • callback $callback: Callback to run.

Return values

returns:Returns WP_Error when $callback is WP_Error.

Source code

function register_importer( $id, $name, $description, $callback ) {

	global $wp_importers;

	if ( is_wp_error( $callback ) )

		return $callback;

	$wp_importers[$id] = array ( $name, $description, $callback );

}

2665

register_default_headers

Definition:
function register_default_headers( $headers ) {}

Register a selection of default headers to be displayed by the custom header admin UI.

Parameters

  • array $headers: Array of headers keyed by a string id. The ids point to arrays containing ‘url’, ‘thumbnail_url’, and ‘description’ keys.

Source code

function register_default_headers( $headers ) {

	global $_wp_default_headers;



	$_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers );

}

2663

register_deactivation_hook

Definition:
function register_deactivation_hook($file, $function) {}

Set the deactivation hook for a plugin.
When a plugin is deactivated, the action ‘deactivate_PLUGINNAME’ hook is deactivated. In the name of this hook, PLUGINNAME is replaced with the name of the plugin, including the optional subdirectory. For example, when the plugin is located in wp-content/plugin/sampleplugin/sample.php, then the name of this hook will become ‘activate_sampleplugin/sample.php’.

Parameters

  • string $file: The filename of the plugin including the path.
  • callback $function: the function hooked to the ‘activate_PLUGIN’ action.

Source code

function register_deactivation_hook($file, $function) {

	$file = plugin_basename($file);

	add_action('deactivate_' . $file, $function);

}

2661