Run Black Friday, Cyber Monday, or other flash sales on your WordPress-powered eCommerce or membership site with WooCommerce, Easy Digital Downloads, and Paid Memberships Pro.
[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Changes proposed in this Pull Request:
Starting the work to support more options for the shortcode and future block implementation to allow people to build the landing page in the editor.
Moved the logic to wrap the_content into a content filter vs. wrapping the shortcode output.
Now supporting in-post content like:
[sitewide_sales time_period="post-sale"]this is some content in the editor directly about the post sale[/sitewide_sales]
The content within a shortcode like this will not pull in the SWS CPT's content for that period.
or
[sitewide_sales time_period="pre-sale"]
The content within a shortcode like this will show the SWS CPT's content for that period.
The attribute for time_period still respects what the active sale's period is. So if you place a shortcode like:
[sitewide_sales time_period="pre-sale"]
In the post, that will not show if the sale is active in the sale period or after the sale.
These changes all still support the URL attribute for admin testing (swsales_preview_time_period).
I also reworked the logic to get the active sale ID to pull from post meta on the active post in the shortcode logic. We don't need to query posts since this is a post_meta value.
Other information:
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[x] Have you successfully run tests with your changes locally?
Changelog entry
ENHANCEMENT: Expanded possibilities for building the sale landing page within the post editor using the [sitewide_sales] shortcode as a wrapper and with the new attribute time_period.
All Submissions:
Changes proposed in this Pull Request:
Starting the work to support more options for the shortcode and future block implementation to allow people to build the landing page in the editor.
Moved the logic to wrap the_content into a content filter vs. wrapping the shortcode output.
Now supporting in-post content like:
[sitewide_sales time_period="post-sale"]this is some content in the editor directly about the post sale[/sitewide_sales]
The content within a shortcode like this will not pull in the SWS CPT's content for that period.or
[sitewide_sales time_period="pre-sale"]
The content within a shortcode like this will show the SWS CPT's content for that period.The attribute for time_period still respects what the active sale's period is. So if you place a shortcode like:
[sitewide_sales time_period="pre-sale"]
In the post, that will not show if the sale is active in the sale period or after the sale.
These changes all still support the URL attribute for admin testing (
swsales_preview_time_period
).I also reworked the logic to get the active sale ID to pull from post meta on the active post in the shortcode logic. We don't need to query posts since this is a post_meta value.
Other information:
Changelog entry
time_period
.