diff --git a/modules/shortcodes/crowdsignal.php b/modules/shortcodes/crowdsignal.php index 04177919be00a..0e9f83726cfb9 100644 --- a/modules/shortcodes/crowdsignal.php +++ b/modules/shortcodes/crowdsignal.php @@ -443,6 +443,15 @@ class_exists( 'Jetpack_AMP_Support' ) ) ); + /** + * Hook into the Crowdsignal shortcode before rendering. + * + * @since 8.4.0 + * + * @param int $poll Poll ID. + */ + do_action( 'crowdsignal_shortcode_before', intval( $poll ) ); + return sprintf( '
', absint( $poll ), @@ -464,6 +473,9 @@ class_exists( 'Jetpack_AMP_Support' ) true ); + /** This action is already documented in modules/shortcodes/crowdsignal.php */ + do_action( 'crowdsignal_shortcode_before', intval( $poll ) ); + return sprintf( '
', absint( $poll ), @@ -729,7 +741,7 @@ public function crowdsignal_shortcode_infinite() { if ( ! function_exists( 'crowdsignal_link' ) ) { /** - * Replace link by embed. + * Replace link with shortcode. * Example: http://polldaddy.com/poll/1562975/?view=results&msg=voted * * @param string $content Post content. @@ -744,9 +756,8 @@ class_exists( 'Jetpack_AMP_Support' ) return jetpack_preg_replace_outside_tags( '!(?:\n|\A)https?://(polldaddy\.com/poll|poll\.fm)/([0-9]+?)(/.*)?(?:\n|\Z)!i', - "\n\n", // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript - $content, - 'polldaddy.com/poll' + '[crowdsignal poll=$2]', + $content ); }