Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45638 closed defect (bug) (invalid)

Comparison of post_type of post.php

Reported by: tmatsuur's profile tmatsuur Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0.1
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

I can not publish with version 5.0.1 using the classic editor.
This malfunction does not occur in English environment, it seems to be a malfunction occurring in other language environment.

The cause of this problem is in post.php.

/wp-admin/post.php : l43

if ( isset( $_POST['post_type'] ) && $post && $post_type !== $_POST['post_type'] ) {

In the Japanese environment, $post_type is 'post', but $_ POST['post_type'] is '投稿'.

Change History (3)

#1 follow-up: @iandunn
6 years ago

Hi @tmatsuur , does that still happen if you temporarily disable plugins, and switch to one of the default themes?

It sounds like $_POST['post_type'] is being translated, which I don't think should ever happen. I don't see any instances in the Core code of doing that.

#2 in reply to: ↑ 1 @tmatsuur
6 years ago

Replying to iandunn:

Hi @tmatsuur , does that still happen if you temporarily disable plugins, and switch to one of the default themes?

It sounds like $_POST['post_type'] is being translated, which I don't think should ever happen. I don't see any instances in the Core code of doing that.

Thank you for your comment.

In this case, I noticed that my own plug-in was doing bad things.

The cause is as follows.

1.In the widget of the plugin, I set the translated post type to the value of the value attribute.

2.'post' translation was added for Block Editor.

3.Due to the combination of these conditions, this problem occurred.

I will update the problem plugin later.

Please close this issue.

#3 @iandunn
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Sounds good, thanks for following up :)

Note: See TracTickets for help on using tickets.