Opened 9 years ago
Closed 9 years ago
#33257 closed defect (bug) (fixed)
Wp Editor front end missing add media button
Reported by: | alexandruias | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | major | Version: | 4.3 |
Component: | Editor | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
This is the code that I use to setup the wp editor in front-end.You can paste in a theme file.
<?php $content = 'none'; $settings = array( 'media_buttons' => true, 'drag_drop_upload' => true, ); $editor_id ='customusername'; echo '<div style="float:right;max-width:600px">'; wp_editor($content,$editor_id,$settings); echo '</div>';?>
In 4.2.3 the editor shows the add media button but the latest trunk doesn't.
In the trunk I can see with inspect element that is trying to generate the add media button but is only an empty div.
<div id="wp-customusername-media-buttons" class="wp-media-buttons"></div>
Everything is default no theme or plugin installed or activated.
Attachments (2)
Change History (13)
This ticket was mentioned in Slack in #core by alexandruias. View the logs.
9 years ago
#3
@
9 years ago
- Milestone changed from Awaiting Review to 4.3
- Owner set to azaozz
- Status changed from new to assigned
#4
@
9 years ago
- Keywords needs-patch added
Broken since [32653]. add_action( 'media_buttons', 'media_buttons' );
was moved to wp-admin/includes/admin-filters.php
.
This ticket was mentioned in Slack in #core-editor by ocean90. View the logs.
9 years ago
#6
@
9 years ago
Seems the straightforward way to fix this would be to add add_action( 'media_buttons', 'media_buttons' );
to class-wp-editor.php.
However likely there will be more cases of missing add_action
and add_filter
. Looking through the files from where the actions were moved, several more are sometimes included in non wp-admin context.
Reopening #32529 for further investigation.
This ticket was mentioned in Slack in #core by ocean90. View the logs.
9 years ago
#8
@
9 years ago
- Keywords has-patch added; needs-patch removed
33257.diff moves 3 filters to default-filters.php
from admin-filters.php
- the hooks get fired in the same file that contains the callbacks.
Confirmed, @azaozz, @iseulde, could you take a look?