Skip to content

Commit

Permalink
Docs: Standardize on 'backward compatibility/compatible' nomenclature…
Browse files Browse the repository at this point in the history
… in core inline docs.

Also use 'back-compat' in some inline comments where backward compatibility is the subject and shorthand feels more natural.

Note: 'backwards compatibility/compatibile' can also be considered correct, though it's primary seen in regular use in British English.

Props ocean90.
Fixes #36835.

Built from https://develop.svn.wordpress.org/trunk@37431


git-svn-id: http://core.svn.wordpress.org/trunk@37397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
DrewAPicture committed May 13, 2016
1 parent 1e40ba2 commit b1804af
Show file tree
Hide file tree
Showing 51 changed files with 95 additions and 96 deletions.
2 changes: 1 addition & 1 deletion wp-admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
if ( ! $page_hook = get_plugin_page_hook($plugin_page, $the_parent) ) {
$page_hook = get_plugin_page_hook($plugin_page, $plugin_page);

// Backwards compatibility for plugins using add_management_page().
// Back-compat for plugins using add_management_page().
if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) {
// There could be plugin specific params on the URL, so we need the whole query string
if ( !empty($_SERVER[ 'QUERY_STRING' ]) )
Expand Down
6 changes: 3 additions & 3 deletions wp-admin/includes/ajax-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,7 @@ function wp_ajax_save_attachment() {
}

/**
* Ajax handler for saving backwards compatible attachment attributes.
* Ajax handler for saving backward compatible attachment attributes.
*
* @since 3.5.0
*/
Expand Down Expand Up @@ -2552,7 +2552,7 @@ function wp_ajax_save_attachment_order() {
* Ajax handler for sending an attachment to the editor.
*
* Generates the HTML to send an attachment to the editor.
* Backwards compatible with the media_send_to_editor filter
* Backward compatible with the media_send_to_editor filter
* and the chain of filters that follow.
*
* @since 3.5.0
Expand Down Expand Up @@ -2617,7 +2617,7 @@ function wp_ajax_send_attachment_to_editor() {
*
* Generates the HTML to send a non-image embed link to the editor.
*
* Backwards compatible with the following filters:
* Backward compatible with the following filters:
* - file_send_to_editor_url
* - audio_send_to_editor_url
* - video_send_to_editor_url
Expand Down
12 changes: 6 additions & 6 deletions wp-admin/includes/class-wp-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function __construct( $args = array() ) {
}

/**
* Make private properties readable for backwards compatibility.
* Make private properties readable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand All @@ -181,7 +181,7 @@ public function __get( $name ) {
}

/**
* Make private properties settable for backwards compatibility.
* Make private properties settable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand All @@ -197,7 +197,7 @@ public function __set( $name, $value ) {
}

/**
* Make private properties checkable for backwards compatibility.
* Make private properties checkable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand All @@ -212,7 +212,7 @@ public function __isset( $name ) {
}

/**
* Make private properties un-settable for backwards compatibility.
* Make private properties un-settable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand All @@ -226,7 +226,7 @@ public function __unset( $name ) {
}

/**
* Make private/protected methods readable for backwards compatibility.
* Make private/protected methods readable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand Down Expand Up @@ -432,7 +432,7 @@ protected function get_bulk_actions() {
* @access protected
*
* @param string $which The location of the bulk actions: 'top' or 'bottom'.
* This is designated as optional for backwards-compatibility.
* This is designated as optional for backward compatibility.
*/
protected function bulk_actions( $which = '' ) {
if ( is_null( $this->_actions ) ) {
Expand Down
6 changes: 2 additions & 4 deletions wp-admin/includes/class-wp-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,7 @@ public function in_admin( $admin = null ) {
}

/**
* Sets the old string-based contextual help for the screen.
*
* For backwards compatibility.
* Sets the old string-based contextual help for the screen for backward compatibility.
*
* @since 3.3.0
*
Expand Down Expand Up @@ -722,7 +720,7 @@ public function remove_screen_reader_content() {
/**
* Render the screen's help section.
*
* This will trigger the deprecated filters for backwards compatibility.
* This will trigger the deprecated filters for backward compatibility.
*
* @since 3.3.0
*
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ function is_plugin_active_for_network( $plugin ) {
* be activated only as a network wide plugin. The plugin would also work
* when Multisite is not enabled.
*
* Checks for "Site Wide Only: true" for backwards compatibility.
* Checks for "Site Wide Only: true" for backward compatibility.
*
* @since 3.0.0
*
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ $document.ready( function() {
}

/*
* The `.below-h2` class is here just for backwards compatibility with plugins
* The `.below-h2` class is here just for backward compatibility with plugins
* that are (incorrectly) using it. Do not use. Use `.inline` instead. See #34570.
*/
$( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $( '.wrap h1, .wrap h2' ).first() );
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/js/password-strength-meter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ var passwordStrength;
}
};

// Backwards compatibility.
// Back-compat.
passwordStrength = wp.passwordStrength.meter;
})(jQuery);
})(jQuery);
2 changes: 1 addition & 1 deletion wp-admin/js/wp-fullscreen-stub.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Distraction-Free Writing (wp-fullscreen) backwards compatibility stub.
* Distraction-Free Writing (wp-fullscreen) backward compatibility stub.
* Todo: remove at the end of 2016.
*
* Original was deprecated in 4.1, removed in 4.3.
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function _add_themes_utility_last() {
$_wp_real_parent_file['wpmu-admin.php'] = 'tools.php';
$_wp_real_parent_file['ms-admin.php'] = 'tools.php';

// ensure we're backwards compatible
// Ensure backward compatibility.
$compat = array(
'index' => 'dashboard',
'edit' => 'posts',
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/options-head.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
wp_reset_vars( array( 'action' ) );

if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
// For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
// For back-compat with plugins that don't use the Settings API and just set updated=1 in the redirect.
add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
}

Expand Down
3 changes: 1 addition & 2 deletions wp-admin/theme-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@
/**
* Filter the tabs shown on the Add Themes screen.
*
* This filter is for backwards compatibility only, for the suppression
* of the upload tab.
* This filter is for backward compatibility only, for the suppression of the upload tab.
*
* @since 2.8.0
*
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/author-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function get_the_author($deprecated = '') {
* still use the old behavior will also pass the value from get_the_author().
*
* The normal, expected behavior of this function is to echo the author and not
* return it. However, backwards compatibility has to be maintained.
* return it. However, backward compatibility has to be maintained.
*
* @since 0.71
* @see get_the_author()
Expand Down
8 changes: 4 additions & 4 deletions wp-includes/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class WP_Object_Cache {
private $multisite;

/**
* Makes private properties readable for backwards compatibility.
* Makes private properties readable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand All @@ -357,7 +357,7 @@ public function __get( $name ) {
}

/**
* Makes private properties settable for backwards compatibility.
* Makes private properties settable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand All @@ -371,7 +371,7 @@ public function __set( $name, $value ) {
}

/**
* Makes private properties checkable for backwards compatibility.
* Makes private properties checkable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand All @@ -384,7 +384,7 @@ public function __isset( $name ) {
}

/**
* Makes private properties un-settable for backwards compatibility.
* Makes private properties un-settable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Retrieve list of category objects.
*
* If you change the type to 'link' in the arguments, then the link categories
* will be returned instead. Also all categories will be updated to be backwards
* will be returned instead. Also all categories will be updated to be backward
* compatible with pre-2.3 plugins and themes.
*
* @since 2.1.0
Expand Down Expand Up @@ -77,7 +77,7 @@ function get_categories( $args = '' ) {
* If you look at get_term(), then both types will be passed through several
* filters and finally sanitized based on the $filter parameter value.
*
* The category will converted to maintain backwards compatibility.
* The category will converted to maintain backward compatibility.
*
* @since 1.5.1
*
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/certificates/ca-bundle.crt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##
## Certificate data from Mozilla as of: Wed Sep 16 08:58:11 2015
## Includes a WordPress Modification - We include the 'legacy' 1024bit certificates
## for backwards compatibility. See https://core.trac.wordpress.org/ticket/34935#comment:10
## for backward compatibility. See https://core.trac.wordpress.org/ticket/34935#comment:10
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/class-oembed.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class WP_oEmbed {
public static $early_providers = array();

/**
* A list of private/protected methods, used for backwards compatibility.
* A list of private/protected methods, used for backward compatibility.
*
* @since 4.2.0
* @access private
Expand Down Expand Up @@ -192,7 +192,7 @@ public function __construct() {
}

/**
* Exposes private/protected methods for backwards compatibility.
* Exposes private/protected methods for backward compatibility.
*
* @since 4.0.0
* @access public
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/class-wp-comment-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class WP_Comment_Query {
public $max_num_pages = 0;

/**
* Make private/protected methods readable for backwards compatibility.
* Make private/protected methods readable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand Down
3 changes: 2 additions & 1 deletion wp-includes/class-wp-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ private function __construct() {}
* @type string $editor_class Extra classes to add to the editor textarea element. Default empty.
* @type bool $teeny Whether to output the minimal editor config. Examples include
* Press This and the Comment editor. Default false.
* @type bool $dfw Deprecated in 4.1. Since 4.3 used only to enqueue wp-fullscreen-stub.js for backwards compatibility.
* @type bool $dfw Deprecated in 4.1. Since 4.3 used only to enqueue wp-fullscreen-stub.js
* for backward compatibility.
* @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to
* TinyMCE using an array. Default true.
* @type bool|array $quicktags Whether to load Quicktags. Can be used to pass settings directly to
Expand Down
8 changes: 4 additions & 4 deletions wp-includes/class-wp-http-requests-response.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function get_cookies() {
/**
* Check if an ArrayAccess offset exists.
*
* This is for backwards compatibility for array access.
* This is for array access back-compat.
*
* @param string|int $key Array offset.
* @return bool True if the offset exists, false otherwise.
Expand All @@ -157,7 +157,7 @@ public function offsetExists( $key ) {
/**
* Get an ArrayAccess value.
*
* This is for backwards compatibility for array access.
* This is for array access back-compat.
*
* @param string|int $key Array offset to get.
* @return mixed Value if the key is a valid offset, null if invalid.
Expand Down Expand Up @@ -189,7 +189,7 @@ public function offsetGet( $key ) {
/**
* Set an ArrayAccess value.
*
* This is for backwards compatibility for array access.
* This is for array access back-compat.
*
* @param string|int $key Array offset to set.
* @param mixed $value Value to set.
Expand Down Expand Up @@ -219,7 +219,7 @@ public function offsetSet( $key, $value ) {
/**
* Unset an ArrayAccess value.
*
* This is for backwards compatibility for array access.
* This is for array access back-compat.
*
* @param string|int $key Array offset to remove.
*/
Expand Down
4 changes: 2 additions & 2 deletions wp-includes/class-wp-http-streams.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public static function test( $args = array() ) {
/**
* Deprecated HTTP Transport method which used fsockopen.
*
* This class is not used, and is included for backwards compatibility only.
* This class is not used, and is included for backward compatibility only.
* All code should make use of WP_Http directly through its API.
*
* @see WP_HTTP::request
Expand All @@ -424,5 +424,5 @@ public static function test( $args = array() ) {
* @deprecated 3.7.0 Please use WP_HTTP::request() directly
*/
class WP_HTTP_Fsockopen extends WP_HTTP_Streams {
// For backwards compatibility for users who are using the class directly.
// For backward compatibility for users who are using the class directly.
}
2 changes: 1 addition & 1 deletion wp-includes/class-wp-image-editor-imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIAN
* Use resizeImage() when it's available and a valid filter value is set.
* Otherwise, fall back to the scaleImage() method for resizing, which
* results in better image quality over resizeImage() with default filter
* settings and retains backwards compatibility with pre 4.5 functionality.
* settings and retains backward compatibility with pre 4.5 functionality.
*/
if ( is_callable( array( $this->image, 'resizeImage' ) ) && $filter ) {
$this->image->setOption( 'filter:support', '2.0' );
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/class-wp-image-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function set_quality( $quality = null ) {
}
}

// Allow 0, but squash to 1 due to identical images in GD, and for backwards compatibility.
// Allow 0, but squash to 1 due to identical images in GD, and for backward compatibility.
if ( 0 === $quality ) {
$quality = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/class-wp-rewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ public function add_endpoint( $name, $places, $query_var = true ) {
* }
*/
public function add_permastruct( $name, $struct, $args = array() ) {
// Backwards compatibility for the old parameters: $with_front and $ep_mask.
// Back-compat for the old parameters: $with_front and $ep_mask.
if ( ! is_array( $args ) )
$args = array( 'with_front' => $args );
if ( func_num_args() == 4 )
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/class-wp-roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct() {
}

/**
* Make private/protected methods readable for backwards compatibility.
* Make private/protected methods readable for backward compatibility.
*
* @since 4.0.0
* @access public
Expand Down
6 changes: 4 additions & 2 deletions wp-includes/class-wp-theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,10 @@ public function offsetGet( $offset ) {
switch ( $offset ) {
case 'Name' :
case 'Title' :
// See note above about using translated data. get() is not ideal.
// It is only for backwards compatibility. Use display().
/*
* See note above about using translated data. get() is not ideal.
* It is only for backward compatibility. Use display().
*/
return $this->get('Name');
case 'Author' :
return $this->display( 'Author');
Expand Down
Loading

0 comments on commit b1804af

Please sign in to comment.