Disable Emojis

/** * Disable the emojis in WordPress. */ add_action( ‘init’, function () { remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 ); remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ ); remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ ); remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ ); remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ ); remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ ); remove_filter( ‘wp_mail’,…Continue reading

Allow SVG Files Upload

/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Add default ALT to avatar/Gravatar Images

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

Hide Tickets for members

function my_hide_ticket_by_taxonomy_role( $content ) { if ( is_tax( ‘tribe_events_cat’, ‘301’ ) && ( current_user_can( ‘member_core’ ) || current_user_can( ‘member_writer’ ) ) ) { // Remove the event ticket form $content = preg_replace( ‘//is’, ”, $content ); } return $content; }…Continue reading

Noindex Products under a Product Category

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { if ( has_term( ‘CategoryName’, ‘product_cat’ ) ) { $attributes[‘noindex’] = ‘noindex’; } return $attributes; }Continue reading

Disable SEO Preview feature

add_action( ‘init’, function() { if ( ! function_exists( ‘aioseo’ ) ) { return; } remove_action( ‘wp’, [ aioseo()->standalone->seoPreview, ‘init’ ] ); }, 100);Continue reading