0
X
Add Snippet To Project
New Project
Add To Existing Project
/*
* Plugin Name: WPTurbo Starter Plugin
* Plugin URI: https://wpturbo.dev
* Description: A starter plugin template.
* Version: 1.0.0
* Author: WPTurbo
* Author URI: https://wpturbo.dev
* Text Domain: wpturbo
*/
/**
* Allow SVG File Uploads.
*
* @param array $mimes An associative array of allowed file types.
*
* @return array Modified array of allowed file types.
*/
function wpturbo__enable_svg_uploads( array $mimes ): array {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter( 'upload_mimes', 'wpturbo__enable_svg_uploads' );
/**
* Allow WebP File Uploads.
*
* @param array $mimes An associative array of allowed file types.
*
* @return array Modified array of allowed file types.
*/
function wpturbo__enable_webp_uploads( array $mimes ): array {
$mimes['webp'] = 'image/webp';
return $mimes;
}
add_filter( 'upload_mimes', 'wpturbo__enable_webp_uploads' );
/**
* Speed Up the Block Editor.
*/
add_filter( 'should_load_separate_core_block_assets', '__return_true' );
/**
* Remove WordPress Version Generator Tag.
*/
remove_action( 'wp_head', 'wp_generator' );
/**
* Remove WooCommerce Version Generator Tag.
*/
remove_action( 'wp_head', 'wc_generator' );
/**
* Remove X-Powered-By header.
*
* @return void
*/
function wpturbo_remove_x_powered_by() : void {
if (function_exists('header_remove')) {
header_remove('x-powered-by');
}
}
add_action( 'wp', 'wpturbo_remove_x_powered_by' );
/**
* Change Default "From" Name To '6istore'
*
* @return string
*/
function wpturbo_change_default_from_name(): string {
return '6istore';
}
add_filter( 'wp_mail_from_name', 'wpturbo_change_default_from_name' );
/**
* Remove WordPress Logo from Admin Bar
*
* @param WP_Admin_Bar $wp_admin_bar
*
* @return void
*/
function wpturbo_remove_wordpress_logo( WP_Admin_Bar $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'wp-logo' );
}
add_action( 'admin_bar_menu', 'wpturbo_remove_wordpress_logo', 999 );
/**
* Remove WordPress Logo from Login Page
*
* @return void
*/
function wpturbo_remove_login_logo() : void {
?>
<style type="text/css">
#login h1 a, .login h1 a {
display: none;
}
</style>
<?php
}
add_action( 'login_enqueue_scripts', 'wpturbo_remove_login_logo' );
/**
* Remove Welcome Panel From The Dashboard
*
* @return void
*/
function wpturbo_remove_welcome_panel() : void {
remove_action('welcome_panel', 'wp_welcome_panel');
}
add_action( 'widgets_init', 'wpturbo_remove_welcome_panel' );
/**
* Disable Gutenberg editor
*/
add_filter( 'use_block_editor_for_post', '__return_false', 10 );