Making WordPress.org

Ticket #3912: 3912.3.patch

File 3912.3.patch, 4.0 KB (added by keesiemeijer, 6 years ago)

Link modal with search panel (with search filters applied)

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

     
    8787        public static function search_posts_orderby( $orderby, $query ) {
    8888                global $wpdb;
    8989
    90                 if ( $query->is_main_query() && is_search() && ! $query->get( 'exact' ) ) {
     90                $search_query = $query->get( 'wp_editor_link_search' ) || ( $query->is_main_query() && is_search() );
     91                if ( $search_query && ! $query->get( 'exact' ) ) {
    9192
    9293                        $search_order_by_title = $query->get( 'search_orderby_title' );
    9394
  • 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 post type and allow search filters to order the search results.
     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                // Allows search filters to order the results.
     234                $query['suppress_filters']        = false;
     235                $query['wp_editor_link_search']   = true;
     236
     237                return $query;
     238        }
     239
     240        /**
    220241         * Get the comment form arguments by context.
    221242         *
    222243         * @param WP_Comment|false $comment Comment object or false. Default false.
     
    318339                                'textarea_name' => 'comment',
    319340                                'textarea_rows' => 8,
    320341                                'quicktags'     => array(
    321                                         'buttons' => 'strong,em,ul,ol,li'
     342                                        'buttons' => 'strong,em,ul,ol,li,link'
    322343                                ),
    323344                                'teeny'         => true,
    324345                                'tinymce'       => false,
     
    397418                                'textarea_name' => 'comment',
    398419                                'textarea_rows' => 3,
    399420                                'quicktags'     => array(
    400                                         'buttons' => 'strong,em'
     421                                        'buttons' => 'strong,em,link'
    401422                                ),
    402423                                'editor_css'    => self::get_editor_style(),
    403424                                '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 {