Allow plugins to inject additional template-specific open graph tags#2
Merged
Conversation
Contributor
|
Pinging @justinshreve |
Contributor
|
Added to 2.8 milestone. I will test this this week |
Contributor
Author
|
Here's some sample code to utilize one of these new filters to add Open Graph meta tags to a category template: add_filter( 'jetpack_open_graph_base_tags', function ( $meta ) {
if ( is_category() ) {
$category = get_queried_object();
$meta['og:title'] = $category->name;
$meta['og:url'] = get_category_link( $category->term_id );
if ( ! empty( $category->description ) ) {
$meta['og:description'] = $category->description;
}
}
return $meta;
} ); |
blobaugh
added a commit
that referenced
this pull request
Jan 15, 2014
Allow plugins to inject additional template-specific open graph tags
blobaugh
pushed a commit
that referenced
this pull request
Mar 13, 2014
…ific open graph tags. Allows plugins to inject template specific code on pages other than the default pages that Open Graph is available on. See #2 Merges r89169-wpcom.
jeherve
referenced
this pull request
in jeherve/jetpack
Jul 20, 2016
Dailymotion shortcode: fix failing test.
stevenlinx
pushed a commit
to stevenlinx/jetpack
that referenced
this pull request
Apr 23, 2018
kangzj
added a commit
that referenced
this pull request
May 15, 2026
…-191) (#48848) * Search: accept canonical `search_experience` on plan/activate (SEARCH-191) Adds the canonical `search_experience` parameter to `POST /jetpack/v4/search/plan/activate`. When set, the activate path routes through `Module_Control::update_experience()` instead of toggling the legacy `enable_instant_search` boolean. This lets WPCOM change the default experience without a Jetpack code change. The legacy `enable_search` / `enable_instant_search` parameters keep working as a fallback for older callers. * Address review: validate search_experience, unconditional activate, gate auto_config - Reject non-string and `off` search_experience values up front with a 400 `invalid_experience` before any side effect (Copilot #1, #2). - Pull `Module_Control::activate()` out of the legacy branch so it runs for both canonical and legacy callers (per Jasper's inline review). The `enable_search: false` legacy flag had no real-world caller and is dropped. - Gate `auto_config_search` on the resulting `is_instant_search_enabled()` state so Overlay sidebar widgets aren't injected for Inline/Embedded callers (Copilot #4). - Strengthen the invalid-experience test to assert 400 + `invalid_experience` code, and add coverage for the `off` and non-string rejection paths (Copilot #3). * Address review: lift module activation above the search_experience block Restores the `enable_search` opt-out flag (defaults to true) and runs `Module_Control::activate()` once at the top, before the experience-handling branch. This makes activation the explicit precondition of `/plan/activate` rather than a side effect of which payload variant the caller sent, and collapses the previously-split validation and application of `search_experience` into a single block. * Restore original comment on enable_search gate * Run enable_instant_search outside the search_experience branch (best-effort) * Address review: gate legacy enable_instant_search on search_experience === null claude[bot] re-review flagged that the previous commit (4c7cd61) made the legacy `enable_instant_search` block run after the canonical `search_experience` path, overriding any non-overlay experience (e.g. a caller sending `search_experience: 'embedded'` would end up in the overlay state). Gating the legacy block on `search_experience === null` keeps the two paths mutually exclusive without going back to an elseif. Confirmed by re-running test_activate_plan_admin_with_search_experience — it failed against 4c7cd61 and passes with this fix.
4 tasks
This was referenced May 20, 2026
Merged
7 tasks
arthur791004
added a commit
that referenced
this pull request
May 26, 2026
Codex P1 — Restrict downgrades to MODE_ACTIVATION. Update mode's post-update healthcheck must rollback on captured fatals; silently downgrading sibling-load / signature-allowlist matches in update mode would leave the site running broken files with no recovery path. Codex P2 + self review #1 — Track candidate-load milestone in probe-endpoint. pre-require / in-require:$plugin / required. Shutdown handler attributes ok-shutdown during a require as throwable (real WP activation would abort the same way), and pre-require state as error (probe never observed the candidate, learned nothing). Codex P3 — Drop the preserve-on-inconclusive branch in update-healthcheck. Snapshot transients are already consumed by then; keeping the backup directory just orphans it under temp until the stale sweep. After P1 there are no captured-fatal downgrades in update mode, so non-fatal here genuinely means no rollback needed. Self review #2 — Plugin-scoped signature allowlist requires explicit plugin attribution on the verdict. Whole-batch fallback could match an unrelated sibling's fatal under another plugin's label. Self review #4 — Sibling-load throwable arm restricted to PHP engine error classes via is_php_engine_error_class. A hand-thrown RuntimeException with class-not-found-shaped wording stays blocking. Self review #5 — is_anomalous_allow includes ok-shutdown so the observability backstop covers the degraded-probe case. Self review #6 — Log Signature allowlist rejected when an entry has no narrowing criteria, so misconfigured allowlists are visible. Self review #7 — blog_bucket = abs($x % 100) so the result is always non-negative even on 32-bit PHP (abs(crc32) overflows for PHP_INT_MIN). Self review #8 — path_inside_candidate / message_references_candidate_path normalize WP_PLUGIN_DIR with untrailingslashit so a trailing-slash plugins root doesn't bypass the flat-file-plugin skip. 70/70 PHPUnit pass, PHPCS clean on touched files.
This was referenced May 26, 2026
5 tasks
6 tasks
5 tasks
6 tasks
This was referenced Jun 24, 2026
This was referenced Jun 29, 2026
This was referenced Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently it is not possible to use Jetpack to add
ogtags for archive templates. This makes it possible to addogtags for them and other templates.