Skip to content

Allow plugins to inject additional template-specific open graph tags - #2

Merged
blobaugh merged 2 commits into
Automattic:masterfrom
xwp:more-og-filters
Jan 15, 2014
Merged

blobaugh merged 2 commits into
Automattic:masterfrom
xwp:more-og-filters

Conversation

@westonruter

Copy link
Copy Markdown
Contributor

Currently it is not possible to use Jetpack to add og tags for archive templates. This makes it possible to add og tags for them and other templates.

@blobaugh

blobaugh commented Jan 6, 2014

Copy link
Copy Markdown
Contributor

Pinging @justinshreve

@ghost ghost assigned blobaugh Jan 15, 2014
@blobaugh

Copy link
Copy Markdown
Contributor

Added to 2.8 milestone. I will test this this week

@westonruter

Copy link
Copy Markdown
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
blobaugh merged commit 9db85ff into Automattic:master Jan 15, 2014
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.
samhotchkiss added a commit that referenced this pull request Jan 16, 2015
samhotchkiss added a commit that referenced this pull request Jan 22, 2015
samhotchkiss referenced this pull request Feb 2, 2015
Clear rows for Related Posts: Fixes #1091 and #1337
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
@fgiannar fgiannar removed their assignment Sep 28, 2026
adamwoodnz added a commit that referenced this pull request Oct 18, 2026
…otting (Codex P2 #1, #2)

The palette assigns colors by group, so regrouping into current and previous painted both bars of a slot alike for a caller that sets no stroke. A previous period with no counterpart had no front bar to stand behind and was drawn in the wrong slot.
adamwoodnz added a commit that referenced this pull request Oct 20, 2026
…otting (Codex P2 #1, #2)

The palette assigns colors by group, so regrouping into current and previous painted both bars of a slot alike for a caller that sets no stroke. A previous period with no counterpart had no front bar to stand behind and was drawn in the wrong slot.
adamwoodnz added a commit that referenced this pull request Oct 21, 2026
With the keyboard tooltip open, hiding a series from the legend left
the selection in place, because the point count did not change. The
tooltip effect then re-showed the remaining series on top of the old
tooltip data, so the hidden series stayed listed.

Pass the visible labels as visibleSeriesKey, as BarChart does, so the
navigation hook clears the selection when the visible set changes.
(Codex round 2 P2 #2)
adamwoodnz added a commit that referenced this pull request Oct 22, 2026
With the keyboard tooltip open, hiding a series from the legend left
the selection in place, because the point count did not change. The
tooltip effect then re-showed the remaining series on top of the old
tooltip data, so the hidden series stayed listed.

Pass the visible labels as visibleSeriesKey, as BarChart does, so the
navigation hook clears the selection when the visible set changes.
(Codex round 2 P2 #2)
adamwoodnz added a commit that referenced this pull request Oct 23, 2026
…3910)

* Charts: Keep hidden series out of the line chart keyboard tooltip

LineChart handed the keyboard tooltip every series, hidden ones
included. In group mode the tooltip shows a datum for each series it
gets, so arrowing through a chart with a legend-hidden line still
listed that line, while the pointer tooltip (which only sees rendered
lines) did not. The last series shown also became nearestDatum, which
consumers read for the tooltip heading.

Pass only the visible series. The two existing visible-series
filters now share the same memoized list.

* Changelog: Add entries for the line chart keyboard tooltip fix

Premium Analytics renders line charts that can hide series, through
its interactive comparison legend and defaultHiddenSeries, so its
users can see the fix. The Jetpack plugin ships the same dashboard
behind jetpack_premium_analytics_enabled. Publicize, VideoPress and
Newsletter line charts cannot hide a series, so they get no entry.

* Address review: Name keyboard points from the first visible series

With the first series hidden, the tooltip now showed the next visible
series, but Enter and Space still handed the hidden series' datum to
onDatumActivate, and the keyboard stopped at the hidden series' last
point. So the activated point disagreed with the tooltip, and a
longer visible series could not be reached.

Read both from the first visible series instead. (Codex P2 #1)

* Address review: Close the keyboard tooltip when visible series change

With the keyboard tooltip open, hiding a series from the legend left
the selection in place, because the point count did not change. The
tooltip effect then re-showed the remaining series on top of the old
tooltip data, so the hidden series stayed listed.

Pass the visible labels as visibleSeriesKey, as BarChart does, so the
navigation hook clears the selection when the visible set changes.
(Codex round 2 P2 #2)

* Address review: Reach every visible point by keyboard

Counting stops from the first visible series broke navigation when
that series was empty or shorter than a later one: hiding the first
of [A, empty B, C] left no stops at all, although C is drawn. Before
this branch the hidden first series set the count, so that chart was
still navigable.

Count stops from the longest visible series, and name an activated
point from the first visible series that has one at that index.
(Codex round 3 P2 #1)

* Address review: Rebuild the grouped keyboard tooltip from scratch

visx merges every shown datum into the previous tooltip data. When a
series was hidden while the keyboard tooltip stayed open (focus in the
chart and a changed point count, so the navigation hook clamped rather
than cleared), the group re-show added the visible series but never
dropped the hidden one, and its row stayed in the tooltip.

Clear the tooltip before showing the group, so it holds only the
series it is given. (Claude final review)

* Address review: Describe index re-pointing for line charts too

The navigation hook comment said hiding a series moves every index
onto a different bar. LineChart now passes visibleSeriesKey as well,
where an index is an x position, so the bar wording no longer fits.
(Claude final review nit)

* Address review: Check the clamped tooltip stays open

The assertion only checked that Series A left the tooltip, which also holds if the tooltip closes. Checking that Series B is still listed keeps the test on the clamp path it exists for.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Publicize Now Jetpack Social, auto-sharing [Feature] Sharing Post sharing, sharing buttons

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants