pfeifferNet

rank-math.php

Change rankmath functionality.

This file name, location and this method of registering hooks are recommended by RankMath.

  • Allow full comment reply-to URL parameters.
  • Modify the HTML of the table of contents block.
  • Modify the HTML of the breadcrumbs block.
Tags
since
6.0.0
link
https://rankmath.com/kb/filters-hooks-api-developer/
copyright

2025 Keith Pfeiffer

Table of Contents

Functions

add_rankmath_hooks()  : void
Add the rankmath hooks.
modify_breadcrumb_html()  : string
Modify the breadcrumb HTML.
modify_toc_content()  : string
Modify the TOC HTML.

Functions

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