Make WordPress Core

Ticket #24013: #24013.patch

File #24013.patch, 1.1 KB (added by nadeemskv, 12 years ago)
  • edit-form-advanced.php

     
    529529if ( post_type_supports( $post_type, 'comments' ) )
    530530        wp_comment_reply();
    531531?>
    532 
     532<?php
     533wp_enqueue_script(
     534        'add-media-hider',
     535        get_admin_url() . '/js/add-media-hider.js',
     536        array( 'jquery' )
     537);
     538?>
    533539<?php if ( (isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message']) ) : ?>
    534540<script type="text/javascript">
    535541try{document.post.title.focus();}catch(e){}
  • js/add-media-hider.js

     
     1(function ($) {
     2    $('.post-format-options a').click( function() {
     3                if ( $(this).attr('data-wp-format') == 'aside' || $(this).attr('data-wp-format') == 'status' ) {
     4                        $('#insert-media-button').addClass('hidden') ;
     5                } else {
     6                        $('#insert-media-button').removeClass('hidden') ;
     7                }
     8        });             
     9}(jQuery));