| 开发者 | iqbal1hossain |
|---|---|
| 更新时间 | 2026年9月11日 01:08 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[ohara_feed id="123"] shortcode, the Ohara YouTube Feed block, or a do_shortcode() PHP snippet for themes.ohara-feed-builder-for-youtube text domain.ohara/v1 and a set of filters for extending the feed types and layouts it supports:
ohara_allowed_layouts — extend the layout list beyond grid, list, and masonry.ohara_feed_layout_renderers — register a PHP renderer for a custom layout.ohara_feed_types — add a feed-type slug beyond the built-in channel.ohara_feed_type_sources — register a video-fetching callable for a custom feed type.ohara_feed_cache_args — supply the cache key for a custom feed type.ohara_sanitize_feed_source — sanitize a custom feed type's source value.ohara_validate_feed_source — accept or refuse a custom feed type's source value.ohara_feed_schema — register additional per-feed settings, which then flow through REST, storage, rendering, and the builder UI on their own.ohara_feed_slot_before_feed / ohara_feed_slot_after_feed — render your own markup above or below the feed, in every layout.ohara_settings_tabs — add a screen to Ohara → Settings, rendered by a React component you register on window.oharaSettingsPanels.ohara_feed_types only ever adds to the built-in type; it cannot remove it.
The YouTube API client exposes request(), remember(), clamp_count(), and normalize_item() so an add-on's feed type reuses this plugin's API key, transport, and cache rather than reimplementing them.
Source code and contributing
Ohara is developed in the open. The full, human-readable source — including the uncompiled React and SASS sources behind the bundles in build/, and the build scripts used to produce them — lives at:
https://github.com/wp-shark/ohara-feed-builder-for-youtube
Bug reports, feature requests, and pull requests are welcome there. To build the plugin from a checkout, run composer install && npm install && npm run build in the plugin directory.
ohara-feed-builder-for-youtube folder to /wp-content/plugins/.Yes. YouTube requires an API key for all data requests. Create a free Google Cloud project, enable the YouTube Data API v3, generate an API key, and paste it into Ohara → Settings → General. The plugin validates the key as soon as you save it.
Rarely. Feed responses are cached in your database using the WordPress Transients API, so visitors are served from the cache and YouTube is only contacted when the cache expires. You can change the caching interval — or clear all caches — under Ohara → Settings → Feeds.
Every saved feed has an Embed modal with three options: the [ohara_feed id="123"] shortcode, the Ohara YouTube Feed block, and a PHP snippet for use in theme templates.
Yes. A feed is a saved, reusable record. Embed it as many times as you like; editing the feed once updates every place it appears.
Yes. Each feed is rendered as real HTML on the server first, so search engines and visitors without JavaScript still see your videos. The interactive layer loads on top of that markup.
Each feed has its own header, title, and date toggles, plus optional background, text, and accent color overrides. For anything beyond that, use the CSS editor built into WordPress at Appearance → Customize → Additional CSS, or your theme's stylesheet.
Deleting the plugin removes its settings, cached feed data, and saved feeds. Deactivating it leaves everything in place, so you can safely deactivate and reactivate without losing your work.
Development happens on GitHub at https://github.com/wp-shark/ohara-feed-builder-for-youtube — open an issue for bugs and feature requests, or send a pull request. The repository's CONTRIBUTING.md covers coding standards, the security checklist, and what is expected in a PR.
Channel — a feed of a channel's latest videos. It is built in and works as soon as you have added an API key; there is nothing in this plugin to unlock. Developers can add further feed types with the ohara_feed_types and ohara_feed_type_sources filters, and an add-on plugin may ship its own.
Grid, List, and Masonry. Developers can register additional layouts with the ohara_allowed_layouts and ohara_feed_layout_renderers filters.
[ohara_feed] shortcode, Ohara YouTube Feed block, and PHP snippet embeds.