Making WordPress.org


Ignore:
Timestamp:
04/13/2020 11:29:39 PM (6 years ago)
Author:
coffee2code
Message:

Developer: Enable link button for user contributed notes input form.

Props keesiemeijer, DrewAPicture.
Fixes #3912.

File:
1 edited

Legend:

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

    r9433 r9716  
    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
     
    215218
    216219                return $submit_field . self::get_edit_fields( $comment_id, $instance = 0 );
     220        }
     221
     222        /**
     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;
    217232        }
    218233
     
    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,
     
    398413                                'textarea_rows' => 3,
    399414                                'quicktags'     => array(
    400                                         'buttons' => 'strong,em'
     415                                        'buttons' => 'strong,em,link'
    401416                                ),
    402417                                'editor_css'    => self::get_editor_style(),
Note: See TracChangeset for help on using the changeset viewer.