dekode/wp-resets

WordPress 必用插件,由 Dekode 提供

安装量: 18,288

依赖: 0

建议者: 0

安全: 0

星级: 3

关注者: 9

分支: 0

公开问题: 0

类型:wordpress-muplugin

2.0.3 2021-04-20 06:48 UTC

This package is auto-updated.

Last update: 2024-09-20 14:30:08 UTC


README

目录

描述

这是一个包含 Dekode 用于优化 WordPress 的基本功能的集合。

加载

此 mu-plugin 默认不会加载到 WordPress 中。您需要在 mu-plugins 文件夹中手动创建加载文件。

您还应该将插件添加到您的项目 .gitignore 文件中。

<?php
/**
 * Autoloader for wp-resets
 *
 */

declare( strict_types = 1 );

if ( file_exists( trailingslashit( __DIR__ ) . 'wp-resets/resets.php' ) ) {
	require trailingslashit( __DIR__ ) . 'wp-resets/resets.php';
}

使用

function setup_custom_project() {
	add_theme_support( 'admin-cards' );
	add_theme_support( 'admin-cleanup' );
	add_theme_support( 'disable-comments' );
	add_theme_support( 'disable-customizer' );
	add_theme_support( 'disable-emoji' );
	add_theme_support( 'disable-feeds' );
	add_theme_support( 'disable-xmlrpc' );
	add_theme_support( 'optimize-embeds' );
	add_theme_support( 'optimize-wp-head' );
	add_theme_support( 'optimize-yoast-schema' );
	add_theme_support( 'post-to-article' );
	add_theme_support( 'searchwp-norwegian-stopwords' );
	add_theme_support( 'youtube-embed-nocookie' );
}
add_action( 'after_setup_theme', 'setup_custom_project' );