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
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
add_rankmath_hooks()
Add the rankmath hooks.
add_rankmath_hooks() : void
- This approach is recommended by RankMath.
Tags
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
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
Return values
string —The modified TOC block HTML content.