Opened 4 years ago
Closed 4 years ago
#8350 closed enhancement (fixed)
Support extra $args in `load_template()`
Reported by: | dcavins | Owned by: | dcavins |
---|---|---|---|
Milestone: | 7.0.0 | Priority: | normal |
Severity: | normal | Version: | 6.2.0 |
Component: | Core | Keywords: | has-patch commit |
Cc: | dcavins |
Description
Thanks to some changes in WP 5.5 (https://make.wordpress.org/core/2020/07/17/passing-arguments-to-template-files-in-wordpress-5-5/), it's now possible to pass extra arguments to a template file. We use load_template()
(https://developer.wordpress.org/reference/functions/load_template/) in bp_locate_template()
, and the attached patch supports the passing of an extra $args
parameter through our template functions to load_template()
.
Attachments (3)
Change History (8)
#1
@
4 years ago
- Milestone changed from Awaiting Review to 7.0.0
That’s a really great idea 💡 👌!
Thanks for thinking about it 😍
#2
follow-up:
↓ 3
@
4 years ago
- Keywords commit added
Hi @dcavins patch looks good, I just suggested to also add the $args argument to bp_buffer_template_part
and I've added a unit test about it.
#3
in reply to:
↑ 2
@
4 years ago
Replying to imath:
Hi @dcavins patch looks good, I just suggested to also add the $args argument to
bp_buffer_template_part
and I've added a unit test about it.
Fantastic! Great addition and the unit test is clever!
One comment: Can we mark this test as only applying to WP >=5.5? I'm afraid that Travis's test matrix would fail it because it won't work in WP 5.4 and below.
Support the passing of an extra $args parameter through our template functions to
load_template()
.