kaiseki/wp-favicon
Composer 安装命令:
composer require kaiseki/wp-favicon
包简介
Render favicon and touch-icon link tags on the WordPress front end, admin and login screens
README 文档
README
Render favicon and touch-icon link tags on the WordPress front end, admin and login screens.
Point it at a directory containing favicon.ico, icon.svg, apple-touch-icon.png and
manifest.json; it prints the matching <link> tags on wp_head, login_head and (optionally)
admin_head, and disables WordPress' own site-icon output in the admin. Wired through ConfigProvider
and the favicon config key.
Installation
composer require kaiseki/wp-favicon
Requires PHP 8.2 or newer.
Usage
Register ConfigProvider with your laminas-style config aggregator and configure the favicon key:
use Kaiseki\WordPress\Favicon\Favicon; return [ 'favicon' => [ // Directory holding the icon assets, relative to the active theme directory // (the theme directory URI is prepended automatically). 'path' => 'assets/favicon', // Optional separate directory for the admin; falls back to `path`. 'admin_path' => '', // Whether to also render the favicon in the admin when no admin_path is set. 'show_in_admin' => true, ], 'hook' => [ 'provider' => [ Favicon::class, ], ], ];
ConfigProvider registers FaviconFactory, which reads the favicon config. With path set, the
front-end and login tags are rendered; admin_path (or show_in_admin) controls the admin output.
Development
composer install
composer check # check-deps, cs-check, phpstan
License
MIT — see LICENSE.
统计信息
- 总下载量: 904
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-05