Always turn off script optimization for admins/editors
... in Autoptimize.
This commit is contained in:
parent
7107fe55dd
commit
dcc769105d
@ -293,6 +293,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook
|
||||
| `pre_comment_user_ip` | `__return_empty_string`
|
||||
| `pre_get_posts` | `fictioneer_extend_taxonomy_pages`, `fictioneer_edit_others_fictioneer_posts`, `fictioneer_add_sof_to_taxonomy_query`
|
||||
| `pre_insert_term` | `fictioneer_restrict_tag_creation`
|
||||
| `pre_option_{$option}` | `fictioneer_override_autoptimize_optimize_logged_option`
|
||||
| `preprocess_comment` | `fictioneer_preprocess_comment`, `fictioneer_validate_comment_form`
|
||||
| `protected_title_format` | `fictioneer_remove_protected_text`
|
||||
| `query_vars` | `fictioneer_query_vars`
|
||||
|
@ -1291,6 +1291,27 @@ function fictioneer_ao_exclude_css( $exclude ) {
|
||||
}
|
||||
add_filter( 'autoptimize_filter_css_exclude', 'fictioneer_ao_exclude_css', 10, 1 );
|
||||
|
||||
/**
|
||||
* Turn off script optimization for admins and editors
|
||||
*
|
||||
* @since 5.20.0
|
||||
* @link https://developer.wordpress.org/reference/hooks/pre_option_option/
|
||||
*
|
||||
* @param mixed $pre_option The value to return instead of the option value
|
||||
* @param string $option Option name.
|
||||
*
|
||||
* @return mixed The updated or original option value.
|
||||
*/
|
||||
|
||||
function fictioneer_override_autoptimize_optimize_logged_option( $value, $option ) {
|
||||
if ( $option === 'autoptimize_optimize_logged' ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
add_filter( 'pre_option_autoptimize_optimize_logged', 'fictioneer_override_autoptimize_optimize_logged_option', 10, 2 );
|
||||
|
||||
// =============================================================================
|
||||
// OUTPUT HEAD FONTS
|
||||
// =============================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user