meom / meom-dodo
MEOM 清理 WP。
1.4
2023-02-21 08:19 UTC
Requires (Dev)
- meom/phpcs-composer: dev-main
README
MEOM Dodo 插件用于清理 WordPress。
需求
- PHP 7+。
- Composer 用于管理 PHP 依赖。
安装
使用 Composer 安装包。
composer require meom/meom-dodo
或者,如果你处于前沿
composer require meom/meom-dodo:dev-main
过滤器
meom_dodo_allowed_embed_variants
默认情况下,只允许 youtube
嵌入。你可以通过过滤器 meom_dodo_allowed_embed_variants
修改允许的数组。
注意!这已经在 Kala Stack 中存在。
示例用法
/** * Determine which embeds are allowed. * By default only youtube is allowed, defined in MEOM Dodo plugin. * * @param array $allowed_embeds List of allowed embeds. * @return array $allowed_embeds Modified array of allowed embeds. */ function prefix_gutenberg_allowed_embeds( $allowed_embeds ) { $allowed_embeds = [ 'youtube', 'vimeo', ]; return $allowed_embeds; } add_filter( 'meom_dodo_allowed_embed_variants','prefix_gutenberg_allowed_embeds' );
meom_dodo_remove_drop_cap
允许使用过滤器 meom_dodo_remove_drop_cap
使用首字母下沉。
示例用法
add_filter( 'meom_dodo_remove_drop_cap', '__return_false' );
meom_dodo_remove_block_directory
允许使用过滤器 meom_dodo_remove_block_directory
使用块目录。
示例用法
add_filter( 'meom_dodo_remove_block_directory', '__return_false' );
meom_dodo_remove_layout_support
允许使用过滤器 meom_dodo_remove_layout_support
使用布局支持。
示例用法
add_filter( 'meom_dodo_remove_layout_support', '__return_false' );
meom_dodo_remove_svg_filters
允许使用过滤器 meom_dodo_remove_svg_filters
使用 SVG 过滤器。
示例用法
add_filter( 'meom_dodo_remove_svg_filters', '__return_false' );
meom_dodo_add_utility_classes
使用过滤器 meom_dodo_add_utility_classes
移除添加实用类。
示例用法
add_filter( 'meom_dodo_add_utility_classes', '__return_false' );
meom_dodo_show_contact_content
使用过滤器 meom_dodo_show_contact_content
隐藏联系内容管理小工具。
示例用法
add_filter( 'meom_dodo_show_contact_content', '__return_false' );
meom_dodo_removed_admin_menu_items
默认情况下,一些管理菜单项已被移除。你可以通过过滤器 meom_dodo_removed_admin_menu_items
修改移除的管理菜单项列表。
/** * Determine which admin menu items are removed. * * @param array $removed_admin_menu_items List of removed admin menu items. * @return array $removed_admin_menu_items Modified array of removed admin menu items. */ function prefix_removed_admin_menu_items( $removed_admin_menu_items ) { $removed_admin_menu_items = [ 'plugins.php', 'edit.php?post_type=acf-field-group', 'themes.php', 'users.php', ]; return $removed_admin_menu_items; } add_filter( 'meom_dodo_removed_admin_menu_items', 'prefix_removed_admin_menu_items' );