Powered By Blogger
Showing posts with label filter. Show all posts
Showing posts with label filter. Show all posts

Saturday, November 5, 2016

wp mail content type or HTML mail template for wp_mail

https://codex.wordpress.org/Plugin_API/Filter_Reference/wp_mail_content_type

Function.php

add_filter( 'wp_mail_content_type', 'set_content_type' );
function set_content_type( $content_type ) {
 return 'text/html';
}

Friday, October 14, 2016

author based filter in all post in wp-admin in wordpress

function.php


function rudr_filter_by_the_author() {
 $params = array(
  'name' => 'author', // this is the "name" attribute for filter <select>
  'show_option_all' => 'All authors' // label for all authors (display posts without filter)
 );
 
 if ( isset($_GET['user']) )
  $params['selected'] = $_GET['user']; // choose selected user by $_GET variable
 
 wp_dropdown_users( $params ); // print the ready author list
}
 
add_action('restrict_manage_posts', 'rudr_filter_by_the_author');





https://rudrastyh.com/wordpress/filter-posts-by-author.html