wp-forge / wp-query-starts-with
一个WordPress的Composer包,允许您根据标题开头查询帖子。
1.0
2022-08-02 16:38 UTC
This package is auto-updated.
Last update: 2024-08-30 01:18:00 UTC
README
一个WordPress的Composer包,允许您根据标题开头查询帖子。
安装
安装 Composer。
在您的WordPress插件或主题目录中,运行
composer require wp-forge/wp-query-starts-with
确保您的项目中包含此行代码
<?php require __DIR__ . '/vendor/autoload.php';
用法
当创建自定义查询时
<?php $query = new WP_Query( array( 'post_type' => 'post', 'starts_with' => 'Pre', // This is case-sensitive and must match the first part of the post title exactly. // ... ) );