wp/wp-includes/functions.wp-styles.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
--- a/wp/wp-includes/functions.wp-styles.php	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-includes/functions.wp-styles.php	Mon Oct 14 18:28:13 2019 +0200
@@ -67,7 +67,7 @@
 /**
  * Add extra CSS styles to a registered stylesheet.
  *
- * Styles will only be added if the stylesheet in already in the queue.
+ * Styles will only be added if the stylesheet is already in the queue.
  * Accepts a string $data containing the CSS. If two or more CSS code blocks
  * are added to the same stylesheet $handle, they will be printed in the order
  * they were added, i.e. the latter added styles can redeclare the previous.
@@ -84,12 +84,16 @@
 	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
 
 	if ( false !== stripos( $data, '</style>' ) ) {
-		_doing_it_wrong( __FUNCTION__, sprintf(
-			/* translators: 1: <style>, 2: wp_add_inline_style() */
-			__( 'Do not pass %1$s tags to %2$s.' ),
-			'<code>&lt;style&gt;</code>',
-			'<code>wp_add_inline_style()</code>'
-		), '3.7.0' );
+		_doing_it_wrong(
+			__FUNCTION__,
+			sprintf(
+				/* translators: 1: <style>, 2: wp_add_inline_style() */
+				__( 'Do not pass %1$s tags to %2$s.' ),
+				'<code>&lt;style&gt;</code>',
+				'<code>wp_add_inline_style()</code>'
+			),
+			'3.7.0'
+		);
 		$data = trim( preg_replace( '#<style[^>]*>(.*)</style>#is', '$1', $data ) );
 	}
 
@@ -106,7 +110,8 @@
  * @since 4.3.0 A return value was added.
  *
  * @param string           $handle Name of the stylesheet. Should be unique.
- * @param string           $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
+ * @param string|bool      $src    Full URL of the stylesheet, or path of the stylesheet relative to the WordPress root directory.
+ *                                 If source is set to false, stylesheet is an alias of other stylesheets it depends on.
  * @param array            $deps   Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array.
  * @param string|bool|null $ver    Optional. String specifying stylesheet version number, if it has one, which is added to the URL
  *                                 as a query string for cache busting purposes. If version is set to false, a version
@@ -167,7 +172,7 @@
 	$wp_styles = wp_styles();
 
 	if ( $src ) {
-		$_handle = explode('?', $handle);
+		$_handle = explode( '?', $handle );
 		$wp_styles->add( $_handle[0], $src, $deps, $ver, $media );
 	}
 	$wp_styles->enqueue( $handle );