Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: script-loader.php
'monthNamesShort' => array_values( $wp_locale->month_abbrev ),
[2000] Fix | Delete
'nextText' => __( 'Next' ),
[2001] Fix | Delete
'prevText' => __( 'Previous' ),
[2002] Fix | Delete
'dayNames' => array_values( $wp_locale->weekday ),
[2003] Fix | Delete
'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ),
[2004] Fix | Delete
'dayNamesMin' => array_values( $wp_locale->weekday_initial ),
[2005] Fix | Delete
'dateFormat' => $datepicker_date_format,
[2006] Fix | Delete
'firstDay' => absint( get_option( 'start_of_week' ) ),
[2007] Fix | Delete
'isRTL' => $wp_locale->is_rtl(),
[2008] Fix | Delete
)
[2009] Fix | Delete
);
[2010] Fix | Delete
[2011] Fix | Delete
wp_add_inline_script( 'jquery-ui-datepicker', "jQuery(function(jQuery){jQuery.datepicker.setDefaults({$datepicker_defaults});});" );
[2012] Fix | Delete
}
[2013] Fix | Delete
[2014] Fix | Delete
/**
[2015] Fix | Delete
* Localizes community events data that needs to be passed to dashboard.js.
[2016] Fix | Delete
*
[2017] Fix | Delete
* @since 4.8.0
[2018] Fix | Delete
*/
[2019] Fix | Delete
function wp_localize_community_events() {
[2020] Fix | Delete
if ( ! wp_script_is( 'dashboard' ) ) {
[2021] Fix | Delete
return;
[2022] Fix | Delete
}
[2023] Fix | Delete
[2024] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php';
[2025] Fix | Delete
[2026] Fix | Delete
$user_id = get_current_user_id();
[2027] Fix | Delete
$saved_location = get_user_option( 'community-events-location', $user_id );
[2028] Fix | Delete
$saved_ip_address = isset( $saved_location['ip'] ) ? $saved_location['ip'] : false;
[2029] Fix | Delete
$current_ip_address = WP_Community_Events::get_unsafe_client_ip();
[2030] Fix | Delete
[2031] Fix | Delete
/*
[2032] Fix | Delete
* If the user's location is based on their IP address, then update their
[2033] Fix | Delete
* location when their IP address changes. This allows them to see events
[2034] Fix | Delete
* in their current city when travelling. Otherwise, they would always be
[2035] Fix | Delete
* shown events in the city where they were when they first loaded the
[2036] Fix | Delete
* Dashboard, which could have been months or years ago.
[2037] Fix | Delete
*/
[2038] Fix | Delete
if ( $saved_ip_address && $current_ip_address && $current_ip_address !== $saved_ip_address ) {
[2039] Fix | Delete
$saved_location['ip'] = $current_ip_address;
[2040] Fix | Delete
update_user_meta( $user_id, 'community-events-location', $saved_location );
[2041] Fix | Delete
}
[2042] Fix | Delete
[2043] Fix | Delete
$events_client = new WP_Community_Events( $user_id, $saved_location );
[2044] Fix | Delete
[2045] Fix | Delete
wp_localize_script(
[2046] Fix | Delete
'dashboard',
[2047] Fix | Delete
'communityEventsData',
[2048] Fix | Delete
array(
[2049] Fix | Delete
'nonce' => wp_create_nonce( 'community_events' ),
[2050] Fix | Delete
'cache' => $events_client->get_cached_events(),
[2051] Fix | Delete
'time_format' => get_option( 'time_format' ),
[2052] Fix | Delete
)
[2053] Fix | Delete
);
[2054] Fix | Delete
}
[2055] Fix | Delete
[2056] Fix | Delete
/**
[2057] Fix | Delete
* Administration Screen CSS for changing the styles.
[2058] Fix | Delete
*
[2059] Fix | Delete
* If installing the 'wp-admin/' directory will be replaced with './'.
[2060] Fix | Delete
*
[2061] Fix | Delete
* The $_wp_admin_css_colors global manages the Administration Screens CSS
[2062] Fix | Delete
* stylesheet that is loaded. The option that is set is 'admin_color' and is the
[2063] Fix | Delete
* color and key for the array. The value for the color key is an object with
[2064] Fix | Delete
* a 'url' parameter that has the URL path to the CSS file.
[2065] Fix | Delete
*
[2066] Fix | Delete
* The query from $src parameter will be appended to the URL that is given from
[2067] Fix | Delete
* the $_wp_admin_css_colors array value URL.
[2068] Fix | Delete
*
[2069] Fix | Delete
* @since 2.6.0
[2070] Fix | Delete
*
[2071] Fix | Delete
* @global array $_wp_admin_css_colors
[2072] Fix | Delete
*
[2073] Fix | Delete
* @param string $src Source URL.
[2074] Fix | Delete
* @param string $handle Either 'colors' or 'colors-rtl'.
[2075] Fix | Delete
* @return string|false URL path to CSS stylesheet for Administration Screens.
[2076] Fix | Delete
*/
[2077] Fix | Delete
function wp_style_loader_src( $src, $handle ) {
[2078] Fix | Delete
global $_wp_admin_css_colors;
[2079] Fix | Delete
[2080] Fix | Delete
if ( wp_installing() ) {
[2081] Fix | Delete
return preg_replace( '#^wp-admin/#', './', $src );
[2082] Fix | Delete
}
[2083] Fix | Delete
[2084] Fix | Delete
if ( 'colors' === $handle ) {
[2085] Fix | Delete
$color = get_user_option( 'admin_color' );
[2086] Fix | Delete
[2087] Fix | Delete
if ( empty( $color ) || ! isset( $_wp_admin_css_colors[ $color ] ) ) {
[2088] Fix | Delete
$color = 'fresh';
[2089] Fix | Delete
}
[2090] Fix | Delete
[2091] Fix | Delete
$color = $_wp_admin_css_colors[ $color ];
[2092] Fix | Delete
$url = $color->url;
[2093] Fix | Delete
[2094] Fix | Delete
if ( ! $url ) {
[2095] Fix | Delete
return false;
[2096] Fix | Delete
}
[2097] Fix | Delete
[2098] Fix | Delete
$parsed = parse_url( $src );
[2099] Fix | Delete
if ( isset( $parsed['query'] ) && $parsed['query'] ) {
[2100] Fix | Delete
wp_parse_str( $parsed['query'], $qv );
[2101] Fix | Delete
$url = add_query_arg( $qv, $url );
[2102] Fix | Delete
}
[2103] Fix | Delete
[2104] Fix | Delete
return $url;
[2105] Fix | Delete
}
[2106] Fix | Delete
[2107] Fix | Delete
return $src;
[2108] Fix | Delete
}
[2109] Fix | Delete
[2110] Fix | Delete
/**
[2111] Fix | Delete
* Prints the script queue in the HTML head on admin pages.
[2112] Fix | Delete
*
[2113] Fix | Delete
* Postpones the scripts that were queued for the footer.
[2114] Fix | Delete
* print_footer_scripts() is called in the footer to print these scripts.
[2115] Fix | Delete
*
[2116] Fix | Delete
* @since 2.8.0
[2117] Fix | Delete
*
[2118] Fix | Delete
* @see wp_print_scripts()
[2119] Fix | Delete
*
[2120] Fix | Delete
* @global bool $concatenate_scripts
[2121] Fix | Delete
*
[2122] Fix | Delete
* @return string[] Handles of the scripts that were printed.
[2123] Fix | Delete
*/
[2124] Fix | Delete
function print_head_scripts() {
[2125] Fix | Delete
global $concatenate_scripts;
[2126] Fix | Delete
[2127] Fix | Delete
if ( ! did_action( 'wp_print_scripts' ) ) {
[2128] Fix | Delete
/** This action is documented in wp-includes/functions.wp-scripts.php */
[2129] Fix | Delete
do_action( 'wp_print_scripts' );
[2130] Fix | Delete
}
[2131] Fix | Delete
[2132] Fix | Delete
$wp_scripts = wp_scripts();
[2133] Fix | Delete
[2134] Fix | Delete
script_concat_settings();
[2135] Fix | Delete
$wp_scripts->do_concat = $concatenate_scripts;
[2136] Fix | Delete
$wp_scripts->do_head_items();
[2137] Fix | Delete
[2138] Fix | Delete
/**
[2139] Fix | Delete
* Filters whether to print the head scripts.
[2140] Fix | Delete
*
[2141] Fix | Delete
* @since 2.8.0
[2142] Fix | Delete
*
[2143] Fix | Delete
* @param bool $print Whether to print the head scripts. Default true.
[2144] Fix | Delete
*/
[2145] Fix | Delete
if ( apply_filters( 'print_head_scripts', true ) ) {
[2146] Fix | Delete
_print_scripts();
[2147] Fix | Delete
}
[2148] Fix | Delete
[2149] Fix | Delete
$wp_scripts->reset();
[2150] Fix | Delete
return $wp_scripts->done;
[2151] Fix | Delete
}
[2152] Fix | Delete
[2153] Fix | Delete
/**
[2154] Fix | Delete
* Prints the scripts that were queued for the footer or too late for the HTML head.
[2155] Fix | Delete
*
[2156] Fix | Delete
* @since 2.8.0
[2157] Fix | Delete
*
[2158] Fix | Delete
* @global WP_Scripts $wp_scripts
[2159] Fix | Delete
* @global bool $concatenate_scripts
[2160] Fix | Delete
*
[2161] Fix | Delete
* @return string[] Handles of the scripts that were printed.
[2162] Fix | Delete
*/
[2163] Fix | Delete
function print_footer_scripts() {
[2164] Fix | Delete
global $wp_scripts, $concatenate_scripts;
[2165] Fix | Delete
[2166] Fix | Delete
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
[2167] Fix | Delete
return array(); // No need to run if not instantiated.
[2168] Fix | Delete
}
[2169] Fix | Delete
script_concat_settings();
[2170] Fix | Delete
$wp_scripts->do_concat = $concatenate_scripts;
[2171] Fix | Delete
$wp_scripts->do_footer_items();
[2172] Fix | Delete
[2173] Fix | Delete
/**
[2174] Fix | Delete
* Filters whether to print the footer scripts.
[2175] Fix | Delete
*
[2176] Fix | Delete
* @since 2.8.0
[2177] Fix | Delete
*
[2178] Fix | Delete
* @param bool $print Whether to print the footer scripts. Default true.
[2179] Fix | Delete
*/
[2180] Fix | Delete
if ( apply_filters( 'print_footer_scripts', true ) ) {
[2181] Fix | Delete
_print_scripts();
[2182] Fix | Delete
}
[2183] Fix | Delete
[2184] Fix | Delete
$wp_scripts->reset();
[2185] Fix | Delete
return $wp_scripts->done;
[2186] Fix | Delete
}
[2187] Fix | Delete
[2188] Fix | Delete
/**
[2189] Fix | Delete
* Prints scripts (internal use only)
[2190] Fix | Delete
*
[2191] Fix | Delete
* @ignore
[2192] Fix | Delete
*
[2193] Fix | Delete
* @global WP_Scripts $wp_scripts
[2194] Fix | Delete
* @global bool $compress_scripts
[2195] Fix | Delete
*/
[2196] Fix | Delete
function _print_scripts() {
[2197] Fix | Delete
global $wp_scripts, $compress_scripts;
[2198] Fix | Delete
[2199] Fix | Delete
$zip = $compress_scripts ? 1 : 0;
[2200] Fix | Delete
if ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {
[2201] Fix | Delete
$zip = 'gzip';
[2202] Fix | Delete
}
[2203] Fix | Delete
[2204] Fix | Delete
$concat = trim( $wp_scripts->concat, ', ' );
[2205] Fix | Delete
$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : " type='text/javascript'";
[2206] Fix | Delete
[2207] Fix | Delete
if ( $concat ) {
[2208] Fix | Delete
if ( ! empty( $wp_scripts->print_code ) ) {
[2209] Fix | Delete
echo "\n<script{$type_attr}>\n";
[2210] Fix | Delete
echo "/* <![CDATA[ */\n"; // Not needed in HTML 5.
[2211] Fix | Delete
echo $wp_scripts->print_code;
[2212] Fix | Delete
echo "/* ]]> */\n";
[2213] Fix | Delete
echo "</script>\n";
[2214] Fix | Delete
}
[2215] Fix | Delete
[2216] Fix | Delete
$concat = str_split( $concat, 128 );
[2217] Fix | Delete
$concatenated = '';
[2218] Fix | Delete
[2219] Fix | Delete
foreach ( $concat as $key => $chunk ) {
[2220] Fix | Delete
$concatenated .= "&load%5Bchunk_{$key}%5D={$chunk}";
[2221] Fix | Delete
}
[2222] Fix | Delete
[2223] Fix | Delete
$src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}" . $concatenated . '&ver=' . $wp_scripts->default_version;
[2224] Fix | Delete
echo "<script{$type_attr} src='" . esc_attr( $src ) . "'></script>\n";
[2225] Fix | Delete
}
[2226] Fix | Delete
[2227] Fix | Delete
if ( ! empty( $wp_scripts->print_html ) ) {
[2228] Fix | Delete
echo $wp_scripts->print_html;
[2229] Fix | Delete
}
[2230] Fix | Delete
}
[2231] Fix | Delete
[2232] Fix | Delete
/**
[2233] Fix | Delete
* Prints the script queue in the HTML head on the front end.
[2234] Fix | Delete
*
[2235] Fix | Delete
* Postpones the scripts that were queued for the footer.
[2236] Fix | Delete
* wp_print_footer_scripts() is called in the footer to print these scripts.
[2237] Fix | Delete
*
[2238] Fix | Delete
* @since 2.8.0
[2239] Fix | Delete
*
[2240] Fix | Delete
* @global WP_Scripts $wp_scripts
[2241] Fix | Delete
*
[2242] Fix | Delete
* @return string[] Handles of the scripts that were printed.
[2243] Fix | Delete
*/
[2244] Fix | Delete
function wp_print_head_scripts() {
[2245] Fix | Delete
global $wp_scripts;
[2246] Fix | Delete
[2247] Fix | Delete
if ( ! did_action( 'wp_print_scripts' ) ) {
[2248] Fix | Delete
/** This action is documented in wp-includes/functions.wp-scripts.php */
[2249] Fix | Delete
do_action( 'wp_print_scripts' );
[2250] Fix | Delete
}
[2251] Fix | Delete
[2252] Fix | Delete
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
[2253] Fix | Delete
return array(); // No need to run if nothing is queued.
[2254] Fix | Delete
}
[2255] Fix | Delete
[2256] Fix | Delete
return print_head_scripts();
[2257] Fix | Delete
}
[2258] Fix | Delete
[2259] Fix | Delete
/**
[2260] Fix | Delete
* Private, for use in *_footer_scripts hooks
[2261] Fix | Delete
*
[2262] Fix | Delete
* @since 3.3.0
[2263] Fix | Delete
*/
[2264] Fix | Delete
function _wp_footer_scripts() {
[2265] Fix | Delete
print_late_styles();
[2266] Fix | Delete
print_footer_scripts();
[2267] Fix | Delete
}
[2268] Fix | Delete
[2269] Fix | Delete
/**
[2270] Fix | Delete
* Hooks to print the scripts and styles in the footer.
[2271] Fix | Delete
*
[2272] Fix | Delete
* @since 2.8.0
[2273] Fix | Delete
*/
[2274] Fix | Delete
function wp_print_footer_scripts() {
[2275] Fix | Delete
/**
[2276] Fix | Delete
* Fires when footer scripts are printed.
[2277] Fix | Delete
*
[2278] Fix | Delete
* @since 2.8.0
[2279] Fix | Delete
*/
[2280] Fix | Delete
do_action( 'wp_print_footer_scripts' );
[2281] Fix | Delete
}
[2282] Fix | Delete
[2283] Fix | Delete
/**
[2284] Fix | Delete
* Wrapper for do_action( 'wp_enqueue_scripts' ).
[2285] Fix | Delete
*
[2286] Fix | Delete
* Allows plugins to queue scripts for the front end using wp_enqueue_script().
[2287] Fix | Delete
* Runs first in wp_head() where all is_home(), is_page(), etc. functions are available.
[2288] Fix | Delete
*
[2289] Fix | Delete
* @since 2.8.0
[2290] Fix | Delete
*/
[2291] Fix | Delete
function wp_enqueue_scripts() {
[2292] Fix | Delete
/**
[2293] Fix | Delete
* Fires when scripts and styles are enqueued.
[2294] Fix | Delete
*
[2295] Fix | Delete
* @since 2.8.0
[2296] Fix | Delete
*/
[2297] Fix | Delete
do_action( 'wp_enqueue_scripts' );
[2298] Fix | Delete
}
[2299] Fix | Delete
[2300] Fix | Delete
/**
[2301] Fix | Delete
* Prints the styles queue in the HTML head on admin pages.
[2302] Fix | Delete
*
[2303] Fix | Delete
* @since 2.8.0
[2304] Fix | Delete
*
[2305] Fix | Delete
* @global bool $concatenate_scripts
[2306] Fix | Delete
*
[2307] Fix | Delete
* @return string[] Handles of the styles that were printed.
[2308] Fix | Delete
*/
[2309] Fix | Delete
function print_admin_styles() {
[2310] Fix | Delete
global $concatenate_scripts;
[2311] Fix | Delete
[2312] Fix | Delete
$wp_styles = wp_styles();
[2313] Fix | Delete
[2314] Fix | Delete
script_concat_settings();
[2315] Fix | Delete
$wp_styles->do_concat = $concatenate_scripts;
[2316] Fix | Delete
$wp_styles->do_items( false );
[2317] Fix | Delete
[2318] Fix | Delete
/**
[2319] Fix | Delete
* Filters whether to print the admin styles.
[2320] Fix | Delete
*
[2321] Fix | Delete
* @since 2.8.0
[2322] Fix | Delete
*
[2323] Fix | Delete
* @param bool $print Whether to print the admin styles. Default true.
[2324] Fix | Delete
*/
[2325] Fix | Delete
if ( apply_filters( 'print_admin_styles', true ) ) {
[2326] Fix | Delete
_print_styles();
[2327] Fix | Delete
}
[2328] Fix | Delete
[2329] Fix | Delete
$wp_styles->reset();
[2330] Fix | Delete
return $wp_styles->done;
[2331] Fix | Delete
}
[2332] Fix | Delete
[2333] Fix | Delete
/**
[2334] Fix | Delete
* Prints the styles that were queued too late for the HTML head.
[2335] Fix | Delete
*
[2336] Fix | Delete
* @since 3.3.0
[2337] Fix | Delete
*
[2338] Fix | Delete
* @global WP_Styles $wp_styles
[2339] Fix | Delete
* @global bool $concatenate_scripts
[2340] Fix | Delete
*
[2341] Fix | Delete
* @return array|void
[2342] Fix | Delete
*/
[2343] Fix | Delete
function print_late_styles() {
[2344] Fix | Delete
global $wp_styles, $concatenate_scripts;
[2345] Fix | Delete
[2346] Fix | Delete
if ( ! ( $wp_styles instanceof WP_Styles ) ) {
[2347] Fix | Delete
return;
[2348] Fix | Delete
}
[2349] Fix | Delete
[2350] Fix | Delete
script_concat_settings();
[2351] Fix | Delete
$wp_styles->do_concat = $concatenate_scripts;
[2352] Fix | Delete
$wp_styles->do_footer_items();
[2353] Fix | Delete
[2354] Fix | Delete
/**
[2355] Fix | Delete
* Filters whether to print the styles queued too late for the HTML head.
[2356] Fix | Delete
*
[2357] Fix | Delete
* @since 3.3.0
[2358] Fix | Delete
*
[2359] Fix | Delete
* @param bool $print Whether to print the 'late' styles. Default true.
[2360] Fix | Delete
*/
[2361] Fix | Delete
if ( apply_filters( 'print_late_styles', true ) ) {
[2362] Fix | Delete
_print_styles();
[2363] Fix | Delete
}
[2364] Fix | Delete
[2365] Fix | Delete
$wp_styles->reset();
[2366] Fix | Delete
return $wp_styles->done;
[2367] Fix | Delete
}
[2368] Fix | Delete
[2369] Fix | Delete
/**
[2370] Fix | Delete
* Prints styles (internal use only).
[2371] Fix | Delete
*
[2372] Fix | Delete
* @ignore
[2373] Fix | Delete
* @since 3.3.0
[2374] Fix | Delete
*
[2375] Fix | Delete
* @global bool $compress_css
[2376] Fix | Delete
*/
[2377] Fix | Delete
function _print_styles() {
[2378] Fix | Delete
global $compress_css;
[2379] Fix | Delete
[2380] Fix | Delete
$wp_styles = wp_styles();
[2381] Fix | Delete
[2382] Fix | Delete
$zip = $compress_css ? 1 : 0;
[2383] Fix | Delete
if ( $zip && defined( 'ENFORCE_GZIP' ) && ENFORCE_GZIP ) {
[2384] Fix | Delete
$zip = 'gzip';
[2385] Fix | Delete
}
[2386] Fix | Delete
[2387] Fix | Delete
$concat = trim( $wp_styles->concat, ', ' );
[2388] Fix | Delete
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
[2389] Fix | Delete
[2390] Fix | Delete
if ( $concat ) {
[2391] Fix | Delete
$dir = $wp_styles->text_direction;
[2392] Fix | Delete
$ver = $wp_styles->default_version;
[2393] Fix | Delete
[2394] Fix | Delete
$concat = str_split( $concat, 128 );
[2395] Fix | Delete
$concatenated = '';
[2396] Fix | Delete
[2397] Fix | Delete
foreach ( $concat as $key => $chunk ) {
[2398] Fix | Delete
$concatenated .= "&load%5Bchunk_{$key}%5D={$chunk}";
[2399] Fix | Delete
}
[2400] Fix | Delete
[2401] Fix | Delete
$href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}" . $concatenated . '&ver=' . $ver;
[2402] Fix | Delete
echo "<link rel='stylesheet' href='" . esc_attr( $href ) . "'{$type_attr} media='all' />\n";
[2403] Fix | Delete
[2404] Fix | Delete
if ( ! empty( $wp_styles->print_code ) ) {
[2405] Fix | Delete
echo "<style{$type_attr}>\n";
[2406] Fix | Delete
echo $wp_styles->print_code;
[2407] Fix | Delete
echo "\n</style>\n";
[2408] Fix | Delete
}
[2409] Fix | Delete
}
[2410] Fix | Delete
[2411] Fix | Delete
if ( ! empty( $wp_styles->print_html ) ) {
[2412] Fix | Delete
echo $wp_styles->print_html;
[2413] Fix | Delete
}
[2414] Fix | Delete
}
[2415] Fix | Delete
[2416] Fix | Delete
/**
[2417] Fix | Delete
* Determines the concatenation and compression settings for scripts and styles.
[2418] Fix | Delete
*
[2419] Fix | Delete
* @since 2.8.0
[2420] Fix | Delete
*
[2421] Fix | Delete
* @global bool $concatenate_scripts
[2422] Fix | Delete
* @global bool $compress_scripts
[2423] Fix | Delete
* @global bool $compress_css
[2424] Fix | Delete
*/
[2425] Fix | Delete
function script_concat_settings() {
[2426] Fix | Delete
global $concatenate_scripts, $compress_scripts, $compress_css;
[2427] Fix | Delete
[2428] Fix | Delete
$compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' === ini_get( 'output_handler' ) );
[2429] Fix | Delete
[2430] Fix | Delete
$can_compress_scripts = ! wp_installing() && get_site_option( 'can_compress_scripts' );
[2431] Fix | Delete
[2432] Fix | Delete
if ( ! isset( $concatenate_scripts ) ) {
[2433] Fix | Delete
$concatenate_scripts = defined( 'CONCATENATE_SCRIPTS' ) ? CONCATENATE_SCRIPTS : true;
[2434] Fix | Delete
if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {
[2435] Fix | Delete
$concatenate_scripts = false;
[2436] Fix | Delete
}
[2437] Fix | Delete
}
[2438] Fix | Delete
[2439] Fix | Delete
if ( ! isset( $compress_scripts ) ) {
[2440] Fix | Delete
$compress_scripts = defined( 'COMPRESS_SCRIPTS' ) ? COMPRESS_SCRIPTS : true;
[2441] Fix | Delete
if ( $compress_scripts && ( ! $can_compress_scripts || $compressed_output ) ) {
[2442] Fix | Delete
$compress_scripts = false;
[2443] Fix | Delete
}
[2444] Fix | Delete
}
[2445] Fix | Delete
[2446] Fix | Delete
if ( ! isset( $compress_css ) ) {
[2447] Fix | Delete
$compress_css = defined( 'COMPRESS_CSS' ) ? COMPRESS_CSS : true;
[2448] Fix | Delete
if ( $compress_css && ( ! $can_compress_scripts || $compressed_output ) ) {
[2449] Fix | Delete
$compress_css = false;
[2450] Fix | Delete
}
[2451] Fix | Delete
}
[2452] Fix | Delete
}
[2453] Fix | Delete
[2454] Fix | Delete
/**
[2455] Fix | Delete
* Handles the enqueueing of block scripts and styles that are common to both
[2456] Fix | Delete
* the editor and the front-end.
[2457] Fix | Delete
*
[2458] Fix | Delete
* @since 5.0.0
[2459] Fix | Delete
*/
[2460] Fix | Delete
function wp_common_block_scripts_and_styles() {
[2461] Fix | Delete
if ( is_admin() && ! wp_should_load_block_editor_scripts_and_styles() ) {
[2462] Fix | Delete
return;
[2463] Fix | Delete
}
[2464] Fix | Delete
[2465] Fix | Delete
wp_enqueue_style( 'wp-block-library' );
[2466] Fix | Delete
[2467] Fix | Delete
if ( current_theme_supports( 'wp-block-styles' ) && ! wp_should_load_separate_core_block_assets() ) {
[2468] Fix | Delete
wp_enqueue_style( 'wp-block-library-theme' );
[2469] Fix | Delete
}
[2470] Fix | Delete
[2471] Fix | Delete
/**
[2472] Fix | Delete
* Fires after enqueuing block assets for both editor and front-end.
[2473] Fix | Delete
*
[2474] Fix | Delete
* Call `add_action` on any hook before 'wp_enqueue_scripts'.
[2475] Fix | Delete
*
[2476] Fix | Delete
* In the function call you supply, simply use `wp_enqueue_script` and
[2477] Fix | Delete
* `wp_enqueue_style` to add your functionality to the Gutenberg editor.
[2478] Fix | Delete
*
[2479] Fix | Delete
* @since 5.0.0
[2480] Fix | Delete
*/
[2481] Fix | Delete
do_action( 'enqueue_block_assets' );
[2482] Fix | Delete
}
[2483] Fix | Delete
[2484] Fix | Delete
/**
[2485] Fix | Delete
* Applies a filter to the list of style nodes that comes from WP_Theme_JSON::get_style_nodes().
[2486] Fix | Delete
*
[2487] Fix | Delete
* This particular filter removes all of the blocks from the array.
[2488] Fix | Delete
*
[2489] Fix | Delete
* We want WP_Theme_JSON to be ignorant of the implementation details of how the CSS is being used.
[2490] Fix | Delete
* This filter allows us to modify the output of WP_Theme_JSON depending on whether or not we are
[2491] Fix | Delete
* loading separate assets, without making the class aware of that detail.
[2492] Fix | Delete
*
[2493] Fix | Delete
* @since 6.1.0
[2494] Fix | Delete
*
[2495] Fix | Delete
* @param array $nodes The nodes to filter.
[2496] Fix | Delete
* @return array A filtered array of style nodes.
[2497] Fix | Delete
*/
[2498] Fix | Delete
function wp_filter_out_block_nodes( $nodes ) {
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function