add_custom_image_header

Definition:
function add_custom_image_header( $header_callback, $admin_header_callback, $admin_image_div_callback = '' ) {}

Add callbacks for image header display.
The parameter $header_callback callback will be required to display the content for the ‘wp_head’ action. The parameter $admin_header_callback callback will be added to Custom_Image_Header class and that will be added to the ‘admin_menu’ action.

Parameters

  • callback $header_callback: Call on ‘wp_head’ action.
  • callback $admin_header_callback: Call on custom header administration screen.
  • callback $admin_image_div_callback: Output a custom header image div on the custom header administration screen. Optional.

Source code

function add_custom_image_header( $header_callback, $admin_header_callback, $admin_image_div_callback = '' ) {

	if ( ! empty( $header_callback ) )

		add_action('wp_head', $header_callback);



	$support = array( 'callback' => $header_callback );

	$theme_support = get_theme_support( 'custom-header' );

	if ( ! empty( $theme_support ) && is_array( $theme_support[ 0 ] ) )

		$support = array_merge( $theme_support[ 0 ], $support );

	add_theme_support( 'custom-header',  $support );

	add_theme_support( 'custom-header-uploads' );



	if ( ! is_admin() )

		return;



	global $custom_image_header;



	require_once( ABSPATH . 'wp-admin/custom-header.php' );

	$custom_image_header = new Custom_Image_Header( $admin_header_callback, $admin_image_div_callback );

	add_action( 'admin_menu', array( &$custom_image_header, 'init' ) );

}

225

add_custom_background

Definition:
function add_custom_background( $header_callback = '', $admin_header_callback = '', $admin_image_div_callback = '' ) {}

Add callbacks for background image display.
The parameter $header_callback callback will be required to display the content for the ‘wp_head’ action. The parameter $admin_header_callback callback will be added to Custom_Background class and that will be added to the ‘admin_menu’ action.

Parameters

  • callback $header_callback: Call on ‘wp_head’ action.
  • callback $admin_header_callback: Call on custom background administration screen.
  • callback $admin_image_div_callback: Output a custom background image div on the custom background administration screen. Optional.

Source code

function add_custom_background( $header_callback = '', $admin_header_callback = '', $admin_image_div_callback = '' ) {

	if ( isset( $GLOBALS['custom_background'] ) )

		return;



	if ( empty( $header_callback ) )

		$header_callback = '_custom_background_cb';



	add_action( 'wp_head', $header_callback );



	add_theme_support( 'custom-background', array( 'callback' => $header_callback ) );



	if ( ! is_admin() )

		return;

	require_once( ABSPATH . 'wp-admin/custom-background.php' );

	$GLOBALS['custom_background'] = new Custom_Background( $admin_header_callback, $admin_image_div_callback );

	add_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );

}

223

add_comment_meta

Definition:
function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {}

Add meta data field to a comment.

Parameters

  • int $comment_id: Comment ID.
  • string $meta_key: Metadata name.
  • mixed $meta_value: Metadata value.
  • bool $unique: Optional, default is false. Whether the same key should not be added.

Return values

returns:False for failure. True for success.

Source code

function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {

	return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique);

}

217

add_comments_page

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

Add sub menu page to the comments 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_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {

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

}

215

add_clean_index

Definition:
function add_clean_index($table, $index) {}

Parameters

  • string $table: Database table name.
  • string $index: Database table index column.

Return values

returns:True, when done with execution.

Source code

function add_clean_index($table, $index) {

	global $wpdb;

	drop_index($table, $index);

	$wpdb->query("ALTER TABLE `$table` ADD INDEX ( `$index` )");

	return true;

}

213