Advertisements

register_theme_directory

Definition:
function register_theme_directory( $directory) {}

Register a directory that contains themes.

Parameters

  • string $directory: Either the full filesystem path to a theme folder or a folder within WP_CONTENT_DIR

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

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: