pfeifferNet

archives.php

Functions for archive pages display.

Tags
since
1.0.0
copyright

2024 Keith Pfeiffer

Table of Contents

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.

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.


        
On this page

Search results