pfeifferNet

website

Table of Contents

Classes

Updater
Theme updater.

Constants

THEME_NAME  = 'GP-pfeifferNet'
Define theme name constant.

Functions

modify_archive_order()  : void
Change sort order of archive pages where required.
modify_archive_title()  : string
Remove prefix for taxonomy name from archive titles.
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_version()  : string
Return the version.
enable_custom_image_template()  : void
Enable the custom template part on the image attachment page.
disable_image_template()  : bool
Disable the core template part on the image attachment page.
filter_author_interests()  : array<string|int, mixed>
Filter the author interests.
add_image_sizes()  : void
Add custom image sizes.
filter_image_attributes()  : array<string|int, mixed>
Filter the image attributes.
filter_private_title()  : string
Filters the text prepended to the post title of private posts.
set_search_placeholder_text()  : string
Set search placeholder text.
filter_related_posts()  : array<string|int, mixed>
Filter the related posts query args to add related post list.
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.
show_visual_format_excerpt()  : bool
Show excerpts for visual post formats.
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.
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 theme name constant.

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

Functions

modify_archive_title()

Remove prefix for taxonomy name from archive titles.

modify_archive_title(string $title, string $original_title, string $prefix) : string
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 updated parameters.

Return values
string

The (maybe) modified archive title.

register_styles()

Register styles.

register_styles() : void

The asset must start with a leading slash. It is relative to the assets directory.

Tags
since
6.0.0

enqueue_assets()

Enqueue the scripts and styles.

enqueue_assets() : void
Tags
since
5.9.0
since
6.0.0

Handling of dependencies and enqueue order moved to other functions.

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
6.0.0
Return values
bool

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.

uses
get_theme_metadata()
Return values
string

The resource version.

enable_custom_image_template()

Enable the custom template part on the image attachment page.

enable_custom_image_template(string $template) : void
Parameters
$template : string

Not used.

Tags
since
5.9.0

disable_image_template()

Disable the core template part on the image attachment page.

disable_image_template(bool $flag) : bool
Parameters
$flag : bool

Flag to determine use of standard template part.

Tags
since
5.9.0
Return values
bool

The (maybe) modified flag.

filter_author_interests()

Filter the author interests.

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

Filter on 'featured' posts to limit to the author.

Parameters
$qv : array<string|int, mixed>

The WP_Query args.

$attributes : array<string|int, mixed>

The Generateblock Query Loop block attributes.

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

The (maybe) modified query arguments.

add_image_sizes()

Add custom image sizes.

add_image_sizes() : void

Add cropping to default medium image. Specify the 400px wide 5x3 size. Add proportional size for medium images. Add 1160px wide 5x3 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.

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 member-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.

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.

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
get_asset_version()
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

show_visual_format_excerpt()

Show excerpts for visual post formats.

show_visual_format_excerpt(bool $show_excerpt) : bool
Parameters
$show_excerpt : bool

Boolean to show excerpts or not.

Tags
since
1.0.0
Return values
bool

The modifed value.

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.

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