Remove image link from media uploads

/* Remove image link from media uploads */ function wpb_imagelink_setup() { $image_set = get_option( ‘image_default_link_type’ ); if ($image_set !== ‘none’) { update_option(‘image_default_link_type’, ‘none’); } } add_action(‘admin_init’, ‘wpb_imagelink_setup’, 10);Continue reading

Disable WordPress image compression

// Disable image compression add_filter( ‘jpeg_quality’, ‘smashing_jpeg_quality’ ); function smashing_jpeg_quality() { return 100; } // Disable image scaling add_filter( ‘big_image_size_threshold’, ‘__return_false’ );Continue reading

create_folder_and_upload_file

function create_custom_directory($dir_name) { $upload_dir = wp_upload_dir(); // Get the uploads directory array $custom_dir = $upload_dir[‘basedir’] . ‘/’ . $dir_name; // Specify the custom folder if (!file_exists($custom_dir)) { wp_mkdir_p($custom_dir); if(file_exists($custom_dir)) { return “Directory created successfully.”; } else { return “Failed to…Continue reading

Change POSTS to NEWS in WP dashboard

// Change POSTS to News in WP dashboard add_action( ‘admin_menu’, ‘rd_change_post_menu_label’ ); add_action( ‘init’, ‘rd_change_post_object_label’ ); function rd_change_post_menu_label() { global $menu; global $submenu; $menu[5][0] = ‘News’; $submenu[‘edit.php’][5][0] = ‘News’; $submenu[‘edit.php’][10][0] = ‘Add News’; $submenu[‘edit.php’][16][0] = ‘News Tags’; echo ”; }…Continue reading