WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#36801 closed enhancement (worksforme)

Add post type to editor form class

Reported by: selnomeria Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords: close
Focuses: Cc:

Description (last modified by swissspidy)

typical source code of the editor in the admin is like this:

<form name="post" action="post.php" method="post" id="post">

Suggestion:

When i add (or edit) a post type MyVideos, it is good, if the <form> contained the class name, like:

<form class="posttype-MyVideos" name="post" action="post.php" method="post" id="post">

default for typical posts or pages should be i.e. class="posttype-post" and class="posttype-page"

Change History (3)

#1 follow-up: @swissspidy
5 years ago

  • Component changed from General to Editor
  • Description modified (diff)
  • Keywords close added
  • Summary changed from Add POST-TYPE into css CLASSNAME to Add post type to editor form class

When i add (or edit) a post type MyVideos, it is good, if the <form> contained the class name

Why? The post type is already part of the <body>. For example, for the post post type it looks like this:

<body class="wp-admin wp-core-ui post-new-php post-type-post …">

IMHO the editor should not need to know about the post type (and probably can't the way things are set up now).

If you need to target the editor for a specific post type, you can use .post-type-<type> form

#2 in reply to: ↑ 1 @selnomeria
5 years ago

Replying to swissspidy:

Wow, THANKS!!!!

#3 @azaozz
5 years ago

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

Assuming this means the ticket is resolved :)

Note: See TracTickets for help on using tickets.