Opened 11 years ago
Closed 10 years ago
#30035 closed defect (bug) (fixed)
Can't put buttons in the Publish meta box
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | Editor | Keywords: | |
Focuses: | javascript, administration | Cc: |
Description (last modified by )
<?php add_action( 'post_submitbox_misc_actions', function() { ?><button type='button'>hi</button><?php } );
Clicking that button and then preview will break your stuffs.
This is because this selector is too greedy. We should remove the :button selector here.
Attachments (2)
Change History (11)
#1
@
11 years ago
- Component changed from Administration to Editor
- Description modified (diff)
- Milestone changed from Awaiting Review to 4.1
#3
@
10 years ago
What does "break your stuffs" entail, and is there any possibility people are relying on this currently for whatever reason? Not against removing it, just like to know the details first.
#4
follow-up:
↓ 5
@
10 years ago
attachment:30035.mov shows what putting a button in the Publish meta box does.
Clicking our button adds the callback that's only intended for the submit button, so when Preview button is clicked, this callback runs unintentionally, and disables the submit buttons.
#5
in reply to:
↑ 4
@
10 years ago
Replying to ericlewis:
attachment:30035.mov shows what putting a button in the Publish meta box does.
Clicking our button adds the callback that's only intended only to be added when the submit button is clicked, so when Preview button is clicked, this callback runs unintentionally, and disables the submit buttons.
Makes sense; wondering why :button was used in the first place, agree seems overly aggressive!
#6
@
10 years ago
Still curious if anybody is weirdly relying on this, or if this was done this way for a specific reason - paging azaozz.
This ticket was mentioned in Slack in #core by helen. View the logs.
10 years ago
#8
@
10 years ago
azaozz and I spoke about it in IRC a while ago, he agreed it was too generous of a selector and we should remove it.
Introduced in [7103], refactored in [11874] and [26995].