Livrare 20kg plus

add_action( ‘woocommerce_after_shipping_rate’, ‘action_after_shipping_rate’, 20, 2 ); function action_after_shipping_rate ( $method, $index ) { // Targeting checkout page only: if( is_cart() ) return; // Exit on cart page if( ‘flat_rate:1’ === $method->id ) { echo __(“ Cheltuielile de livare nu sunt…Continue reading

Add Image Alt Text automatic

function add_alt_text_to_images( $html ) { // Check if the image has a title attribute if ( preg_match( ‘/(title=[“\’].*?[“\’])/’, $html, $matches ) ) { // Get the title $title = substr( $matches[0], 7, -1 ); // Check if the image has…Continue reading

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