Custom Classes
Traits

Core Block Utility

Utility functions that are shared across Core blocks.

_get_typography_classes

If typography settings are allowed, get the classes for frontend display.

  • $styles: array — Array containing block styles/classes.

Filters

pmc_gutenberg_typography_config

Filters the typography configuration for blocks.

  • $config: array — Defined configuration.
pmc_use_heading_tag_levels_filter

Allows use of the default heading level rather than block attributes.

  • $use_heading_tag_level: bool — Whether or not to use the heading tag level. Default false.

Digital Daily Common Elements

Elements of Digital Daily's Larva patterns that are shared across several story blocks.

_parse_attributes

Parse block attributes along with defaults.

  • $attributes: array — Block attributes.

_get_larva_module_with_variant

Set variant based on style selected for this block.

  • $attrs: array — Block attributes.

_conditionally_remove_full_view_filters

Remove permalink filters that keep users in the Full View, when conditions warrant it. Certain blocks do not have a Full-View representation, so users are allowed to click to that content's regular presentation.

_conditionally_restore_full_view_filters

Restore permalink filters that keep users in the Full View, when conditions warrant it. Certain blocks do not have a Full-View representation, so users are allowed to click to that content's regular presentation.

_add_c_article_tags

Populate post tags for full post.

  • $data: array — c_article_tags Pattern data.

_conditionally_add_c_author

Populate author data if selected for display.

  • $data: array — Pattern data.

_add_c_author

Populate author data for full post.

  • $data: array — c_author pattern data.

_add_c_button

Populate c_button with story's permalink.

  • $data: array — c_button Pattern data.

_add_c_dek

Populate post excerpt (dek).

  • $data: array — c_dek Pattern data.

_add_c_paragraph

Populate post content in c_paragraph. TODO: This is named incorrectly in the pattern; it's a module, not a component.

  • $data: array — paragraph module Pattern data.
  • $which: int — Number of paragraph to return.

_add_c_tag_span

Populate post's primary term in c_tag_span.

  • $data: array — c_tag_span pattern data.

_add_c_timestamp

Populate post timestamp for full post.

  • $data: array — c_timestamp Pattern data.

_add_c_title

Populate post title.

  • $data: array — c_title Pattern data.

_set_permalink_attr

Populate post object's relative permalink.

  • $permalink: string — Permalink for analytics purposes.

_set_title_attr

Populate post object's title.

  • $title: string — Title for analytics purposes.

_populate_sharing_buttons

Set data for sharing icons.

  • $data: array — Block's pattern data.