add_posts_page

Definition:
function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {}

Add sub menu page to the posts main menu.
This function takes a capability which will be used to determine whether or not a page is included in the menu.

Parameters

  • string $page_title: The text to be displayed in the title tags of the page when the menu is selected
  • string $menu_title: The text to be used for the menu
  • string $capability: The capability required for this menu to be displayed to the user.
  • string $menu_slug: The slug name to refer to this menu by (should be unique for this menu)
  • callback $function: The function to be called to output the content for this page.

Return values

returns:The resulting page’s hook_suffix, or false if the user does not have the capability required.

Source code

function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {

	return add_submenu_page( 'edit.php', $page_title, $menu_title, $capability, $menu_slug, $function );

}

281

add_plugins_page

Definition:
function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {}

Add sub menu page to the plugins main menu.
This function takes a capability which will be used to determine whether or not a page is included in the menu.

Parameters

  • string $page_title: The text to be displayed in the title tags of the page when the menu is selected
  • string $menu_title: The text to be used for the menu
  • string $capability: The capability required for this menu to be displayed to the user.
  • string $menu_slug: The slug name to refer to this menu by (should be unique for this menu)
  • callback $function: The function to be called to output the content for this page.

Return values

returns:The resulting page’s hook_suffix, or false if the user does not have the capability required.

Source code

function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {

	return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $function );

}

279

add_ping

Definition:
function add_ping($post_id, $uri) {}

Add a URL to those already pung.

Parameters

  • int $post_id: Post ID.
  • string $uri: Ping URI.

Return values

returns:How many rows were updated.

Defined filters

  • add_ping
    apply_filters('add_ping', $new)

Source code

function add_ping($post_id, $uri) {

	global $wpdb;

	$pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));

	$pung = trim($pung);

	$pung = preg_split('/\s/', $pung);

	$pung[] = $uri;

	$new = implode("\n", $pung);

	$new = apply_filters('add_ping', $new);

	// expected_slashed ($new)

	$new = stripslashes($new);

	return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );

}

277

add_permastruct

Definition:
function add_permastruct($name, $struct, $with_front = true, $ep_mask = EP_NONE) {}

Add permalink structure.

Parameters

  • string $name: Name for permalink structure.
  • string $struct: Permalink structure.
  • bool $with_front: Prepend front base to permalink structure.
  • $ep_mask

Source code

	function add_permastruct($name, $struct, $with_front = true, $ep_mask = EP_NONE) {

		if ( $with_front )

			$struct = $this->front . $struct;

		else

			$struct = $this->root . $struct;

		$this->extra_permastructs[$name] = array($struct, $ep_mask);

	}

275