Making WordPress.org

Changeset 5661


Ignore:
Timestamp:
07/12/2017 04:35:31 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Replace Quicktags' blockquote button to remove extra line breaks before and after the tag.

Fixes #2950.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r5657 r5661  
    1212        add_filter( 'pre_option__bbp_edit_lock',      array( $this, 'increase_edit_lock_time' ) );
    1313        add_filter( 'redirect_canonical',             array( $this, 'disable_redirect_guess_404_permalink' ) );
     14        add_action( 'wp_print_footer_scripts',        array( $this, 'replace_quicktags_blockquote_button' ) );
    1415
    1516        // Gravatar suppression on lists of topics and revision logs.
     
    118119
    119120        return $redirect_url;
     121    }
     122
     123    /**
     124     * Replace Quicktags' blockquote button to remove extra line breaks
     125     * before and after the tag.
     126     */
     127    public function replace_quicktags_blockquote_button() { ?>
     128        <script type="text/javascript">
     129            if ( 'undefined' !== typeof edButtons && 'undefined' !== QTags ) {
     130                // Replace Quicktags' blockquote button.
     131                edButtons[40]  = new QTags.TagButton(
     132                    'block',         // Button HTML ID.
     133                    'b-quote',       // Button's value="...".
     134                    '<blockquote>',  // Starting tag.
     135                    '</blockquote>', // Ending tag.
     136                    '',              // Deprecated, not used.
     137                    '',              // Button's title="...".
     138                    '',              // Quicktags instance.
     139                    {                // Additional attributes.
     140                        ariaLabel: quicktagsL10n.blockquote,
     141                        ariaLabelClose: quicktagsL10n.blockquoteClose
     142                    }
     143                );
     144            }
     145        </script>
     146        <?php
    120147    }
    121148
Note: See TracChangeset for help on using the changeset viewer.