Scope list/box layout per listing when multiple shortcodes share a page#2127
Open
oduppinsjr wants to merge 4 commits intowpeventmanager:masterfrom
Open
Scope list/box layout per listing when multiple shortcodes share a page#2127oduppinsjr wants to merge 4 commits intowpeventmanager:masterfrom
oduppinsjr wants to merge 4 commits intowpeventmanager:masterfrom
Conversation
- Wrap each listing block in .wpem-event-listing-instance with a stable layout_instance id (shortcode attribute) or sensible defaults - Store layout preference in localStorage per instance (wpem_layout_inst_*) with fallback to the legacy global layout key - Remove duplicate fixed IDs from layout toggle controls; scope JS to the nearest instance container - Give each listing view container a unique id for markup validity - Update upcoming events AJAX to target listings inside #upcoming_event_listing - Register layout_instance in WPML config for the [events] shortcode Made-with: Cursor
- Add listing instance stack backed by a static array via wpem_listing_instance_stack_ref() - Move wrapper/title/listing-view markup to escaped echo helpers - Fix title output (esc_html via wpem_echo_listing_section_title) - content-event-listing.js: double-quoted strings, /* global */, split layout helpers to reduce complexity, local i18n alias for daterangepicker Made-with: Cursor
…6 style - Replace echo/exit in listing-instance-stack with return + return (ABSPATH) - Add wpem_listing_instance_markup_kses_allowed for wp_kses on fragments - Load stack include via relative include() like sibling files - JS: remove jQuery global, window.* for localized strings, method shorthand, resolveLayoutKey + applyLayoutToSingleInstance to lower complexity, buildDateRangePickerOptions for daterangepicker config Made-with: Cursor
…r markup - Output listing title with esc_html() directly in the template (WordPress XSS) - Replace echo wp_kses(...) with <?= wp_kses(...) ?> for listing wrappers - Merge listing instance stack helpers into wp-event-manager-filters.php and remove separate include from wp-event-manager.php (no extra include file) Made-with: Cursor
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.
Problem
Using upcoming_events and past_events (or multiple events blocks) on one page shared one localStorage key and global jQuery selectors, so toggling list/box view in one block mirrored the other.
Solution
Files
Templates, shortcodes, content-event-listing.js (+ min), event-ajax-filters.js (+ min), wpml-config.xml.