add_filter( ‘upload_mimes’, function ( $mimes ) { // By default, only administrator users are allowed to add ICO files. // To enable more user types edit or comment the lines below but beware of // the security risks if you…Continue reading
function my_gallery_default_type_set_link( $settings ) { $settings[‘galleryDefaults’][‘link’] = ‘file’; return $settings; } add_filter( ‘media_view_settings’, ‘my_gallery_default_type_set_link’);Continue reading
Lesson 1: Introduction to Critical ThinkingContinue reading
function wpcode_snippet_remove_query_strings_split_login( $src ) { $output = preg_split( “/(&ver|?ver)/”, $src ); return $output ? $output[0] : ”; } add_action( ‘init’, function () { if ( ! is_admin() && ! is_login() ) { add_filter( ‘script_loader_src’, ‘wpcode_snippet_remove_query_strings_split_login’, 15 ); add_filter( ‘style_loader_src’, ‘wpcode_snippet_remove_query_strings_split_login’,…Continue reading
function wpcode_snippet_remove_query_strings_split( $src ) { $output = preg_split( “/(&ver|?ver)/”, $src ); return $output ? $output[0] : ”; } add_action( ‘init’, function () { if ( ! is_admin() ) { add_filter( ‘script_loader_src’, ‘wpcode_snippet_remove_query_strings_split’, 15 ); add_filter( ‘style_loader_src’, ‘wpcode_snippet_remove_query_strings_split’, 15 ); }…Continue reading
/** * Wrap the thumbnail in a link to the post. * Only use this if your theme doesn’t already wrap thumbnails in a link. * * @param string $html The thumbnail HTML to wrap in an anchor. * @param…Continue reading
function wpcode_snippet_remove_query_strings_split( $src ) { $output = preg_split( “/(&ver|\?ver)/”, $src ); return $output ? $output[0] : ”; } add_action( ‘init’, function () { if ( ! is_admin() ) { add_filter( ‘script_loader_src’, ‘wpcode_snippet_remove_query_strings_split’, 15 ); add_filter( ‘style_loader_src’, ‘wpcode_snippet_remove_query_strings_split’, 15 ); }…Continue reading
add_filter( ‘pre_get_avatar_data’, function ( $atts ) { if ( empty( $atts[‘alt’] ) ) { if ( have_comments() ) { $author = get_comment_author(); } else { $author = get_the_author_meta( ‘display_name’ ); } $alt = sprintf( ‘Avatar for %s’, $author ); $atts[‘alt’]…Continue reading