pfeifferNet

cookbook

Table of Contents

Classes

Updater
Theme updater.

Constants

THEME_NAME  = 'GP-cookbook'
Define the theme name constant.

Functions

add_course_filter()  : void
Show a course filter on selected archive pages.
modify_archive_order()  : void
Change sort order of archive pages where required.
archive_redirect()  : void
Redirect selected archive pages.
modify_archive_title()  : string
Remove prefix for taxonomy name from archive titles.
set_excerpt()  : string
Set excerpt if no custom excerpt.
register_scripts()  : void
Register scripts.
register_styles()  : void
Register styles.
enqueue_assets()  : void
Enqueue the scripts and styles.
disable_child_theme_load()  : bool
Prevent generatepress from loading child theme stylesheet.
get_asset_path()  : string
Return the asset path.
get_asset_uri()  : string
Return the asset URI.
get_asset_url()  : string
Return the asset URL (with version).
get_asset_version()  : string
Return the version.
get_style_tag()  : string
Create a stylesheet link tag.
add_image_sizes()  : void
Add custom image sizes.
filter_image_attributes()  : array<string|int, mixed>
Filter the image attributes.
ingredient_meta_data()  : void
Show ingredient meta data at top of post.
ingredient_columns()  : bool
Add generatepress column handling to ingredient custom post type.
print_cover_description()  : string
Maybe add description to print front pages.
print_cover_subtitle()  : string
Add subtitle to print front pages.
disable_lazy_load()  : array<string|int, mixed>
Disable lazy load on print images.
get_print_args()  : array<string|int, mixed>
Get arguments for the print page.
set_search_placeholder_text()  : string
Set search placeholder text.
enqueue_single_assets()  : void
Enqueue the scripts and styles for single posts.
filter_related_posts()  : array<string|int, mixed>
Filter the related posts query args to add related post list.
filter_query_loop_args()  : array<string|int, mixed>
Filter the selected query loop args for specific views.
filter_private_title()  : string
Filters the text prepended to the post title of private posts.
get_theme_metadata()  : string
Return a metadata value.
remove_admin_bar()  : void
Hide WordPress admin bar for all but administrator.
remove_image_nav()  : void
Remove #main anchor from attachment links.
theme_support()  : void
Override theme supported features.
post_type_support()  : void
Add feature support to post types.
title_separator()  : string
Set page title separator.
read_more_link()  : bool
Change the read more link to prevent scroll on target page.
disable_schema()  : bool
Override theme generated schema.
get_scroll_offset()  : int
Get the offset from top of page for smooth scroll.
filter_main_menu()  : array<string|int, mixed>
Filter the user's name into the "member" primary menu item.
filter_nutrition_label()  : array<string|int, string>
Filter the attributes of the nutrition label.
filter_private_notes()  : array<string|int, string>
Filter the attributes of the private notes.
filter_recipe_cook_mode()  : array<string|int, string>
Filter the attributes of the cook mode toggle.
filter_recipe_download_pdf()  : array<string|int, string>
Filter the attributes of the download PDF button.
filter_recipe_equipment()  : array<string|int, string>
Filter the attributes of the recipe equipment display.
filter_recipe_image()  : array<string|int, string>
Filter the attributes of the recipe image display.
filter_recipe_ingredients()  : array<string|int, string>
Filter the attributes of the recipe ingredients display.
filter_recipe_instructions()  : array<string|int, string>
Filter the attributes of the recipe instructions display.
filter_recipe_jump_to_comments()  : array<string|int, string>
Filter the attributes of the jump to comments button.
filter_recipe_jump()  : array<string|int, string>
Filter the attributes of the jump to recipe button.
filter_recipe_media_toggle()  : array<string|int, string>
Filter the attributes of the recipe media toggle.
filter_recipe_meta_container()  : array<string|int, string>
Filter the attributes of the recipe metadata container.
filter_recipe_name()  : array<string|int, string>
Filter the attributes of the recipe name display.
filter_recipe_notes()  : array<string|int, string>
Filter the attributes of the recipe notes.
filter_recipe_nutrition()  : array<string|int, string>
Filter the attributes of a single recipe nutrition field.
filter_recipe_print()  : array<string|int, string>
Filter the attributes of the recipe print button.
filter_recipe_rating()  : array<string|int, string>
Filter the attributes of the recipe rating display.
filter_recipe_servings()  : array<string|int, string>
Filter the attributes of the recipe ajustable servings.
filter_recipe_summary()  : array<string|int, string>
Filter the attributes of the recipe summary.
filter_recipe_tag()  : array<string|int, string>
Filter the attributes of the recipe tag container.
filter_recipe_time()  : array<string|int, string>
Filter the attributes of the recipe individual time container.
filter_recipe_unit_conversion()  : array<string|int, string>
Filter the attributes of the unit conversion control.
filter_icon_sources()  : array<string|int, mixed>
Filter the SVG icon sources.
filter_print_assets()  : array<string|int, mixed>
Filter the assets used for printing.
filter_public_script()  : array<string|int, mixed>
Filter the public js variables.
set_button_attributes()  : array<string|int, string>
Set the attributes of the template buttons.
set_label_attributes()  : array<string|int, string>
Set the attributes of the meta labels.
set_toggle_attributes()  : array<string|int, string>
Set the attributes of the toggle switches.
add_rankmath_hooks()  : void
Add the rankmath hooks.
modify_breadcrumb_html()  : string
Modify the breadcrumb HTML.
modify_toc_content()  : string
Modify the TOC HTML.

Constants

THEME_NAME

Define the theme name constant.

public mixed THEME_NAME = 'GP-cookbook'
Tags
since
6.1.0

Functions

add_course_filter()

Show a course filter on selected archive pages.

add_course_filter(WP_Term $archive_term) : void
Parameters
$archive_term : WP_Term

The archive term.

Tags
since
6.0.0
uses
Term_Archive::render_filter()

archive_redirect()

Redirect selected archive pages.

archive_redirect() : void
  • Redirect top level recipes category archive to content page.
Tags
since
5.0.0

modify_archive_title()

Remove prefix for taxonomy name from archive titles.

modify_archive_title(string $title, string $original_title, string $prefix) : string
  • Leave date and author prefixes unchanged.
Parameters
$title : string

Archive title.

$original_title : string

Archive title without prefix.

$prefix : string

Archive title prefix.

Tags
since
1.0.0
since
5.10.0

Expanded function signature to use improved parameters.

Return values
string

The (maybe) modified archive title.

set_excerpt()

Set excerpt if no custom excerpt.

set_excerpt(string $text, string $raw_excerpt) : string
  • If no explicit excerpt is set, generate an excerpt from the complete first paragraph of the content.
Parameters
$text : string

The trimmed text.

$raw_excerpt : string

The text prior to trimming.

Tags
since
5.9.0
Return values
string

The (maybe) modified excerpt.

register_scripts()

Register scripts.

register_scripts() : void
  • The asset must start with a leading slash. It is relative to the assets directory.
Tags
since
5.9.0
since
6.0.0

Change asset path, uri and version handling.

register_styles()

Register styles.

register_styles() : void
  • The asset must start with a leading slash. It is relative to the assets directory.
Tags
since
5.9.0
since
6.0.0

Change asset path, uri and version handling.

enqueue_assets()

Enqueue the scripts and styles.

enqueue_assets() : void
Tags
since
5.9.0
since
6.8.0

Improve recipe detection by looking for the WPRM recipe block.

since
6.8.0

Improve conditional block assets loading.

disable_child_theme_load()

Prevent generatepress from loading child theme stylesheet.

disable_child_theme_load() : bool
  • The stylesheet will have dependencies added and enqueued late in loadng process,
Tags
since
5.9.0
Return values
bool

get_asset_path()

Return the asset path.

get_asset_path(string $asset) : string
Parameters
$asset : string

The target asset.

Tags
since
6.0.0
Return values
string

The fully qualified filesystem path to the asset.

get_asset_uri()

Return the asset URI.

get_asset_uri(string $asset) : string
Parameters
$asset : string

The target asset.

Tags
since
6.0.0
Return values
string

The resource URI.

get_asset_url()

Return the asset URL (with version).

get_asset_url(string $asset) : string
Parameters
$asset : string

The target asset.

Tags
since
5.9.0
since
6.2.0

Simplify variables and url construction.

Return values
string

The resource URL including version info.

get_asset_version()

Return the version.

get_asset_version(string $asset_path) : string
Parameters
$asset_path : string

The fully qualified asset path.

Tags
since
5.9.0
since
6.0.0

Parameter changed to require the full path.

Return values
string

The resource version.

get_style_tag()

Create a stylesheet link tag.

get_style_tag(string $asset) : string
  • Allow direct loading of stylesheets where wp_enqueue is not used.
Parameters
$asset : string

The path of the stylesheet.

Tags
since
5.9.0
Return values
string

The link tag markup.

add_image_sizes()

Add custom image sizes.

add_image_sizes() : void

Add cropping to default medium image. Specify the size the 400px wide size. Add proportional size for medium images. Add 1160px wide 4x3 ratio for featured and in-post full-width images. Add 1160px wide proportional size for attachment pages.

Tags
since
1.3.0
since
6.0.0

Change image properties for new UI.

link
https://developer.wordpress.org/reference/hooks/after_setup_theme/
link
https://developer.wordpress.org/reference/functions/add_image_size/

filter_image_attributes()

Filter the image attributes.

filter_image_attributes(array<string|int, mixed> $attr, WP_Post $attachment, array<string|int, mixed>|string $size) : array<string|int, mixed>
Parameters
$attr : array<string|int, mixed>

Array of attribute values for the image markup, keyed by attribute name.

$attachment : WP_Post

Image attachment post.

$size : array<string|int, mixed>|string

Requested image size.

Tags
since
1.3.0
since
6.0.0

Change image properties for new UI.

link
https://developer.wordpress.org/reference/hooks/wp_get_attachment_image_attributes/
Return values
array<string|int, mixed>

The modified attribute values for markup.

print_cover_description()

Maybe add description to print front pages.

print_cover_description(string $description[, array<string|int, mixed> $args = array() ]) : string

Chooses the description to display determined by page content.

Parameters
$description : string

The page description to be filtered.

$args : array<string|int, mixed> = array()

Content arguments.

Tags
since
5.4.0
see
Printing::DEFAULT_PRINT_ARGS
Return values
string

The filtered description.

print_cover_subtitle()

Add subtitle to print front pages.

print_cover_subtitle(string $subtitle[, array<string|int, mixed> $args = array() ]) : string

Chooses the subtitle to display determined by content type.

Parameters
$subtitle : string

The page subtitle to be filtered.

$args : array<string|int, mixed> = array()

Content arguments.

Tags
since
5.3.0
see
Printing::DEFAULT_PRINT_ARGS
Return values
string

The filtered subtitle.

disable_lazy_load()

Disable lazy load on print images.

disable_lazy_load(array<string|int, mixed> $attr, WP_Post $attachment, array<string|int, mixed>|string $size) : array<string|int, mixed>
Parameters
$attr : array<string|int, mixed>

Array of attribute values for the image markup, keyed by attribute name.

$attachment : WP_Post

Image attachment post.

$size : array<string|int, mixed>|string

Requested image size.

Tags
since
6.0.0
link
https://developer.wordpress.org/reference/hooks/wp_get_attachment_image_attributes/
Return values
array<string|int, mixed>

The modified attribute values for markup.

set_search_placeholder_text()

Set search placeholder text.

set_search_placeholder_text() : string
Tags
since
1.0.0
Return values
string

Search placeholder text.

Filter the related posts query args to add related post list.

filter_related_posts(array<string|int, mixed> $qv, array<string|int, mixed> $attributes) : array<string|int, mixed>
Parameters
$qv : array<string|int, mixed>

The WP_Query args.

$attributes : array<string|int, mixed>

The Generateblocks Query Loop block attributes.

Tags
since
5.5.0
uses
Related_Posts::get_ids()
uses
Settings::get()
Return values
array<string|int, mixed>

The (maybe) modified query arguments.

filter_query_loop_args()

Filter the selected query loop args for specific views.

filter_query_loop_args(array<string|int, mixed> $qv, array<string|int, mixed> $attributes) : array<string|int, mixed>
Parameters
$qv : array<string|int, mixed>

The WP_Query args.

$attributes : array<string|int, mixed>

The Generateblocks Query Loop block attributes.

Tags
todo

#99 Change if/elseif to a switch statement in singular.php

since
5.6.0
uses
Highest_Rated::get_post_ids()
uses
Most_Viewed::get_post_ids()
uses
User_Favourites::get_post_ids()
Return values
array<string|int, mixed>

The (maybe) modified query arguments.

filter_private_title()

Filters the text prepended to the post title of private posts.

filter_private_title(string $prepend, WP_Post $post) : string
  • Single pages or posts have no prepended text.
  • Prepend a subscriber-only notice everywhere else.
Parameters
$prepend : string

Text displayed before the post title. Default 'Private: %s'.

$post : WP_Post

Current post object.

Tags
since
5.6.0
link
https://developer.wordpress.org/reference/hooks/private_title_format/
Return values
string

The (maybe) modified prepend string.

get_theme_metadata()

Return a metadata value.

get_theme_metadata(string $field) : string
Parameters
$field : string

The field to search for.

Tags
since
6.3.0
used-by
Updater::set_installed_info()
Return values
string

The metadata value.

Change the read more link to prevent scroll on target page.

read_more_link() : bool
Tags
since
1.0.0
Return values
bool

Scroll to link or not. Set to false.

disable_schema()

Override theme generated schema.

disable_schema() : bool
  • Now uses RankMath generated schema.
Tags
since
1.6.0
Return values
bool

get_scroll_offset()

Get the offset from top of page for smooth scroll.

get_scroll_offset() : int
Tags
since
6.0.0
Return values
int

The number of pixels to offset the scroll.

filter_main_menu()

Filter the user's name into the "member" primary menu item.

filter_main_menu(array<string|int, mixed> $sorted_menu_items, object $args) : array<string|int, mixed>
Parameters
$sorted_menu_items : array<string|int, mixed>

The menu items, sorted by each menu item’s menu order.

$args : object

An object containing the wp_nav_menu() arguments.

Tags
since
6.4.0
see
https://developer.wordpress.org/reference/hooks/wp_nav_menu_objects/
Return values
array<string|int, mixed>

The (maybe) modified menu items.

filter_nutrition_label()

Filter the attributes of the nutrition label.

filter_nutrition_label(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_private_notes()

Filter the attributes of the private notes.

filter_private_notes(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_cook_mode()

Filter the attributes of the cook mode toggle.

filter_recipe_cook_mode(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
6.5.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_download_pdf()

Filter the attributes of the download PDF button.

filter_recipe_download_pdf(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
6.5.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_equipment()

Filter the attributes of the recipe equipment display.

filter_recipe_equipment(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
  • The header and group tags that specify heading level MUST be set in HTML template. This allows different heading levels between print and display use cases.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_image()

Filter the attributes of the recipe image display.

filter_recipe_image(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
  • The image size MUST be declared in the HTML template.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.7.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_ingredients()

Filter the attributes of the recipe ingredients display.

filter_recipe_ingredients(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
  • The header and group tags that specify heading level MUST be set in HTML template. This allows different heading levels between print and display use cases.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_instructions()

Filter the attributes of the recipe instructions display.

filter_recipe_instructions(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
  • The header and group tags that specify heading level MUST be set in HTML template. This allows different heading levels between print and display use cases.
  • The associated ingredients setting MUST be set in the HTML template. Set 'ingredients_position' to 'none | after' to allow the template to determine the display of the associated ingredients list.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.7.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_jump_to_comments()

Filter the attributes of the jump to comments button.

filter_recipe_jump_to_comments(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_jump()

Filter the attributes of the jump to recipe button.

filter_recipe_jump(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_media_toggle()

Filter the attributes of the recipe media toggle.

filter_recipe_media_toggle(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_meta_container()

Filter the attributes of the recipe metadata container.

filter_recipe_meta_container(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_name()

Filter the attributes of the recipe name display.

filter_recipe_name(array<string|int, string> $attributes) : array<string|int, string>

Replaces the inline style attributes to allow site styles.

Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.7.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_notes()

Filter the attributes of the recipe notes.

filter_recipe_notes(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_nutrition()

Filter the attributes of a single recipe nutrition field.

filter_recipe_nutrition(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_print()

Filter the attributes of the recipe print button.

filter_recipe_print(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.6.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_rating()

Filter the attributes of the recipe rating display.

filter_recipe_rating(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_servings()

Filter the attributes of the recipe ajustable servings.

filter_recipe_servings(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.6.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_summary()

Filter the attributes of the recipe summary.

filter_recipe_summary(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_tag()

Filter the attributes of the recipe tag container.

filter_recipe_tag(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_time()

Filter the attributes of the recipe individual time container.

filter_recipe_time(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_recipe_unit_conversion()

Filter the attributes of the unit conversion control.

filter_recipe_unit_conversion(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

filter_icon_sources()

Filter the SVG icon sources.

filter_icon_sources(array<string|int, mixed> $sources) : array<string|int, mixed>
  • Add the pNet svg icon assets to default list.
Parameters
$sources : array<string|int, mixed>

The default sources.

Tags
since
5.9.0
uses
Icons::get_path()
uses
Icons::get_url()
Return values
array<string|int, mixed>

The modified sources.

filter_print_assets()

Filter the assets used for printing.

filter_print_assets(array<string|int, mixed> $output, array<string|int, mixed> $print_args) : array<string|int, mixed>
Parameters
$output : array<string|int, mixed>

The print output arguments.

$print_args : array<string|int, mixed>

The print arguments.

Tags
since
6.5.0
Return values
array<string|int, mixed>

The modified output arguments.

filter_public_script()

Filter the public js variables.

filter_public_script(array<string|int, mixed> $vars) : array<string|int, mixed>
Parameters
$vars : array<string|int, mixed>

The default variables.

Tags
since
5.9.0
Return values
array<string|int, mixed>

The modified variables.

set_button_attributes()

Set the attributes of the template buttons.

set_button_attributes(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

set_label_attributes()

Set the attributes of the meta labels.

set_label_attributes(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
5.9.0
Return values
array<string|int, string>

The modified attributes.

set_toggle_attributes()

Set the attributes of the toggle switches.

set_toggle_attributes(array<string|int, string> $attributes) : array<string|int, string>
  • Replaces inline style attributes to allow site styles.
Parameters
$attributes : array<string|int, string>

The shortcode attributes.

Tags
since
6.3.0
Return values
array<string|int, string>

The modified attributes.

modify_breadcrumb_html()

Modify the breadcrumb HTML.

modify_breadcrumb_html(string $html, array<string|int, mixed> $crumbs, object $breadcrumbs) : string
  • Remove the whitespace from the separator breadcrumb item.
Parameters
$html : string

The breadcrumb HTML.

$crumbs : array<string|int, mixed>

The breadcrumb items.

$breadcrumbs : object

The breadcrumbs object.

Tags
since
6.5.0
link
https://rankmath.com/docs/filters-and-hooks/frontend/breadcrumbs#4-filter-to-change-the-breadcrumb-html
Return values
string

The modified breadcrumb HTML content.

modify_toc_content()

Modify the TOC HTML.

modify_toc_content(string $block_content, array<string|int, mixed> $block, WP_Block $instance) : string
  • Add smooth-scroll class to list items.
Parameters
$block_content : string

The block content.

$block : array<string|int, mixed>

The full block, including name and attributes.

$instance : WP_Block

The instance of the rank-math/toc-block.

Tags
since
6.0.0
since
6.5.0

Improve li class pattern matching.

link
https://developer.wordpress.org/reference/hooks/render_block_this-name/
Return values
string

The modified TOC block HTML content.


        
On this page

Search results