[wp-trac] [WordPress Trac] #45469: wp-polyfill-formdata not found for subdirectory install

WordPress Trac noreply at wordpress.org
Mon Dec 3 15:34:29 UTC 2018


#45469: wp-polyfill-formdata not found for subdirectory install
---------------------------+---------------------
 Reporter:  bobbingwide    |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  5.0
Component:  Script Loader  |     Version:  5.0
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+---------------------

Comment (by gziolo):

 > @gziolo You mean in wp_default_packages_scripts(). That should be
 covered by \WP_Scripts::do_item(), which automatically adds the base URL
 if it's a relative path.

 Do you see an easy to extract shared logic into its own function? At least
 the following is almost the same for both functions:

 {{{#!php
 <?php
 if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $content_url && 0 ===
 strpos( $src, $content_url ) ) ) {
         $src = $base_url . $src;
 }

 if ( ! empty( $ver ) )
         $src = add_query_arg( 'ver', $ver, $src );

 /** This filter is documented in wp-includes/class.wp-scripts.php */
 $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45469#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list