add_filter, add_action

wordpress add_filter:

 

wordpress add_action:

 

 

snipets:

// Custom Login Screen
function ifHeaderUrl() {
  return esc_url(site_url('/'));
}
add_filter('login_headerurl', 'ifHeaderUrl');

function ifLoginCSS() {
  wp_enqueue_style('if_main_style', get_stylesheet_uri());
}
add_action('login_enqueue_scripts', 'ifLoginCSS');

function ifLoginTitle() {
  return get_bloginfo('name');
}
add_filter('login_headertitle', 'ifLoginTitle');
// Add styles and scripts
function if_files() {
  wp_enqueue_script('main_scripts', get_theme_file_uri('/js/main.min.js'), NULL, microtime(), true);
  wp_enqueue_script('scripts_bundled', get_theme_file_uri('/js/scripts-bundled.js'), NULL, microtime(), true);
  wp_enqueue_script('scripts_bundled', get_theme_file_uri('/js/scripts-bundled.js'), array('jquery'), microtime(), true);
  wp_enqueue_script('bootstrapJS', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js', NULL, '1.0', true);
  wp_enqueue_style('bootstrapCSS', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
  wp_enqueue_style('ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css');
  wp_enqueue_style('if_main_style', get_stylesheet_uri());

  wp_localize_script('main_scripts', 'ifData', array(
    'root_url' => get_site_url()
  ));
}
add_action('wp_enqueue_scripts', 'if_files');

#snipets #Wordpress

Agnieszka Trefler

Agnieszka Trefler (Ruda) - freelancer, web developer, specjalistka od WordPressa z Wrocławia. Z pasją budowania stron, blogowania i fotografowania. Twórca Inspiracji fotograficznych.