Type: php
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
Completely disable AIOSEO Schema
add_filter( ‘aioseo_schema_disable’, ‘aioseo_disable_schema’ ); function aioseo_disable_schema( $disabled ) { return true; }Continue reading
Untitled Snippet
wpforms[post_id];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
Untitled Snippet (copy)
(function(w,d,e,u,f,l,n){w[f]=w[f]||function(){(w[f].q=w[f].q||[]) .push(arguments);},l=d.createElement(e),l.async=1,l.src=u, n=d.getElementsByTagName(e)[0],n.parentNode.insertBefore(l,n);}) (window,document,’script’,’https://assets.mailerlite.com/js/universal.js’,’ml’); ml(‘account’, ‘307601’);Continue reading