A HitchHackers guide through WordPress


Home | Pages | Archives


register_theme_directory

February 12, 2011 2:22 am

Definition:
function register_theme_directory( $directory) {}

Register a directory that contains themes.

Parameters

Source code

function register_theme_directory( $directory) {

	global $wp_theme_directories;



	/* If this folder does not exist, return and do not register */

	if ( !file_exists( $directory ) )

			/* Try prepending as the theme directory could be relative to the content directory */

		$registered_directory = WP_CONTENT_DIR . '/' . $directory;

	else

		$registered_directory = $directory;



	/* If this folder does not exist, return and do not register */

	if ( !file_exists( $registered_directory ) )

		return false;



	$wp_theme_directories[] = $registered_directory;



	return true;

}

2689

Rate this:

Posted by Thorsten

Categories: /wp-includes/theme.php, Documentation, Files, Functions, Functions by letter r

Tags: , ,

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.