Making WordPress.org

Ticket #3912: 3912.patch

File 3912.patch, 3.1 KB (added by keesiemeijer, 6 years ago)

Add link button

  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php

     
    6969
    7070                // Adds hidden fields to a comment form for editing
    7171                add_filter( 'comment_form_submit_field',       array( __CLASS__, 'add_hidden_fields' ), 10, 2 );
     72
     73                // Disable the search query in the insert link modal window
     74                add_filter( 'wp_link_query_args',              array( __CLASS__, 'disable_link_query' ) );
    7275        }
    7376
    7477        /**
     
    217220        }
    218221
    219222        /**
     223         * Disable the search query in the insert link modal window.
     224         *
     225         * The search query field in the link modal is hidden with CSS.
     226         *
     227         * @param array $query An array of WP_Query arguments.
     228         */
     229        public static function disable_link_query( $query ) {
     230                $query['post__in'] = array(0);
     231                return $query;
     232        }
     233
     234        /**
    220235         * Get the comment form arguments by context.
    221236         *
    222237         * @param WP_Comment|false $comment Comment object or false. Default false.
     
    318333                                'textarea_name' => 'comment',
    319334                                'textarea_rows' => 8,
    320335                                'quicktags'     => array(
    321                                         'buttons' => 'strong,em,ul,ol,li'
     336                                        'buttons' => 'strong,em,ul,ol,li,link'
    322337                                ),
    323338                                'teeny'         => true,
    324339                                'tinymce'       => false,
     
    397412                                'textarea_name' => 'comment',
    398413                                'textarea_rows' => 3,
    399414                                'quicktags'     => array(
    400                                         'buttons' => 'strong,em'
     415                                        'buttons' => 'strong,em,link'
    401416                                ),
    402417                                'editor_css'    => self::get_editor_style(),
    403418                                'teeny'         => true,
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss

     
    18071807        }
    18081808}
    18091809
     1810/** WP editor link button modal **/
    18101811
     1812#link-selector {
     1813        #search-panel,
     1814        #wplink-link-existing-content,
     1815        #link-options .link-target {
     1816                display: none;
     1817        }
     1818}
     1819
    18111820/** Handbook **/
    18121821
    18131822aside[id^="handbook"] .widget-title,
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css

     
    21862186  }
    21872187}
    21882188
     2189/** WP editor link button modal **/
     2190#link-selector #search-panel,
     2191#link-selector #wplink-link-existing-content,
     2192#link-selector #link-options .link-target {
     2193  display: none;
     2194}
     2195
    21892196/** Handbook **/
    21902197aside[id^="handbook"] .widget-title,
    21912198aside[id^="nav_menu"] .widget-title {