register_column_headers

Definition:
function register_column_headers($screen, $columns) {}

Register column headers for a particular screen.

Parameters

  • string $screen: The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
  • array $columns: An array of columns with column IDs as the keys and translated column names as the values

Source code

function register_column_headers($screen, $columns) {

	$wp_list_table = new _WP_List_Table_Compat($screen, $columns);

}

10162

print_column_headers

Definition:
function print_column_headers($screen, $id = true) {}

Prints column headers for a particular screen.

Parameters

  • $screen
  • $id

Source code

function print_column_headers($screen, $id = true) {

	$wp_list_table = new _WP_List_Table_Compat($screen);



	$wp_list_table->print_column_headers($id);

}

10145

post_type_archive_title

Definition:
function post_type_archive_title( $prefix = '', $display = true ) {}

Display or retrieve title for a post type archive.
This is optimized for archive.php and archive-{$post_type}.php template files for displaying the title of the post type.

Parameters

  • string $prefix: Optional. What to display before the title.
  • bool $display: Optional, default is true. Whether to display or retrieve title.

Return values

returns:Title when retrieving, null when displaying or failure.

Defined filters

  • post_type_archive_title
    apply_filters('post_type_archive_title', $post_type_obj->labels->name )

Source code

function post_type_archive_title( $prefix = '', $display = true ) {

	if ( ! is_post_type_archive() )

		return;



	$post_type_obj = get_queried_object();

	$title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );



	if ( $display )

		echo $prefix . $title;

	else

		return $title;

}

10128

post_format_meta_box

Definition:
function post_format_meta_box( $post, $box ) {}

Display post format form elements.

Parameters

  • object $post
  • $box

Source code

function post_format_meta_box( $post, $box ) {

	if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :

	$post_formats = get_theme_support( 'post-formats' );



	if ( is_array( $post_formats[0] ) ) :

		$post_format = get_post_format( $post->ID );

		if ( !$post_format )

			$post_format = '0';

		// Add in the current one if it isn't there yet, in case the current theme doesn't support it

		if ( $post_format && !in_array( $post_format, $post_formats[0] ) )

			$post_formats[0][] = $post_format;

	?>

	<div id="post-formats-select">

		<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>

		<?php foreach ( $post_formats[0] as $format ) : ?>

		<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>

		<?php endforeach; ?><br />

	</div>

	<?php endif; endif;

}

10116

maybe_create_table

Definition:
function maybe_create_table($table_name, $create_ddl) {}

Parameters

  • string $table_name: Database table name to create.
  • string $create_ddl: SQL statement to create table.

Return values

returns:If table already exists or was created by function.

Source code

function maybe_create_table($table_name, $create_ddl) {

	global $wpdb;

	if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )

		return true;

	//didn't find it try to create it.

	$q = $wpdb->query($create_ddl);

	// we cannot directly tell that whether this succeeded!

	if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name )

		return true;

	return false;

}

9996