Ticket #31126: add-return-to-wp_register_script-and-wp_register_style.diff
File add-return-to-wp_register_script-and-wp_register_style.diff, 1.9 KB (added by , 9 years ago) |
---|
-
wp-includes/functions.wp-scripts.php
106 106 * If set to null, no version is added. Default 'false'. Accepts 'false', 'null', or 'string'. 107 107 * @param bool $in_footer Optional. Whether to enqueue the script before </head> or before </body>. 108 108 * Default 'false'. Accepts 'false' or 'true'. 109 * @return bool Whether the script has been registered. True on success, false on failure. 109 110 */ 110 111 function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { 111 112 $wp_scripts = wp_scripts(); 112 113 _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); 113 114 114 $ wp_scripts->add( $handle, $src, $deps, $ver );115 $return = $wp_scripts->add( $handle, $src, $deps, $ver ); 115 116 if ( $in_footer ) { 116 117 $wp_scripts->add_data( $handle, 'group', 1 ); 117 118 } 119 120 return $return; 118 121 } 119 122 120 123 /** -
wp-includes/functions.wp-styles.php
107 107 * @param string $media Optional. The media for which this stylesheet has been defined. 108 108 * Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print', 109 109 * 'screen', 'tty', or 'tv'. 110 * @return bool Whether the style has been registered. True on success, false on failure. 110 111 */ 111 112 function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) { 112 113 _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); 113 114 114 wp_styles()->add( $handle, $src, $deps, $ver, $media ); 115 $return = wp_styles()->add( $handle, $src, $deps, $ver, $media ); 116 117 return $return; 115 118 } 116 119 117 120 /**