type_url_form_file

Definition:
function type_url_form_file() {}

Source code

function type_url_form_file() {

	return '

	<table class="describe"><tbody>

		<tr>

			<th valign="top" scope="row" class="label">

				<span class="alignleft"><label for="insertonly[href]">' . __('URL') . '</label></span>

				<span class="alignright"><abbr title="required" class="required">*</abbr></span>

			</th>

			<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>

		</tr>

		<tr>

			<th valign="top" scope="row" class="label">

				<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>

				<span class="alignright"><abbr title="required" class="required">*</abbr></span>

			</th>

			<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>

		</tr>

		<tr><td></td><td class="help">' . __('Link text, e.g. “Ransom Demands (PDF)”') . '</td></tr>

	' . _insert_into_post_button('file') . '

	</tbody></table>

';

}

3119

type_url_form_audio

Definition:
function type_url_form_audio() {}

Source code

function type_url_form_audio() {

	return '

	<table class="describe"><tbody>

		<tr>

			<th valign="top" scope="row" class="label">

				<span class="alignleft"><label for="insertonly[href]">' . __('Audio File URL') . '</label></span>

				<span class="alignright"><abbr title="required" class="required">*</abbr></span>

			</th>

			<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>

		</tr>

		<tr>

			<th valign="top" scope="row" class="label">

				<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>

				<span class="alignright"><abbr title="required" class="required">*</abbr></span>

			</th>

			<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>

		</tr>

		<tr><td></td><td class="help">' . __('Link text, e.g. “Still Alive by Jonathan Coulton”') . '</td></tr>

	' . _insert_into_post_button('audio') . '

	</tbody></table>

';

}

3117

twentyten_widgets_init

Definition:
function twentyten_widgets_init() {}

Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
To override twentyten_widgets_init() in a child theme, remove the action hook and add your own function tied to the init hook.

Source code

function twentyten_widgets_init() {

	// Area 1, located at the top of the sidebar.

	register_sidebar( array(

		'name' => __( 'Primary Widget Area', 'twentyten' ),

		'id' => 'primary-widget-area',

		'description' => __( 'The primary widget area', 'twentyten' ),

		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',

		'after_widget' => '</li>',

		'before_title' => '<h3 class="widget-title">',

		'after_title' => '</h3>',

	) );



	// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.

	register_sidebar( array(

		'name' => __( 'Secondary Widget Area', 'twentyten' ),

		'id' => 'secondary-widget-area',

		'description' => __( 'The secondary widget area', 'twentyten' ),

		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',

		'after_widget' => '</li>',

		'before_title' => '<h3 class="widget-title">',

		'after_title' => '</h3>',

	) );



	// Area 3, located in the footer. Empty by default.

	register_sidebar( array(

		'name' => __( 'First Footer Widget Area', 'twentyten' ),

		'id' => 'first-footer-widget-area',

		'description' => __( 'The first footer widget area', 'twentyten' ),

		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',

		'after_widget' => '</li>',

		'before_title' => '<h3 class="widget-title">',

		'after_title' => '</h3>',

	) );



	// Area 4, located in the footer. Empty by default.

	register_sidebar( array(

		'name' => __( 'Second Footer Widget Area', 'twentyten' ),

		'id' => 'second-footer-widget-area',

		'description' => __( 'The second footer widget area', 'twentyten' ),

		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',

		'after_widget' => '</li>',

		'before_title' => '<h3 class="widget-title">',

		'after_title' => '</h3>',

	) );



	// Area 5, located in the footer. Empty by default.

	register_sidebar( array(

		'name' => __( 'Third Footer Widget Area', 'twentyten' ),

		'id' => 'third-footer-widget-area',

		'description' => __( 'The third footer widget area', 'twentyten' ),

		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',

		'after_widget' => '</li>',

		'before_title' => '<h3 class="widget-title">',

		'after_title' => '</h3>',

	) );



	// Area 6, located in the footer. Empty by default.

	register_sidebar( array(

		'name' => __( 'Fourth Footer Widget Area', 'twentyten' ),

		'id' => 'fourth-footer-widget-area',

		'description' => __( 'The fourth footer widget area', 'twentyten' ),

		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',

		'after_widget' => '</li>',

		'before_title' => '<h3 class="widget-title">',

		'after_title' => '</h3>',

	) );

}

3115

twentyten_setup

Definition:
function twentyten_setup() {}

Sets up theme defaults and registers support for various WordPress features.
Note that this function is hooked into the after_setup_theme hook, which runs before the init hook. The init hook is too late for some features, such as indicating support post thumbnails.

Defined filters

  • twentyten_header_image_width
    apply_filters( 'twentyten_header_image_width', 940 )
  • twentyten_header_image_height
    apply_filters( 'twentyten_header_image_height', 198 )

Source code

function twentyten_setup() {



	// This theme styles the visual editor with editor-style.css to match the theme style.

	add_editor_style();



	// Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.

	add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );



	// This theme uses post thumbnails

	add_theme_support( 'post-thumbnails' );



	// Add default posts and comments RSS feed links to head

	add_theme_support( 'automatic-feed-links' );



	// Make theme available for translation

	// Translations can be filed in the /languages/ directory

	load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );



	$locale = get_locale();

	$locale_file = get_template_directory() . "/languages/$locale.php";

	if ( is_readable( $locale_file ) )

		require_once( $locale_file );



	// This theme uses wp_nav_menu() in one location.

	register_nav_menus( array(

		'primary' => __( 'Primary Navigation', 'twentyten' ),

	) );



	// This theme allows users to set a custom background

	add_custom_background();



	// Your changeable header business starts here

	if ( ! defined( 'HEADER_TEXTCOLOR' ) )

		define( 'HEADER_TEXTCOLOR', '' );



	// No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.

	if ( ! defined( 'HEADER_IMAGE' ) )

		define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' );



	// The height and width of your custom header. You can hook into the theme's own filters to change these values.

	// Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.

	define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) );

	define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) );



	// We'll be using post thumbnails for custom header images on posts and pages.

	// We want them to be 940 pixels wide by 198 pixels tall.

	// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.

	set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );



	// Don't support text inside the header image.

	if ( ! defined( 'NO_HEADER_TEXT' ) )

		define( 'NO_HEADER_TEXT', true );



	// Add a way for the custom header to be styled in the admin panel that controls

	// custom headers. See twentyten_admin_header_style(), below.

	add_custom_image_header( '', 'twentyten_admin_header_style' );



	// ... and thus ends the changeable header business.



	// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.

	register_default_headers( array(

		'berries' => array(

			'url' => '%s/images/headers/berries.jpg',

			'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Berries', 'twentyten' )

		),

		'cherryblossom' => array(

			'url' => '%s/images/headers/cherryblossoms.jpg',

			'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Cherry Blossoms', 'twentyten' )

		),

		'concave' => array(

			'url' => '%s/images/headers/concave.jpg',

			'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Concave', 'twentyten' )

		),

		'fern' => array(

			'url' => '%s/images/headers/fern.jpg',

			'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Fern', 'twentyten' )

		),

		'forestfloor' => array(

			'url' => '%s/images/headers/forestfloor.jpg',

			'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Forest Floor', 'twentyten' )

		),

		'inkwell' => array(

			'url' => '%s/images/headers/inkwell.jpg',

			'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Inkwell', 'twentyten' )

		),

		'path' => array(

			'url' => '%s/images/headers/path.jpg',

			'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Path', 'twentyten' )

		),

		'sunset' => array(

			'url' => '%s/images/headers/sunset.jpg',

			'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg',

			/* translators: header image description */

			'description' => __( 'Sunset', 'twentyten' )

		)

	) );

}

3113

twentyten_remove_recent_comments_style

Definition:
function twentyten_remove_recent_comments_style() {}

Removes the default styles that are packaged with the Recent Comments widget.
To override this in a child theme, remove the filter and optionally add your own function tied to the widgets_init action hook.

Source code

function twentyten_remove_recent_comments_style() {

	add_filter( 'show_recent_comments_widget_style', '__return_false' );

}

3111