craigiswayne / wp-siza
此包已被弃用且不再维护。未建议替代包。
我在WordPress开发中使用的辅助函数
此包尚未发布任何版本,且信息有限。
README
我在WordPress开发期间使用的辅助函数
用法
通过composer安装此包
composer require craigiswayne/wp-siza
在php文件中访问命名空间
<?php
use Splinter\WP;
辅助函数
`WP\is_debug`
``WP\unsanitize`
``WP\is_debug`
``WP\is_script_debug`
``WP\YouTube\get_thumbnail_url`
`
辅助类
WP\Widget
`WP\Widget`更多的是一个连接到Carbon Fields的桥梁。只需扩展此类即可轻松创建小工具
存在以下附加方法
`get_ID`
``get_title`
``get_setting`
``get_setting_default`
`
WP\Sidebar
允许您轻松显示侧边栏
方法
`display`
(也作为操作提供,见下文)`exists`
`
操作
这些操作是为回退目的创建的,因此无需进行`class_exists`
检查
`Splinter\WP\Sidebar\display`
`
WP\Post_Type
允许您快速注册自定义文章类型
<?php
use Splinter\WP\Post_Type;
Post_Type::create('book');
方法
`create`
`