Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#47199 closed defect (bug) (invalid)

Cant post or edit comments from admin page when removing css/js query string

Reported by: Stolle7 Owned by:
Priority: normal Milestone:
Component: Script Loader Version: 5.2
Severity: normal Keywords:
Cc: Focuses:

Description

After updating to version 5.2 I was unable to either post or edit comments from the admin page. I disabled all plugins without any help, and then started doing trial-and-error by deleting parts of my functions.php (customized) one by one.

I isolated the problem to the following, quite commonly used php snippet to remove css and js versions from the files. When having this enabled, it's not possible to either post or edit comments.

Code:

<?php
function remove_cssjs_ver( $src ) {
  if( strpos( $src, '?ver=' )){
    $src = remove_query_arg( 'ver', $src );
                 }
    return $src;
  }

add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

Information about my site:

  • WordPress version 5.2
  • Php 7.1
  • Theme: Child theme of "Accesspress Lite"

Change History (2)

#1 @Stolle7
7 years ago

  • Resolution → invalid
  • Status new → closed

I didn't check whether it was a theme issue and correctly it seems to be. I tried applying the same code to another site using another theme, and here the comment post worked. Afterwards I changed my theme to Twenty Nineteen, applied the same code and it still worked. I will direct my effort to the authors of my theme instead.

#2 @swissspidy
7 years ago

  • Component Comments → Script Loader
  • Milestone Awaiting Review
  • Severity major → normal
Note: See TracTickets for help on using tickets.