WordPress.org

Make WordPress Core

Changeset 39756


Ignore:
Timestamp:
01/10/17 02:40:00 (6 months ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Use an existing string for "Invalid post type" error message.

Props ramiy.
Fixes #39171.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/async-upload.php

    r37914 r39756  
    5353    $post = get_post( $id ); 
    5454    if ( 'attachment' != $post->post_type ) 
    55         wp_die( __( 'Unknown post type.' ) ); 
     55        wp_die( __( 'Invalid post type.' ) ); 
    5656    if ( ! current_user_can( 'edit_post', $id ) ) 
    5757        wp_die( __( 'Sorry, you are not allowed to edit this item.' ) ); 
  • trunk/src/wp-admin/post.php

    r37914 r39756  
    108108 
    109109    if ( ! $post_type_object ) 
    110         wp_die( __( 'Unknown post type.' ) ); 
     110        wp_die( __( 'Invalid post type.' ) ); 
    111111 
    112112    if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { 
     
    209209 
    210210    if ( ! $post_type_object ) 
    211         wp_die( __( 'Unknown post type.' ) ); 
     211        wp_die( __( 'Invalid post type.' ) ); 
    212212 
    213213    if ( ! current_user_can( 'delete_post', $post_id ) ) 
     
    232232 
    233233    if ( ! $post_type_object ) 
    234         wp_die( __( 'Unknown post type.' ) ); 
     234        wp_die( __( 'Invalid post type.' ) ); 
    235235 
    236236    if ( ! current_user_can( 'delete_post', $post_id ) ) 
     
    250250 
    251251    if ( ! $post_type_object ) 
    252         wp_die( __( 'Unknown post type.' ) ); 
     252        wp_die( __( 'Invalid post type.' ) ); 
    253253 
    254254    if ( ! current_user_can( 'delete_post', $post_id ) ) 
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r39558 r39756  
    788788    public function insert_auto_draft_post( $postarr ) { 
    789789        if ( ! isset( $postarr['post_type'] ) || ! post_type_exists( $postarr['post_type'] )  ) { 
    790             return new WP_Error( 'unknown_post_type', __( 'Unknown post type' ) ); 
     790            return new WP_Error( 'unknown_post_type', __( 'Invalid post type.' ) ); 
    791791        } 
    792792        if ( empty( $postarr['post_title'] ) ) { 
Note: See TracChangeset for help on using the changeset viewer.