Add custom fonts

function add_custom_fonts() { wp_enqueue_style('custom-fonts', 'https://fonts.googleapis.com/css?family=Font1|Font2'); } add_action('wp_enqueue_scripts', 'add_custom_fonts');  

Read More

Add custom fields to the media library

function add_custom_media_fields($form_fields, $post) { $form_fields['custom_field'] = array( 'label' => 'Custom Field', 'input' => 'text', 'value' => get_post_meta($post->ID, '_custom_field', true), ); return $form_fields; } add_filter('attachment_fields_to_edit', 'add_custom_media_fields', 10, 2); function save_custom_media_fields($post, $attachment) { update_post_meta($post['ID'], '_custom_field', $attachment['custom_field']); return $post; } add_filter('attachment_fields_to_save', 'save_custom_media_fields', 10, 2);  

Read More

Disable the WordPress REST API

function disable_rest_api() { return new WP_Error('rest_disabled', 'The REST API has been disabled.', array('status' => 403)); } add_filter('rest_authentication_errors', 'disable_rest_api');  

Read More

Change the default image upload directory

function custom_upload_dir($path) { $upload_dir = wp_upload_dir(); $path['path'] = $upload_dir['basedir'] . '/custom'; $path['url'] = $upload_dir['baseurl'] . '/custom'; return $path; } add_filter('upload_dir', 'custom_upload_dir');  

Read More

Disable the WordPress emoji script

function disable_emojis() { 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', 'wp_staticize_emoji_for_email'); } add_action('init', 'disable_emojis');  

Read More

Activate free shipping for regular customers

add_filter('woocommerce_shipping_free_shipping_threshold', 'free_shipping_for_returning_customers'); function free_shipping_for_returning_customers($threshold) { if (is_user_logged_in() && current_user_can('customer_group')) { $threshold = 0; // Free shipping for regular customers } return $threshold; }  

Read More