MarcusJeitler
Forum Replies Created
-
Forum: Plugins
In reply to: [Theater for WordPress] List production filtered by start / end of eventsI registered a new shortcode in the plugin extension class that will be used as extension to the wpt_productions shortcode. After thinking about various approaches it seems that the easiest is to do something like this:
$productions = $wp_theatre->productions->load($production_filters); $html = ''; foreach ($productions as $production){ foreach($production->events($event_filters) as $event){ $html.=$production->html($production_args); } } return $html;While this fulfills my needs I am not completely satisfied as it changes the original behavior of the [wpt_productions] shortcode. A non intrusive solution would require an apply_filters hook for the return statement of the WPT_Productions::load function. Or is there a way I can implement this myself without that hook?
—
If someone wants to have a look at the production & event data directly, the following query fetches all production posts with the corresponding event data:
SELECT p.ID, p.post_type, p.post_title, wpt_event_key.post_id as "event_id", wpt_event.meta_key AS "event_meta_key", wpt_event.meta_value AS "event_meta_value" FROM wp_posts p JOIN wp_postmeta wpt_event_key ON wpt_event_key.meta_key = 'wp_theatre_prod' AND wpt_event_key.meta_value = p.ID JOIN wp_postmeta wpt_event ON wpt_event.post_id = wpt_event_key.post_id WHERE p.post_type = "wp_theatre_prod" ;Forum: Plugins
In reply to: [Theater for WordPress] List production filtered by start / end of eventsI found your plugin extension example in the README file. Seems to be the right approach for this problem