Answers for "dequeue dashicons"

PHP
0

dequeue dashicons

// INSIDE YOUR THEME FUNCIONS.PHP FILE ->
function wpdocs_dequeue_dashicon() {
  wp_deregister_style('dashicons');
}
add_action( 'wp_enqueue_scripts', 'wpdocs_dequeue_dashicon' );

// OR remove dashicons in frontend to non-admin 
function wpdocs_dequeue_dashicon() {
  if (current_user_can( 'update_core' )) {
    return;
  }
  wp_deregister_style('dashicons');
}
add_action( 'wp_enqueue_scripts', 'wpdocs_dequeue_dashicon' );
Posted by: Guest on June-04-2021

Browse Popular Code Answers by Language