Make WordPress Core

Opened 16 years ago

Closed 15 years ago

#7984 closed feature request (invalid)

JS inline post is not coherent with PHP inline post

Reported by: malaiac's profile Malaiac Owned by: azaozz's profile azaozz
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: JavaScript Keywords: needs-patch dev-feedback
Focuses: 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)

#1 @westi
16 years ago

  • Keywords needs-patch added

#2 @Malaiac
16 years ago

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 ?

#3 @markjaquith
16 years ago

  • Milestone changed from 2.7 to 2.8

Punting.

#4 @azaozz
16 years ago

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.

#5 follow-up: @gcorne
16 years ago

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.

#6 @Denis-de-Bernardy
15 years ago

  • Milestone changed from 2.8 to Future Release

that would be sweet, but it would definitely need a patch

#7 @Denis-de-Bernardy
15 years ago

  • 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.

#8 in reply to: ↑ 5 @azaozz
15 years ago

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.

#9 @Denis-de-Bernardy
15 years ago

  • 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.

Note: See TracTickets for help on using tickets.