Making WordPress.org

Ticket #3912: 3912.2.patch

File 3912.2.patch, 3.0 KB (added by keesiemeijer, 6 years ago)

Link modal with search panel (without search filters)

  • 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                // Restrict post types to search in for the link search panel
     74                add_filter( 'wp_link_query_args',              array( __CLASS__, 'wp_link_query_args' ) );
    7275        }
    7376
    7477        /**
     
    217220        }
    218221
    219222        /**
     223         * Restrict the post types for the editor link search query.
     224         *
     225         * @param array $query An array of WP_Query arguments.
     226         */
     227        public static function wp_link_query_args( $query ) {
     228                $query['post_type'] = DevHub\get_parsed_post_types();
     229                if ( $GLOBALS['wp_query']->is_handbook  && function_exists( 'wporg_get_current_handbook' ) ) {
     230                        $query['post_type'] = wporg_get_current_handbook();
     231                }
     232
     233                return $query;
     234        }
     235
     236        /**
    220237         * Get the comment form arguments by context.
    221238         *
    222239         * @param WP_Comment|false $comment Comment object or false. Default false.
     
    318335                                'textarea_name' => 'comment',
    319336                                'textarea_rows' => 8,
    320337                                'quicktags'     => array(
    321                                         'buttons' => 'strong,em,ul,ol,li'
     338                                        'buttons' => 'strong,em,ul,ol,li,link'
    322339                                ),
    323340                                'teeny'         => true,
    324341                                'tinymce'       => false,
     
    397414                                'textarea_name' => 'comment',
    398415                                'textarea_rows' => 3,
    399416                                'quicktags'     => array(
    400                                         'buttons' => 'strong,em'
     417                                        'buttons' => 'strong,em,link'
    401418                                ),
    402419                                'editor_css'    => self::get_editor_style(),
    403420                                'teeny'         => true,
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss

     
    18071807        }
    18081808}
    18091809
     1810/** WP editor link modal window **/
    18101811
     1812#link-selector #link-options .link-target {     
     1813        display: none;
     1814}
     1815
    18111816/** Handbook **/
    18121817
    18131818aside[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 modal window **/
     2190#link-selector #link-options .link-target {
     2191  display: none;
     2192}
     2193
    21892194/** Handbook **/
    21902195aside[id^="handbook"] .widget-title,
    21912196aside[id^="nav_menu"] .widget-title {