WordPress.org

Making WordPress.org

Changeset 6376


Ignore:
Timestamp:
01/12/2018 08:25:40 PM (2 years ago)
Author:
coreymckrill
Message:

WordCamp: Fix Add New post bug in Gutenberg tweaks

Ensures that the correct URL query segment character is used for Add New
post/page links.

Props sippis
Fixes #3359

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/gutenberg-tweaks.php

    r6072 r6376  
    8585        document.addEventListener( 'DOMContentLoaded', function() {
    8686            jQuery( '.split-page-title-action' ).children( 'a' ).each( function( index, element ) {
    87                 jQuery( element ).attr( 'href', jQuery( element ).attr( 'href' ) + '&classic-editor' );
     87                var href = jQuery( element ).attr( 'href' );
     88                if ( ! href.match(/\?/) ) {
     89                    jQuery( element ).attr( 'href', href + '?classic-editor' );
     90                } else {
     91                    jQuery( element ).attr( 'href', href + '&classic-editor' );
     92                }
    8893            } );
    8994        } );
Note: See TracChangeset for help on using the changeset viewer.