load_child_theme_textdomain

Definition:
function load_child_theme_textdomain( $domain, $path = false ) {}

Loads the child themes translated strings.
If the current locale exists as a .mo file in the child themes root directory, it will be included in the translated strings by the $domain.

Parameters

  • string $domain: Unique identifier for retrieving translated strings
  • $path

Defined filters

  • theme_locale
    apply_filters( 'theme_locale', get_locale()

Source code

function load_child_theme_textdomain( $domain, $path = false ) {

	$locale = apply_filters( 'theme_locale', get_locale(), $domain );



	$path = ( empty( $path ) ) ? get_stylesheet_directory() : $path;



	$mofile = "$path/$locale.mo";

	return load_textdomain($domain, $mofile);

}

2279

list_theme_updates

Definition:
function list_theme_updates() {}

Source code

function list_theme_updates() {

	$themes = get_theme_updates();

	if ( empty( $themes ) ) {

		echo '<h3>' . __( 'Themes' ) . '</h3>';

		echo '<p>' . __( 'Your themes are all up to date.' ) . '</p>';

		return;

	}



	$form_action = 'update-core.php?action=do-theme-upgrade';



?>

<h3><?php _e( 'Themes' ); ?></h3>

<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click “Update Themes”.' ); ?></p>

<p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>

<form method="post" action="<?php echo $form_action; ?>" name="upgrade-themes" class="upgrade">

<?php wp_nonce_field('upgrade-core'); ?>

<p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p>

<table class="widefat" cellspacing="0" id="update-themes-table">

	<thead>

	<tr>

		<th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></th>

		<th scope="col" class="manage-column"><label for="themes-select-all"><?php _e('Select All'); ?></label></th>

	</tr>

	</thead>



	<tfoot>

	<tr>

		<th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></th>

		<th scope="col" class="manage-column"><label for="themes-select-all-2"><?php _e('Select All'); ?></label></th>

	</tr>

	</tfoot>

	<tbody class="plugins">

<?php

	foreach ( (array) $themes as $stylesheet => $theme_data) {

		$screenshot = $theme_data->{'Theme Root URI'} . '/' . $stylesheet . '/' . $theme_data->Screenshot;



		echo "

	<tr class='active'>

		<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($stylesheet) . "' /></th>

		<td class='plugin-title'><img src='$screenshot' width='64' height='64' style='float:left; padding: 5px' /><strong>{$theme_data->Name}</strong>" .  sprintf(__('You have version %1$s installed. Update to %2$s.'), $theme_data->Version, $theme_data->update['new_version']) . "</td>

	</tr>";

	}

2277

list_plugin_updates

Definition:
function list_plugin_updates() {}

Source code

function list_plugin_updates() {

	global $wp_version;



	$cur_wp_version = preg_replace('/-.*$/', '', $wp_version);



	require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');

	$plugins = get_plugin_updates();

	if ( empty( $plugins ) ) {

		echo '<h3>' . __( 'Plugins' ) . '</h3>';

		echo '<p>' . __( 'Your plugins are all up to date.' ) . '</p>';

		return;

	}

	$form_action = 'update-core.php?action=do-plugin-upgrade';



	$core_updates = get_core_updates();

	if ( !isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare( $core_updates[0]->current, $cur_wp_version, '=') )

		$core_update_version = false;

	else

		$core_update_version = $core_updates[0]->current;

	?>

<h3><?php _e( 'Plugins' ); ?></h3>

<p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click “Update Plugins”.' ); ?></p>

<form method="post" action="<?php echo $form_action; ?>" name="upgrade-plugins" class="upgrade">

<?php wp_nonce_field('upgrade-core'); ?>

<p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p>

<table class="widefat" cellspacing="0" id="update-plugins-table">

	<thead>

	<tr>

		<th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th>

		<th scope="col" class="manage-column"><label for="plugins-select-all"><?php _e('Select All'); ?></label></th>

	</tr>

	</thead>



	<tfoot>

	<tr>

		<th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></th>

		<th scope="col" class="manage-column"><label for="plugins-select-all-2"><?php _e('Select All'); ?></label></th>

	</tr>

	</tfoot>

	<tbody class="plugins">

<?php

	foreach ( (array) $plugins as $plugin_file => $plugin_data) {

		$info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));

		// Get plugin compat for running version of WordPress.

		if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {

			$compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);

		} elseif ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {

			$compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];

			$compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);

		} else {

			$compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);

		}

		// Get plugin compat for updated version of WordPress.

		if ( $core_update_version ) {

			if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) {

				$update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];

				$compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);

			} else {

				$compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);

			}

		}

		// Get the upgrade notice for the new plugin version.

		if ( isset($plugin_data->update->upgrade_notice) ) {

			$upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);

		} else {

			$upgrade_notice = '';

		}

		echo "

	<tr class='active'>

		<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>

		<td><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>

	</tr>";

	}

2275

list_meta

Definition:
function list_meta( $meta ) {}

Parameters

  • unknown_type $meta

Source code

function list_meta( $meta ) {

	// Exit if no meta

	if ( ! $meta ) {

		echo '

<table id="list-table" style="display: none;">

	<thead>

	<tr>

		<th class="left">' . _x( 'Name', 'meta name' ) . '</th>

		<th>' . __( 'Value' ) . '</th>

	</tr>

	</thead>

	<tbody id="the-list" class="list:meta">

	<tr><td></td></tr>

	</tbody>

</table>'; //TBODY needed for list-manipulation JS

		return;

	}

	$count = 0;

?>

<table id="list-table">

	<thead>

	<tr>

		<th class="left"><?php _ex( 'Name', 'meta name' ) ?></th>

		<th><?php _e( 'Value' ) ?></th>

	</tr>

	</thead>

	<tbody id='the-list' class='list:meta'>

<?php

	foreach ( $meta as $entry )

		echo _list_meta_row( $entry, $count );

?>

	</tbody>

</table>

<?php

}

2273

list_files

Definition:
function list_files( $folder = '', $levels = 100 ) {}

Returns a listing of all files in the specified folder and all subdirectories up to 100 levels deep.
The depth of the recursiveness can be controlled by the $levels param.

Parameters

  • string $folder: Full path to folder
  • int $levels: (optional) Levels of folders to follow, Default: 100 (PHP Loop limit).

Return values

returns:False on failure, Else array of files

Source code

function list_files( $folder = '', $levels = 100 ) {

	if ( empty($folder) )

		return false;



	if ( ! $levels )

		return false;



	$files = array();

	if ( $dir = @opendir( $folder ) ) {

		while (($file = readdir( $dir ) ) !== false ) {

			if ( in_array($file, array('.', '..') ) )

				continue;

			if ( is_dir( $folder . '/' . $file ) ) {

				$files2 = list_files( $folder . '/' . $file, $levels - 1);

				if ( $files2 )

					$files = array_merge($files, $files2 );

				else

					$files[] = $folder . '/' . $file . '/';

			} else {

				$files[] = $folder . '/' . $file;

			}

		}

	}

	@closedir( $dir );

	return $files;

}

2271