Commit 1600c5c1 authored by lucha's avatar lucha Committed by lechuck

Wordpress 3.7.1

parent 97028840
......@@ -14,4 +14,4 @@
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
......@@ -8,7 +8,7 @@
<body>
<h1 id="logo">
<a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
<br /> Version 3.6.1
<br /> Version 3.7
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
......
......@@ -11,7 +11,7 @@ define( 'WP_INSTALLING', true );
/** Sets up the WordPress Environment. */
require( dirname(__FILE__) . '/wp-load.php' );
require( './wp-blog-header.php' );
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
if ( !is_multisite() ) {
wp_redirect( site_url( '/wp-login.php?action=register' ) );
......@@ -21,6 +21,14 @@ if ( !is_multisite() ) {
if ( is_object( $wp_object_cache ) )
$wp_object_cache->cache_enabled = false;
// Fix for page title
$wp_query->is_404 = false;
/**
* Fires before the Site Activation page is loaded.
*
* @since 3.0
*/
do_action( 'activate_header' );
/**
......@@ -29,7 +37,12 @@ do_action( 'activate_header' );
* @since MU
*/
function do_activate_header() {
do_action( 'activate_wp_head' );
/**
* Fires before the Site Activation page is loaded, but on the wp_head action.
*
* @since 3.0
*/
do_action( 'activate_wp_head' );
}
add_action( 'wp_head', 'do_activate_header' );
......@@ -116,4 +129,4 @@ get_header();
var key_input = document.getElementById('key');
key_input && key_input.focus();
</script>
<?php get_footer(); ?>
\ No newline at end of file
<?php get_footer(); ?>
This diff is collapsed.
......@@ -38,6 +38,7 @@ require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
send_nosniff_header();
nocache_headers();
/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );
$core_actions_get = array(
......@@ -68,10 +69,26 @@ if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_po
add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 );
if ( is_user_logged_in() )
do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions
else
do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); // Non-admin actions
if ( is_user_logged_in() ) {
/**
* Fires authenticated AJAX actions for logged-in users.
*
* The dynamic portion of the hook name, $_REQUEST['action'],
* refers to the name of the AJAX action callback being fired.
*
* @since 2.1.0
*/
do_action( 'wp_ajax_' . $_REQUEST['action'] );
} else {
/**
* Fires non-authenticated AJAX actions for logged-out users.
*
* The dynamic portion of the hook name, $_REQUEST['action'],
* refers to the name of the AJAX action callback being fired.
*
* @since 2.8.0
*/
do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );
}
// Default status
die( '0' );
......@@ -16,16 +16,64 @@ if ( !defined('ABSPATH') )
<div class="clear"></div></div><!-- wpcontent -->
<div id="wpfooter">
<?php do_action( 'in_admin_footer' ); ?>
<p id="footer-left" class="alignleft"><?php
echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . __( 'Thank you for creating with <a href="http://wordpress.org/">WordPress</a>.' ) . '</span>' );
?></p>
<p id="footer-upgrade" class="alignright"><?php echo apply_filters( 'update_footer', '' ); ?></p>
<div class="clear"></div>
<?php
/**
* Fires after the opening tag for the admin footer.
*
* @since 2.5.0
*/
do_action( 'in_admin_footer' );
?>
<p id="footer-left" class="alignleft">
<?php
/**
* Filter the "Thank you" text displayed in the admin footer.
*
* @since 2.8.0
* @param string The content that will be printed.
*/
echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . __( 'Thank you for creating with <a href="http://wordpress.org/">WordPress</a>.' ) . '</span>' );
?>
</p>
<p id="footer-upgrade" class="alignright">
<?php
/**
* Filter the version/update text displayed in the admin footer.
*
* @see core_update_footer() WordPress prints the current version and update information,
* using core_update_footer() at priority 10.
*
* @since 2.3.0
* @param string The content that will be printed.
*/
echo apply_filters( 'update_footer', '' );
?>
</p>
<div class="clear"></div>
</div>
<?php
/**
* Print scripts or data before the default footer scripts.
*
* @since 1.2.0
* @param string The data to print.
*/
do_action('admin_footer', '');
/**
* Prints any scripts and data queued for the footer.
*
* @since 2.8.0
*/
do_action('admin_print_footer_scripts');
/**
* Print scripts or data after the default footer scripts.
*
* @since 2.8.0
*
* @param string $GLOBALS['hook_suffix'] The current admin page.
*/
do_action("admin_footer-" . $GLOBALS['hook_suffix']);
// get_site_option() won't exist when auto upgrading from <= 2.7
......
......@@ -8,7 +8,7 @@
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
if ( ! defined( 'WP_ADMIN' ) )
require_once( './admin.php' );
require_once( dirname( __FILE__ ) . '/admin.php' );
// In case admin-header.php is included in a function.
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
......@@ -22,9 +22,9 @@ get_admin_page_title();
$title = esc_html( strip_tags( $title ) );
if ( is_network_admin() )
$admin_title = __( 'Network Admin' );
$admin_title = sprintf( __('Network Admin: %s'), esc_html( $current_site->site_name ) );
elseif ( is_user_admin() )
$admin_title = __( 'Global Dashboard' );
$admin_title = sprintf( __('Global Dashboard: %s'), esc_html( $current_site->site_name ) );
else
$admin_title = get_bloginfo( 'name' );
......@@ -33,6 +33,14 @@ if ( $admin_title == $title )
else
$admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $admin_title );
/**
* Filter the <title> content for an admin page.
*
* @since 3.1.0
*
* @param string $admin_title The page title, with extra context added.
* @param string $title The original page title.
*/
$admin_title = apply_filters( 'admin_title', $admin_title, $title );
wp_user_settings();
......@@ -60,13 +68,56 @@ var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
</script>
<?php
do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-$hook_suffix");
do_action('admin_print_styles');
do_action("admin_print_scripts-$hook_suffix");
do_action('admin_print_scripts');
do_action("admin_head-$hook_suffix");
do_action('admin_head');
/**
* Enqueue scripts for all admin pages.
*
* @since 2.8.0
*
* @param string $hook_suffix The current admin page.
*/
do_action( 'admin_enqueue_scripts', $hook_suffix );
/**
* Print styles for a specific admin page based on $hook_suffix.
*
* @since 2.6.0
*/
do_action( "admin_print_styles-$hook_suffix" );
/**
* Print styles for all admin pages.
*
* @since 2.6.0
*/
do_action( 'admin_print_styles' );
/**
* Print scripts for a specific admin page based on $hook_suffix.
*
* @since 2.1.0
*/
do_action( "admin_print_scripts-$hook_suffix" );
/**
* Print scripts for all admin pages.
*
* @since 2.1.0
*/
do_action( 'admin_print_scripts' );
/**
* Fires in <head> for a specific admin page based on $hook_suffix.
*
* @since 2.1.0
*/
do_action( "admin_head-$hook_suffix" );
/**
* Fires in <head> for all admin pages.
*
* @since 2.1.0
*/
do_action( 'admin_head' );
if ( get_user_setting('mfold') == 'f' )
$admin_body_class .= ' folded';
......@@ -80,6 +131,12 @@ if ( is_admin_bar_showing() )
if ( is_rtl() )
$admin_body_class .= ' rtl';
if ( $current_screen->post_type )
$admin_body_class .= ' post-type-' . $current_screen->post_type;
if ( $current_screen->taxonomy )
$admin_body_class .= ' taxonomy-' . $current_screen->taxonomy;
$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) );
$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
......@@ -92,6 +149,19 @@ $admin_body_class .= ' no-customize-support';
?>
</head>
<?php
/**
* Filter the admin <body> CSS classes.
*
* This filter differs from the post_class or body_class filters in two important ways:
* 1. $classes is a space-separated string of class names instead of an array.
* 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, and no-js cannot be removed.
*
* @since 2.3.0
*
* @param string $classes Space-separated string of CSS classes.
*/
?>
<body class="wp-admin wp-core-ui no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
<script type="text/javascript">
document.body.className = document.body.className.replace('no-js','js');
......@@ -109,7 +179,12 @@ if ( current_user_can( 'edit_theme_options' ) )
<div id="wpcontent">
<?php
do_action('in_admin_header');
/**
* Fires at the beginning of the content section in an admin page.
*
* @since 3.0.0
*/
do_action( 'in_admin_header' );
?>
<div id="wpbody">
......@@ -125,14 +200,35 @@ $current_screen->set_parentage( $parent_file );
$current_screen->render_screen_meta();
if ( is_network_admin() )
do_action('network_admin_notices');
elseif ( is_user_admin() )
do_action('user_admin_notices');
else
do_action('admin_notices');
if ( is_network_admin() ) {
/**
* Print network admin screen notices.
*
* @since 3.1.0
*/
do_action( 'network_admin_notices' );
} elseif ( is_user_admin() ) {
/**
* Print user admin screen notices.
*
* @since 3.1.0
*/
do_action( 'user_admin_notices' );
} else {
/**
* Print admin screen notices.
*
* @since 3.1.0
*/
do_action( 'admin_notices' );
}
do_action('all_admin_notices');
/**
* Print generic admin screen notices.
*
* @since 3.1.0
*/
do_action( 'all_admin_notices' );
if ( $parent_file == 'options-general.php' )
require(ABSPATH . 'wp-admin/options-head.php');
<?php
/**
* WordPress Administration Generic POST Handler.
* WordPress Generic Request (POST/GET) Handler
*
* Intended for form submission handling in themes and plugins.
*
* @package WordPress
* @subpackage Administration
......@@ -12,13 +14,17 @@ define('WP_ADMIN', true);
if ( defined('ABSPATH') )
require_once(ABSPATH . 'wp-load.php');
else
require_once('../wp-load.php');
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
/** Allow for cross-domain requests (from the frontend). */
send_origin_headers();
require_once(ABSPATH . 'wp-admin/includes/admin.php');
nocache_headers();
do_action('admin_init');
/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );
$action = 'admin_post';
......@@ -28,4 +34,12 @@ if ( !wp_validate_auth_cookie() )
if ( !empty($_REQUEST['action']) )
$action .= '_' . $_REQUEST['action'];
do_action($action);
/**
* Fires the requested handler action.
*
* admin_post_nopriv_{$_REQUEST['action']} is called for not-logged-in users.
* admin_post_{$_REQUEST['action']} is called for logged-in users.
*
* @since 2.6.0
*/
do_action( $action );
......@@ -36,27 +36,43 @@ if ( get_option('db_upgraded') ) {
update_option( 'db_upgraded', false );
/**
* Runs on the next page load after successful upgrade
* Fires on the next page load after a successful DB upgrade.
*
* @since 2.8
* @since 2.8.0
*/
do_action('after_db_upgrade');
do_action( 'after_db_upgrade' );
} elseif ( get_option('db_version') != $wp_db_version && empty($_POST) ) {
if ( !is_multisite() ) {
wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
exit;
/**
* Filter whether to attempt to perform the multisite DB upgrade routine.
*
* In single site, the user would be redirected to wp-admin/upgrade.php.
* In multisite, it is automatically fired, but only when this filter
* returns true.
*
* If the network is 50 sites or less, it will run every time. Otherwise,
* it will throttle itself to reduce load.
*
* @since 3.0.0
*
* @param bool true Whether to perform the Multisite upgrade routine. Default true.
*/
} elseif ( apply_filters( 'do_mu_upgrade', true ) ) {
/**
* On really small MU installs run the upgrader every time,
* else run it less often to reduce load.
*
* @since 2.8.4b
*/
$c = get_blog_count();
// If 50 or fewer sites, run every time. Else, run "about ten percent" of the time. Shh, don't check that math.
if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) == 1 ) ) {
require_once( ABSPATH . WPINC . '/http.php' );
$response = wp_remote_get( admin_url( 'upgrade.php?step=1' ), array( 'timeout' => 120, 'httpversion' => '1.1' ) );
/**
* Fires after the multisite DB upgrade is complete.
*
* @since 3.0.0
*
* @param array|WP_Error $response The upgrade response array or WP_Error on failure.
*/
do_action( 'after_mu_upgrade', $response );
unset($response);
}
......@@ -103,10 +119,35 @@ elseif ( WP_USER_ADMIN )
else
require(ABSPATH . 'wp-admin/menu.php');
if ( current_user_can( 'manage_options' ) )
if ( current_user_can( 'manage_options' ) ) {
/**
* Filter the maximum memory limit available for administration screens.
*
* This only applies to administrators, who may require more memory for tasks like updates.
* Memory limits when processing images (uploaded or edited by users of any role) are
* handled separately.
*
* The WP_MAX_MEMORY_LIMIT constant specifically defines the maximum memory limit available
* when in the administration back-end. The default is 256M, or 256 megabytes of memory.
*
* @since 3.0.0
*
* @param string 'WP_MAX_MEMORY_LIMIT' The maximum WordPress memory limit. Default 256M.
*/
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
}
do_action('admin_init');
/**
* Fires as an admin screen or script is being initialized.
*
* Note, this does not just run on user-facing admin screens.
* It runs on admin-ajax.php and admin-post.php as well.
*
* This is roughly analgous to the more general 'init' hook, which fires earlier.
*
* @since 2.5.0
*/
do_action( 'admin_init' );
if ( isset($plugin_page) ) {
if ( !empty($typenow) )
......@@ -142,11 +183,38 @@ set_current_screen();
// Handle plugin admin pages.
if ( isset($plugin_page) ) {
if ( $page_hook ) {
do_action('load-' . $page_hook);
/**
* Fires before a particular screen is loaded.
*
* The load-* hook fires in a number of contexts. This hook is for plugin screens
* where a callback is provided when the screen is registered.
*
* The dynamic portion of the hook name, $page_hook, refers to a mixture of plugin
* page information including:
* 1. The page type. If the plugin page is registered as a submenu page, such as for
* Settings, the page type would be 'settings'. Otherwise the type is 'toplevel'.
* 2. A separator of '_page_'.
* 3. The plugin basename minus the file extension.
*
* Together, the three parts form the $page_hook. Citing the example above,
* the hook name used would be 'load-settings_page_pluginbasename'.
*
* @see get_plugin_page_hook()
*
* @since 2.1.0
*/
do_action( 'load-' . $page_hook );
if (! isset($_GET['noheader']))
require_once(ABSPATH . 'wp-admin/admin-header.php');
do_action($page_hook);
/**
* Used to call the registered callback for a plugin screen.
*
* @access private
*
* @since 1.5.0
*/
do_action( $page_hook );
} else {
if ( validate_file($plugin_page) )
wp_die(__('Invalid plugin page'));
......@@ -154,7 +222,19 @@ if ( isset($plugin_page) ) {
if ( !( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) && !( file_exists(WPMU_PLUGIN_DIR . "/$plugin_page") && is_file(WPMU_PLUGIN_DIR . "/$plugin_page") ) )
wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
do_action('load-' . $plugin_page);
/**
* Fires before a particular screen is loaded.
*
* The load-* hook fires in a number of contexts. This hook is for plugin screens
* where the file to load is directly included, rather than the use of a function.
*
* The dynamic portion of the hook name, $plugin_page, refers to the plugin basename.
*
* @see plugin_basename()
*
* @since 1.5.0
*/