secret_salt_warning

Definition:
function secret_salt_warning() {}

Source code

function secret_salt_warning() {

	if ( !is_super_admin() )

		return;

	$secret_keys = array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' );

	$out = '';

	foreach( $secret_keys as $key ) {

		if ( ! defined( $key ) )

			$out .= "define( '$key', '" . esc_html( wp_generate_password( 64, true, true ) ) . "' );<br />";

	}

	if ( $out != '' ) {

		$msg  = __( 'Warning! WordPress encrypts user cookies, but you must add the following lines to <strong>wp-config.php</strong> for it to be more secure.' );

		$msg .= '<br/>' . __( "Before the line <code>/* That's all, stop editing! Happy blogging. */</code> please add this code:" );

		$msg .= "<br/><br/><code>$out</code>";



		echo "<div class='update-nag'>$msg</div>";

	}

}

2819

search_theme_directories

Definition:
function search_theme_directories() {}

Search all registered theme directories for complete and valid themes.

Return values

returns:Valid themes found

Source code

function search_theme_directories() {

	global $wp_theme_directories, $wp_broken_themes;

	if ( empty( $wp_theme_directories ) )

		return false;



	$theme_files = array();

	$wp_broken_themes = array();



	/* Loop the registered theme directories and extract all themes */

	foreach ( (array) $wp_theme_directories as $theme_root ) {

		$theme_loc = $theme_root;



		/* We don't want to replace all forward slashes, see Trac #4541 */

		if ( '/' != WP_CONTENT_DIR )

			$theme_loc = str_replace(WP_CONTENT_DIR, '', $theme_root);



		/* Files in the root of the current theme directory and one subdir down */

		$themes_dir = @ opendir($theme_root);



		if ( !$themes_dir )

			return false;



		while ( ($theme_dir = readdir($themes_dir)) !== false ) {

			if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) {

				if ( $theme_dir[0] == '.' || $theme_dir == 'CVS' )

					continue;



				$stylish_dir = @opendir($theme_root . '/' . $theme_dir);

				$found_stylesheet = false;



				while ( ($theme_file = readdir($stylish_dir)) !== false ) {

					if ( $theme_file == 'style.css' ) {

						$theme_files[$theme_dir] = array( 'theme_file' => $theme_dir . '/' . $theme_file, 'theme_root' => $theme_root );

						$found_stylesheet = true;

						break;

					}

				}

				@closedir($stylish_dir);



				if ( !$found_stylesheet ) { // look for themes in that dir

					$subdir = "$theme_root/$theme_dir";

					$subdir_name = $theme_dir;

					$theme_subdirs = @opendir( $subdir );



					$found_subdir_themes = false;

					while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) {

						if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) {

							if ( $theme_subdir[0] == '.' || $theme_subdir == 'CVS' )

								continue;



							$stylish_dir = @opendir($subdir . '/' . $theme_subdir);

							$found_stylesheet = false;



							while ( ($theme_file = readdir($stylish_dir)) !== false ) {

								if ( $theme_file == 'style.css' ) {

									$theme_files["$theme_dir/$theme_subdir"] = array( 'theme_file' => $subdir_name . '/' . $theme_subdir . '/' . $theme_file, 'theme_root' => $theme_root );

									$found_stylesheet = true;

									$found_subdir_themes = true;

									break;

								}

							}

							@closedir($stylish_dir);

						}

					}

					@closedir($theme_subdirs);

					if ( !$found_subdir_themes )

						$wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.'));

				}

			}

		}

		@closedir( $themes_dir );

	}

	return $theme_files;

}

2817

script_concat_settings

Definition:
function script_concat_settings() {}

Determine the concatenation and compression settings for scripts and styles.

Source code

function script_concat_settings() {

	global $concatenate_scripts, $compress_scripts, $compress_css;



	$compressed_output = ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') );



	if ( ! isset($concatenate_scripts) ) {

		$concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;

		if ( ! is_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )

			$concatenate_scripts = false;

	}



	if ( ! isset($compress_scripts) ) {

		$compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;

		if ( $compress_scripts && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )

			$compress_scripts = false;

	}



	if ( ! isset($compress_css) ) {

		$compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;

		if ( $compress_css && ( ! get_site_option('can_compress_scripts') || $compressed_output ) )

			$compress_css = false;

	}

}

2815

screen_options

Definition:
function screen_options($screen) {}

Parameters

  • $screen

Source code

function screen_options($screen) {

	global $wp_current_screen_options;



	if ( is_string($screen) )

		$screen = convert_to_screen($screen);



	if ( !isset($wp_current_screen_options['per_page']) )

		return '';



	$per_page_label = $wp_current_screen_options['per_page']['label'];



	if ( empty($wp_current_screen_options['per_page']['option']) ) {

		$option = str_replace( '-', '_', "{$screen->id}_per_page" );

	} else {

2813

screen_meta

Definition:
function screen_meta($screen) {}

Parameters

  • $screen

Defined filters

  • screen_settings
    apply_filters('screen_settings', '', $screen)
  • screen_options_show_screen
    apply_filters('screen_options_show_screen', $show_screen, $screen)
  • contextual_help_list
    apply_filters('contextual_help_list', $_wp_contextual_help, $screen)
  • default_contextual_help
    apply_filters('default_contextual_help', $default_help)
  • contextual_help
    apply_filters('contextual_help', $contextual_help, $screen->id, $screen)

Source code

function screen_meta($screen) {

	global $wp_meta_boxes, $_wp_contextual_help, $wp_list_table, $wp_current_screen_options;



	if ( is_string($screen) )

		$screen = convert_to_screen($screen);



	$columns = get_column_headers( $screen );

	$hidden = get_hidden_columns( $screen );



	$meta_screens = array('index' => 'dashboard');



	if ( isset($meta_screens[$screen->id]) ) {

		$screen->id = $meta_screens[$screen->id];

		$screen->base = $screen->id;

	}



	$show_screen = false;

	if ( !empty($wp_meta_boxes[$screen->id]) || !empty($columns) )

		$show_screen = true;



	$screen_options = screen_options($screen);

	if ( $screen_options )

		$show_screen = true;



	if ( !isset($_wp_contextual_help) )

		$_wp_contextual_help = array();



	$settings = apply_filters('screen_settings', '', $screen);



	switch ( $screen->id ) {

		case 'widgets':

			$settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";

			$show_screen = true;

			break;

	}

	if ( ! empty( $settings ) )

		$show_screen = true;



	if ( !empty($wp_current_screen_options) )

		$show_screen = true;



	$show_screen = apply_filters('screen_options_show_screen', $show_screen, $screen);



?>

<div id="screen-meta">

<?php if ( $show_screen ) : ?>

<div id="screen-options-wrap" class="hidden">

	<form id="adv-settings" action="" method="post">

	<?php if ( isset($wp_meta_boxes[$screen->id]) ) : ?>

		<h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>

		<div class="metabox-prefs">

			<?php meta_box_prefs($screen); ?>

			<br class="clear" />

		</div>

		<?php endif;

		if ( ! empty($columns) ) : ?>

		<h5><?php echo ( isset( $columns['_title'] ) ?  $columns['_title'] :  _x('Show on screen', 'Columns') ) ?></h5>

		<div class="metabox-prefs">

<?php

	$special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname');



	foreach ( $columns as $column => $title ) {

		// Can't hide these for they are special

		if ( in_array( $column, $special ) )

			continue;

		if ( empty( $title ) )

			continue;



		if ( 'comments' == $column )

			$title = __( 'Comments' );

		$id = "$column-hide";

		echo '<label for="' . $id . '">';

		echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';

		echo "$title</label>\n";

	}

?>

			<br class="clear" />

		</div>

	<?php endif;

	echo screen_layout($screen);



	if ( !empty( $screen_options ) ) {

		?>

		<h5><?php _ex('Show on screen', 'Screen Options') ?></h5>

		<?php

	}



	echo $screen_options;

	echo $settings; ?>

<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>

</form>

</div>



<?php endif; // $show_screen



	$_wp_contextual_help = apply_filters('contextual_help_list', $_wp_contextual_help, $screen);

	?>

	<div id="contextual-help-wrap" class="hidden">

	<?php

	$contextual_help = '';

	if ( isset($_wp_contextual_help[$screen->id]) ) {

		$contextual_help .= '<div class="metabox-prefs">' . $_wp_contextual_help[$screen->id] . "</div>\n";

	} else {

		$contextual_help .= '<div class="metabox-prefs">';

		$default_help = __('<a href="http://codex.wordpress.org/" target="_blank">Documentation</a>');

		$default_help .= '<br />';

		$default_help .= __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>');

		$contextual_help .= apply_filters('default_contextual_help', $default_help);

		$contextual_help .= "</div>\n";

	}



	echo apply_filters('contextual_help', $contextual_help, $screen->id, $screen);

	?>

	</div>



<div id="screen-meta-links">

<div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">

<a href="#contextual-help" id="contextual-help-link" class="show-settings"><?php _e('Help') ?></a>

</div>

<?php if ( $show_screen ) { ?>

<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">

<a href="#screen-options" id="show-settings-link" class="show-settings"><?php _e('Screen Options') ?></a>

</div>

<?php } ?>

</div>

</div>

<?php

}

2811