Prevent notices when post_id is not passed to the old media upload forms. props ldebrouwer. fixes #22465.
git-svn-id: http://core.svn.wordpress.org/trunk@22628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7db73c3be2
commit
0a888e8aa0
|
@ -1377,7 +1377,8 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*/
|
*/
|
||||||
function media_upload_header() {
|
function media_upload_header() {
|
||||||
echo '<script type="text/javascript">post_id = ' . intval( $_REQUEST['post_id'] ) . ";</script>\n";
|
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
|
||||||
|
echo '<script type="text/javascript">post_id = ' . $post_id . ";</script>\n";
|
||||||
if ( empty( $_GET['chromeless'] ) ) {
|
if ( empty( $_GET['chromeless'] ) ) {
|
||||||
echo '<div id="media-upload-header">';
|
echo '<div id="media-upload-header">';
|
||||||
the_media_upload_tabs();
|
the_media_upload_tabs();
|
||||||
|
@ -1596,7 +1597,7 @@ function media_upload_type_url_form($type = null, $errors = null, $id = null) {
|
||||||
|
|
||||||
media_upload_header();
|
media_upload_header();
|
||||||
|
|
||||||
$post_id = intval($_REQUEST['post_id']);
|
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
|
||||||
|
|
||||||
$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
|
$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
|
||||||
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
|
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
|
||||||
|
@ -1871,7 +1872,7 @@ function media_upload_library_form($errors) {
|
||||||
|
|
||||||
media_upload_header();
|
media_upload_header();
|
||||||
|
|
||||||
$post_id = intval($_REQUEST['post_id']);
|
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
|
||||||
|
|
||||||
$form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
|
$form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
|
||||||
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
|
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
|
||||||
|
|
Loading…
Reference in New Issue