helick/related-posts
Composer 安装命令:
composer require helick/related-posts
包简介
The Helick related posts plugin
关键字:
README 文档
README
The plugin provides a simple related posts functionality with the following features:
- Ability to manually override related posts
- ElasticPress integration
Requirements
Make sure all dependencies have been installed before moving on:
Install
Via Composer:
$ composer require helick/related-posts
Usage
The plugin exposes a single function that returns a list of post IDs.
$postIds = Helick\RelatedPosts\get(int $postId, array $args = []);
$postId is the ID of the post to get related content for.
$args allows you some control over the posts that are returned:
- int limit: defaults to
10 - array post_types: array of post types to limit results to, defaults to
['post'] - array taxonomies: array of taxonomies to compare against, defaults to
['category'] - array terms: array of
WP_Termobjects, results will match these terms - array terms_not_in: array of
WP_Termobjects, results will not match these terms - bool ep_integrate: if true then ElasticPress is used to get the results, defaults to
defined('EP_VERSION')
Custom post type support
Control supported post types:
add_filter('helick_related_posts_supported_post_types', function (array $postTypes) { $postTypes[] = 'your-custom-post-type'; return $postTypes; });
Control associated post types:
add_filter('helick_related_posts_associated_post_types', function (array $postTypes) { $postTypes[] = 'your-custom-post-type'; return $postTypes; });
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email evgenii@helick.io instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
helick/related-posts 适用场景与选型建议
helick/related-posts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 139 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 06 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「related posts」 「helick」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 helick/related-posts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 helick/related-posts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 helick/related-posts 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP ORM plugin for persisting selected fields of related tables
Yii 2 Models load with relation, & transaction save with relation
Adds support for posts
Auto generate related products for Magento 2
Yii 2 Models load with relation, & transaction save with relation for MongoDB
Add Related discussions
统计信息
- 总下载量: 139
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-06