Opened 5 years ago
Closed 4 years ago
#7984 closed feature request (invalid)
JS inline post is not coherent with PHP inline post
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | JavaScript | Version: | 2.7 |
| Severity: | normal | Keywords: | needs-patch dev-feedback |
| Cc: |
Description
In Javascript : ( /wp-admin/js/inline-edit-post.js?ver=20081023 )
var fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'post_password'];
if ( t.type == 'page' ) fields.push('post_parent', 'menu_order', 'page_template');
if ( t.type == 'post' ) fields.push('tags_input');
in PHP : ( wp-admin/includes/template.php, function inline_edit_row() starting line 877)
switch($column_name) {
/* ... */
default:
if ( $bulk )
do_action('bulk_edit_custom_box', $column_name, $type);
else
do_action('quick_edit_custom_box', $column_name, $type);
break;
Any mod/plugin using an extra field may manage it by PHP (with (quick_edit_custombox,'my extra field').
But it cannot access javascript and add the extra field name to fields[]
Using revision 9368
Change History (9)
JS (unlike php) can easily be overloaded/functions redeclared. The way to do that here would be to copy inlineEditPost.edit(), change it to handle the new/custom values and replace the original one by registering the script with dependency on inline-edit-post.js so it's always loaded after.
Perhaps, plugin functionality could be added to WP js code that mimics the behavior of add_action and add_filter from the PHP side of things.
- Milestone changed from 2.8 to Future Release
that would be sweet, but it would definitely need a patch
- Component changed from Administration to JavaScript
- Keywords dev-feedback added; inline-edit removed
- Owner changed from anonymous to azaozz
- Type changed from defect (bug) to feature request
and Andrew's opinion.
Replying to gcorne:
Perhaps, plugin functionality could be added to WP js code that mimics the behavior of add_action and add_filter from the PHP side of things.
It it possible but a lot easier would be for plugins to add their own functions or redefine the existing. For most places both js and css have to be added.
- Milestone Future Release deleted
- Resolution set to invalid
- Status changed from new to closed
@gcorne: these would be the admin_footer-$page hooks, unless I'm mistaking.
closing this as invalid.

Same problem, even without custom fields.
what if a plugin dev / WP webmaster wants to propose a categories dropdown instead of a checklist (to force one category per post).
PHP side, replace wp_category_checklist() by wp_dropdown_categories() ( regular WP way)
Javascript side... wth ? duplicate inline-edit-post.js with 2 lines changed ?