Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process the shortcode in widget texts #101

Open
dd32 opened this issue May 11, 2020 · 0 comments
Open

Process the shortcode in widget texts #101

dd32 opened this issue May 11, 2020 · 0 comments

Comments

@dd32
Copy link
Member

dd32 commented May 11, 2020

r16032-dotorg:

Meetings: Add shortcode processing to text widgets
Index: includes/wporg-meeting-posttype.php
===================================================================
--- includes/wporg-meeting-posttype.php	(revision 16031)
+++ includes/wporg-meeting-posttype.php	(revision 16032)
@@ -34,6 +34,10 @@
 		add_action( 'admin_bar_menu',                     array( $mpt, 'add_edit_meetings_item_to_admin_bar' ), 80 );
 		add_action( 'wp_enqueue_scripts',                 array( $mpt, 'add_edit_meetings_icon_to_admin_bar' ) );
 		add_shortcode( 'meeting_time',                    array( $mpt, 'meeting_time_shortcode' ) );
+
+		// shortcodes aren't normally processed in widgets, add this to allow meeting_type in text widgets
+		// TODO make this more specific and only add this shortcode to widget processing
+		add_filter( 'widget_text', 'do_shortcode' );
 	}

 	public function meeting_column_width() { ?>

Related to https://wordpress.slack.com/archives/C02QB8GMM/p1589055772116000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant