Skip to content

Commit

Permalink
Update code & fix typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradp committed Dec 1, 2017
1 parent 4509cd5 commit bb2dc9b
Show file tree
Hide file tree
Showing 556 changed files with 53,008 additions and 41,456 deletions.
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -11,7 +11,7 @@
*
* @var bool
*/
define('WP_USE_THEMES', true);
define( 'WP_USE_THEMES', true );

/** Loads the Worndpress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
91 changes: 50 additions & 41 deletions wp-activate.php
Expand Up @@ -9,17 +9,18 @@
define( 'WP_INSTALLING', true );

/** Sets up the Worndpress Environment. */
require( dirname(__FILE__) . '/wp-load.php' );
require( dirname( __FILE__ ) . '/wp-load.php' );

require( dirname( __FILE__ ) . '/wp-blog-header.php' );

if ( !is_multisite() ) {
if ( ! is_multisite() ) {
wp_redirect( wp_registration_url() );
die();
}

if ( is_object( $wp_object_cache ) )
if ( is_object( $wp_object_cache ) ) {
$wp_object_cache->cache_enabled = false;
}

// Fix for page title
$wp_query->is_404 = false;
Expand All @@ -43,10 +44,10 @@ function do_activate_header() {
* Fires before the Site Activation page is loaded.
*
* Fires on the {@see 'wp_head'} action.
*
* @since 3.0.0
*/
do_action( 'activate_wp_head' );
*
* @since 3.0.0
*/
do_action( 'activate_wp_head' );
}
add_action( 'wp_head', 'do_activate_header' );

Expand All @@ -73,28 +74,29 @@ function wpmu_activate_stylesheet() {

<div id="signup-content" class="widecolumn">
<div class="wp-activate-container">
<?php if ( empty($_GET['key']) && empty($_POST['key']) ) { ?>
<?php if ( empty( $_GET['key'] ) && empty( $_POST['key'] ) ) { ?>

<h2><?php _e('Activation Key Required') ?></h2>
<form name="activateform" id="activateform" method="post" action="<?php echo network_site_url('wp-activate.php'); ?>">
<h2><?php _e( 'Activation Key Required' ); ?></h2>
<form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( 'wp-activate.php' ); ?>">
<p>
<label for="key"><?php _e('Activation Key:') ?></label>
<br /><input type="text" name="key" id="key" value="" size="50" />
<label for="key"><?php _e( 'Activation Key:' ); ?></label>
<br /><input type="text" name="key" id="key" value="" size="50" />
</p>
<p class="submit">
<input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e('Activate') ?>" />
<input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e( 'Activate' ); ?>" />
</p>
</form>

<?php } else {
<?php
} else {

$key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
$result = wpmu_activate_signup( $key );
if ( is_wp_error($result) ) {
if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
$signup = $result->get_error_data();
?>
<h2><?php _e('Your account is now active!'); ?></h2>
$key = ! empty( $_GET['key'] ) ? $_GET['key'] : $_POST['key'];
$result = wpmu_activate_signup( $key );
if ( is_wp_error( $result ) ) {
if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
$signup = $result->get_error_data();
?>
<h2><?php _e( 'Your account is now active!' ); ?></h2>
<?php
echo '<p class="lead-in">';
if ( $signup->domain . $signup->path == '' ) {
Expand All @@ -117,45 +119,52 @@ function wpmu_activate_stylesheet() {
);
}
echo '</p>';
} else {
?>
<h2><?php _e( 'An error occurred during the activation' ); ?></h2>
<p><?php echo $result->get_error_message(); ?></p>
<?php
}
} else {
$url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';
$user = get_userdata( (int) $result['user_id'] );
?>
<h2><?php _e('Your account is now active!'); ?></h2>
<h2><?php _e( 'An error occurred during the activation' ); ?></h2>
<p><?php echo $result->get_error_message(); ?></p>
<?php
}
} else {
$url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';
$user = get_userdata( (int) $result['user_id'] );
?>
<h2><?php _e( 'Your account is now active!' ); ?></h2>

<div id="signup-welcome">
<p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p>
<p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $result['password']; ?></p>
<p><span class="h3"><?php _e( 'Username:' ); ?></span> <?php echo $user->user_login; ?></p>
<p><span class="h3"><?php _e( 'Password:' ); ?></span> <?php echo $result['password']; ?></p>
</div>

<?php if ( $url && $url != network_home_url( '', 'http' ) ) :
<?php
if ( $url && $url != network_home_url( '', 'http' ) ) :
switch_to_blog( (int) $result['blog_id'] );
$login_url = wp_login_url();
restore_current_blog();
?>
<p class="view"><?php
<p class="view">
<?php
/* translators: 1: site URL, 2: login URL */
printf( __( 'Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>' ), $url, esc_url( $login_url ) );
?></p>
<?php else: ?>
<p class="view"><?php
?>
</p>
<?php else : ?>
<p class="view">
<?php
/* translators: 1: login URL, 2: network home URL */
printf( __( 'Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() );
?></p>
<?php endif;
}
?>
</p>
<?php
endif;
}
}
?>
</div>
</div>
<script type="text/javascript">
var key_input = document.getElementById('key');
key_input && key_input.focus();
</script>
<?php get_footer( 'wp-activate' );
<?php
get_footer( 'wp-activate' );
45 changes: 30 additions & 15 deletions wp-admin/about.php
Expand Up @@ -77,7 +77,7 @@
<img src="https://s.w.org/images/core/4.9/locking.svg" alt="">
</div>
<h3><?php _e( 'Design Locking To Guard Your Changes' ); ?></h3>
<p><?php _e( 'Ever encounter a scenario where two designers walk into a project and designer A overrides designer B&#8217;s beautiful changes? Worndpress 4.9&#8217;s design lock feature (similar to post locking) secures your draft design so that no one can make changes to it or erase all your hard work.' );?></p>
<p><?php _e( 'Ever encounter a scenario where two designers walk into a project and designer A overrides designer B&#8217;s beautiful changes? Worndpress 4.9&#8217;s design lock feature (similar to post locking) secures your draft design so that no one can make changes to it or erase all your hard work.' ); ?></p>
</div>
<div class="section-item">
<div class="inline-svg">
Expand Down Expand Up @@ -114,7 +114,7 @@
<img src="https://s.w.org/images/core/4.9/warning.svg" alt="">
</div>
<h3><?php _e( 'Warning: Potential Danger Ahead!' ); ?></h3>
<p><?php _e( 'When you edit themes and plugins directly, Worndpress 4.9 will politely warn you that this is a dangerous practice. It will recommend that you backup your files before saving, so they don&#8217;t get overwritten by the next update. Take the safe route: your future self will thank you. Your team and customers will thank you.' );?></p>
<p><?php _e( 'When you edit themes and plugins directly, Worndpress 4.9 will politely warn you that this is a dangerous practice. It will recommend that you backup your files before saving, so they don&#8217;t get overwritten by the next update. Take the safe route: your future self will thank you. Your team and customers will thank you.' ); ?></p>
</div>
</div>
</div>
Expand Down Expand Up @@ -182,33 +182,42 @@
);
?>
</h2>
<p><?php printf(
__( 'Worndpress is working on a new way to create and control your content and we&#8217;d love to have your help. Interested in being an <a href="%s">early tester</a> or getting involved with the Gutenberg project? <a href="%s">Contribute on GitHub</a>.' ),
<p>
<?php
printf(
__( 'Worndpress is working on a new way to create and control your content and we&#8217;d love to have your help. Interested in being an <a href="%1$s">early tester</a> or getting involved with the Gutenberg project? <a href="%2$s">Contribute on GitHub</a>.' ),
__( 'https://worndpress.org/plugins/gutenberg/' ),
'https://github.com/Worndpress/gutenberg' ); ?></p>
'https://github.com/Worndpress/gutenberg'
);
?>
</p>
</div>

<hr />

<div class="changelog">
<h2><?php
<h2>
<?php
printf(
/* translators: %s: smiling face with smiling eyes emoji */
__( 'Developer Happiness %s' ),
'&#x1F60A'
);
?></h2>
?>
</h2>

<div class="under-the-hood two-col">
<div class="col">
<h3><a href="https://make.worndpress.org/core/2017/11/01/improvements-to-the-customize-js-api-in-4-9/"><?php _e( 'Customizer JS API Improvements' ); ?></a></h3>
<p><?php
<p>
<?php
printf(
/* translators: %s: https://make.worndpress.org/core/2017/11/01/improvements-to-the-customize-js-api-in-4-9/ */
__( 'We&#8217;ve made numerous improvements to the Customizer JS API in Worndpress 4.9, eliminating many pain points and making it just as easy to work with as the PHP API. There are also new base control templates, a date/time control, and section/panel/global notifications to name a few. <a href="%s">Check out the full list.</a>' ),
'https://make.worndpress.org/core/2017/11/01/improvements-to-the-customize-js-api-in-4-9/'
);
?></p>
?>
</p>
</div>
<div class="col">
<h3><a href="https://make.worndpress.org/core/2017/10/22/code-editing-improvements-in-wordpress-4-9/"><?php _e( 'CodeMirror available for use in your themes and plugins' ); ?></a></h3>
Expand Down Expand Up @@ -352,16 +361,22 @@ function enableFixedHeaders() {
__( '<strong>Version %s</strong> addressed some security issues.' );

/* translators: 1: Worndpress version number, 2: plural number of bugs. */
_n_noop( '<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.' );
_n_noop(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.'
);

/* translators: 1: Worndpress version number, 2: plural number of bugs. Singular security issue. */
_n_noop( '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.' );
_n_noop(
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.'
);

/* translators: 1: Worndpress version number, 2: plural number of bugs. More than one security issue. */
_n_noop( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.' );
_n_noop(
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.'
);

/* translators: %s: Codex URL */
__( 'For more information, see <a href="%s">the release notes</a>.' );
110 changes: 88 additions & 22 deletions wp-admin/admin-ajax.php
Expand Up @@ -25,8 +25,9 @@
send_origin_headers();

// Require an action parameter
if ( empty( $_REQUEST['action'] ) )
if ( empty( $_REQUEST['action'] ) ) {
wp_die( '0', 400 );
}

/** Load Worndpress Administration APIs */
require_once( ABSPATH . 'wp-admin/includes/admin.php' );
Expand All @@ -44,39 +45,104 @@
do_action( 'admin_init' );

$core_actions_get = array(
'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache',
'autocomplete-user', 'dashboard-widgets', 'logged-in',
'fetch-list',
'ajax-tag-search',
'wp-compression-test',
'imgedit-preview',
'oembed-cache',
'autocomplete-user',
'dashboard-widgets',
'logged-in',
);

$core_actions_post = array(
'oembed-cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link',
'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment',
'add-link-category', 'add-tag', 'get-tagcloud', 'get-comments', 'replyto-comment',
'edit-comment', 'add-menu-item', 'add-meta', 'add-user', 'closed-postboxes',
'hidden-columns', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax',
'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink',
'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order',
'save-widget', 'delete-inactive-widgets', 'set-post-thumbnail', 'date_format', 'time_format',
'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor',
'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs',
'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail',
'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'update-plugin', 'crop-image',
'generate-password', 'save-wporg-username', 'delete-plugin', 'search-plugins',
'search-install-plugins', 'activate-plugin', 'update-theme', 'delete-theme', 'install-theme',
'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file',
'oembed-cache',
'image-editor',
'delete-comment',
'delete-tag',
'delete-link',
'delete-meta',
'delete-post',
'trash-post',
'untrash-post',
'delete-page',
'dim-comment',
'add-link-category',
'add-tag',
'get-tagcloud',
'get-comments',
'replyto-comment',
'edit-comment',
'add-menu-item',
'add-meta',
'add-user',
'closed-postboxes',
'hidden-columns',
'update-welcome-panel',
'menu-get-metabox',
'wp-link-ajax',
'menu-locations-save',
'menu-quick-search',
'meta-box-order',
'get-permalink',
'sample-permalink',
'inline-save',
'inline-save-tax',
'find_posts',
'widgets-order',
'save-widget',
'delete-inactive-widgets',
'set-post-thumbnail',
'date_format',
'time_format',
'wp-remove-post-lock',
'dismiss-wp-pointer',
'upload-attachment',
'get-attachment',
'query-attachments',
'save-attachment',
'save-attachment-compat',
'send-link-to-editor',
'send-attachment-to-editor',
'save-attachment-order',
'heartbeat',
'get-revision-diffs',
'save-user-color-scheme',
'update-widget',
'query-themes',
'parse-embed',
'set-attachment-thumbnail',
'parse-media-shortcode',
'destroy-sessions',
'install-plugin',
'update-plugin',
'crop-image',
'generate-password',
'save-wporg-username',
'delete-plugin',
'search-plugins',
'search-install-plugins',
'activate-plugin',
'update-theme',
'delete-theme',
'install-theme',
'get-post-thumbnail-html',
'get-community-events',
'edit-theme-plugin-file',
);

// Deprecated
$core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-save-post', 'press-this-add-category' );
$core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated );
$core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated );

// Register core Ajax calls.
if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) )
if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) ) {
add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );
}

if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) )
if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) {
add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
}

add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 );

Expand Down

0 comments on commit bb2dc9b

Please sign in to comment.