Skip to content

Conversation

@huzaifaalmesbah
Copy link
Member

Description
Changes the priority of the get_the_archive_title filter in twentynineteen_get_the_archive_title from 10 to 1. This allows plugins and child themes to override the archive title using the default priority of 10, resolving conflict issues where the theme would forcefully overwrite plugin customizations.

This PR refreshes the initial patch provided by @mukesh27.

I tested the patch and confirmed that everything behaves as expected. The patch just needed a refresh, so I am submitting this PR to update the initial patch.

Tickets: https://core.trac.wordpress.org/ticket/45955

Steps to Reproduce

  1. Install and activate the Twenty Nineteen theme.
  2. Create and activate a helper plugin (or add to child theme's functions.php) with the following code to override the archive title at the default priority (10):
        <?php
        /**
         * Plugin Name: Test Trac 45955
         */
        
        function trac_test_archive_title( $title ) {
            return 'TEST PASSED: Plugin Override Successful';
        }
        add_filter( 'get_the_archive_title', 'trac_test_archive_title' );
  3. Visit any archive page on the frontend (e.g., a Category, Tag, or Author archive).
  4. Observe that the page title is NOT changed to "TEST PASSED...". It remains the default theme title (e.g., "Category Archives: ...").

Test Report

  1. Apply the patch.
  2. Visit the same archive page as above.
  3. Observe that the page title IS now changed to "TEST PASSED: Plugin Override Successful".
  4. This confirms the theme now allows plugins to override the title at the default priority.

Changes the priority of the default get_the_archive_title filter in Twenty Nineteen from 10 to 1. This allows plugins and child themes to override the title using the default priority of 10, instead of requiring a higher priority.

Props mukesh27.
Fixes #45955.
@github-actions
Copy link

github-actions bot commented Jan 14, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props huzaifaalmesbah, westonruter.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

return $title;
}
add_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title' );
add_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title', 1 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this change would also need to be applied to Twenty Twenty:

add_filter( 'get_the_archive_title', 'twentytwenty_get_the_archive_title' );

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add this also on Twenty Twenty latest commit.

@westonruter
Copy link
Member

Closing per https://core.trac.wordpress.org/ticket/45955#comment:7

Thank you for opening a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants