[wp-trac] [WordPress Trac] #36801: Add post type to editor form class (was: Add POST-TYPE into css CLASSNAME)
WordPress Trac
noreply at wordpress.org
Tue May 10 08:29:11 UTC 2016
#36801: Add post type to editor form class
-------------------------+------------------------------
Reporter: selnomeria | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version:
Severity: normal | Resolution:
Keywords: close | Focuses:
-------------------------+------------------------------
Changes (by swissspidy):
* keywords: => close
* component: General => Editor
Old description:
> typical source code of PAGE EDITOR (in dashboard), is like this:
>
> {{{
> <form name="post" action="post.php" method="post" id="post">
> }}}
>
> REQUEST:
> when i add(or edit) a post type '''MyVideos''', it is good, if the FORM
> contained classname, 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'''"
New description:
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'''"
--
Comment:
> 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`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36801#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list