Repository navigation
Fix rtMedia Compatibility with Hello Elementor Theme - #2226
Merged
Merged
Conversation
Contributor
|
Unable to PHPCS or SVG scan one or more files due to error running PHPCS/SVG scanner:
The error may be temporary. If the error persists, please contact a human (commit-ID: d666f4e). |
NoumaanAhamed
marked this pull request as ready for review
December 1, 2025 07:22
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a compatibility issue where rtMedia pages display a 404 error when using Hello Elementor theme. The fix involves setting proper WordPress query flags (is_single and is_singular) to ensure themes recognize rtMedia pages as singular content.
- Set
is_singleandis_singularquery flags totruefor rtMedia pages - Enhanced FSE block theme support by adding
core/post-contentblock handling - Fixed typos and improved code documentation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nayemDevs
approved these changes
Dec 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where rtMedia Media tab show "The page can't be found" error when using Elementor's Hello theme.
Problem
When using Hello Elementor theme, visiting media pages (e.g.,
/members/admin/media/) displays a 404 error instead of the media gallery. This happens because Hello Elementor's minimal template structure checksis_singular()before loading the content template, and rtMedia wasn't setting this flag correctly.Solution
1. Set Correct Query Flags
Updated
rt_theme_compat_reset_post()inRTMediaRouter.phpto properly set WordPress query flags:This makes
is_singular()returntruefor rtMedia pages, allowing themes like Hello Elementor to load the correct template that callsthe_content().2. Enhanced FSE Block Support
Added support for
core/post-contentblock in addition tocore/post-template:This improves compatibility with FSE themes that use the post-content block in single templates.
Changes
app/main/routers/RTMediaRouter.phprt_theme_compat_reset_post(): Changedis_singlefromfalsetotrue, addedis_singularset totruert_replace_the_content_fse(): Addedcore/post-contentblock name checkTesting
Test Steps
/members/{username}/media/Related Issue
Fixes: #2225