Text Changes: Add a full stop to "Invalid taxonomy" and "Invalid term ID" strings, for consistency with similar post-related messages.

See #18218, #32329.
Built from https://develop.svn.wordpress.org/trunk@38077


git-svn-id: http://core.svn.wordpress.org/trunk@38018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2016-07-17 16:15:34 +00:00
parent 866bd39813
commit 7d421dbe42
6 changed files with 31 additions and 29 deletions

View File

@ -10,12 +10,12 @@
require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! $taxnow )
wp_die( __( 'Invalid taxonomy' ) );
wp_die( __( 'Invalid taxonomy.' ) );
$tax = get_taxonomy( $taxnow );
if ( ! $tax )
wp_die( __( 'Invalid taxonomy' ) );
wp_die( __( 'Invalid taxonomy.' ) );
if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
wp_die( __( 'Sorry, you are not allowed to manage these items.' ) );

View File

@ -53,7 +53,7 @@ class WP_Terms_List_Table extends WP_List_Table {
$taxonomy = 'post_tag';
if ( ! taxonomy_exists( $taxonomy ) )
wp_die( __( 'Invalid taxonomy' ) );
wp_die( __( 'Invalid taxonomy.' ) );
$tax = get_taxonomy( $taxonomy );

View File

@ -176,7 +176,7 @@ final class WP_Term {
// Don't return terms from invalid taxonomies.
if ( ! taxonomy_exists( $_term->taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
$_term = sanitize_term( $_term, $_term->taxonomy, 'raw' );

View File

@ -1426,7 +1426,7 @@ class wp_xmlrpc_server extends IXR_Server {
$term = get_term_by( 'id', $term_id, $taxonomy );
if ( ! $term )
return new IXR_Error( 403, __( 'Invalid term ID' ) );
return new IXR_Error( 403, __( 'Invalid term ID.' ) );
$terms[$taxonomy][] = (int) $term_id;
}
@ -1873,7 +1873,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.newTerm' );
if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
$taxonomy = get_taxonomy( $content_struct['taxonomy'] );
@ -1960,7 +1960,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.editTerm' );
if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )
return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
$taxonomy = get_taxonomy( $content_struct['taxonomy'] );
@ -1978,7 +1978,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error( 500, $term->get_error_message() );
if ( ! $term )
return new IXR_Error( 404, __( 'Invalid term ID' ) );
return new IXR_Error( 404, __( 'Invalid term ID.' ) );
if ( isset( $content_struct['name'] ) ) {
$term_data['name'] = trim( $content_struct['name'] );
@ -2056,7 +2056,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.deleteTerm' );
if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
$taxonomy = get_taxonomy( $taxonomy );
@ -2069,7 +2069,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error( 500, $term->get_error_message() );
if ( ! $term )
return new IXR_Error( 404, __( 'Invalid term ID' ) );
return new IXR_Error( 404, __( 'Invalid term ID.' ) );
$result = wp_delete_term( $term_id, $taxonomy->name );
@ -2127,7 +2127,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getTerm' );
if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
$taxonomy = get_taxonomy( $taxonomy );
@ -2140,7 +2140,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error( 500, $term->get_error_message() );
if ( ! $term )
return new IXR_Error( 404, __( 'Invalid term ID' ) );
return new IXR_Error( 404, __( 'Invalid term ID.' ) );
return $this->_prepare_term( $term );
}
@ -2185,7 +2185,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getTerms' );
if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
$taxonomy = get_taxonomy( $taxonomy );
@ -2280,7 +2280,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getTaxonomy' );
if ( ! taxonomy_exists( $taxonomy ) )
return new IXR_Error( 403, __( 'Invalid taxonomy' ) );
return new IXR_Error( 403, __( 'Invalid taxonomy.' ) );
$taxonomy = get_taxonomy( $taxonomy );

View File

@ -505,7 +505,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
*/
function unregister_taxonomy( $taxonomy ) {
if ( ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
$taxonomy_args = get_taxonomy( $taxonomy );
@ -736,7 +736,7 @@ function get_objects_in_term( $term_ids, $taxonomies, $args = array() ) {
}
foreach ( (array) $taxonomies as $taxonomy ) {
if ( ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
}
@ -826,7 +826,7 @@ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {
}
if ( $taxonomy && ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
if ( $term instanceof WP_Term ) {
@ -988,8 +988,9 @@ function get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filter
* @return array|WP_Error List of Term IDs. WP_Error returned if `$taxonomy` does not exist.
*/
function get_term_children( $term_id, $taxonomy ) {
if ( ! taxonomy_exists($taxonomy) )
return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
if ( ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
$term_id = intval( $term_id );
@ -1208,7 +1209,7 @@ function get_terms( $args = array(), $deprecated = '' ) {
if ( ! empty( $args['taxonomy'] ) ) {
foreach ( $args['taxonomy'] as $taxonomy ) {
if ( ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
}
}
@ -1975,7 +1976,7 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) {
foreach ( $taxonomies as $taxonomy ) {
if ( ! taxonomy_exists($taxonomy) )
return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
if ( !is_array($object_ids) )
@ -2226,7 +2227,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
global $wpdb;
if ( ! taxonomy_exists($taxonomy) ) {
return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
/**
* Filters a term before it is sanitized and inserted into the database.
@ -2241,10 +2242,10 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
return $term;
}
if ( is_int($term) && 0 == $term ) {
return new WP_Error('invalid_term_id', __('Invalid term ID'));
return new WP_Error( 'invalid_term_id', __( 'Invalid term ID.' ) );
}
if ( '' == trim($term) ) {
return new WP_Error('empty_term_name', __('A name is required for this term'));
return new WP_Error( 'empty_term_name', __( 'A name is required for this term.' ) );
}
$defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
$args = wp_parse_args( $args, $defaults );
@ -2473,8 +2474,9 @@ function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) {
$object_id = (int) $object_id;
if ( ! taxonomy_exists($taxonomy) )
return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
if ( ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
if ( !is_array($terms) )
$terms = array($terms);
@ -2611,7 +2613,7 @@ function wp_remove_object_terms( $object_id, $terms, $taxonomy ) {
$object_id = (int) $object_id;
if ( ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
if ( ! is_array( $terms ) ) {
@ -2807,7 +2809,7 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) {
global $wpdb;
if ( ! taxonomy_exists( $taxonomy ) ) {
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
}
$term_id = (int) $term_id;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-beta3-38076';
$wp_version = '4.6-beta3-38077';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.