Add AMP support for shortcodes and oEmbeds for Crowdsignal (Polldaddy)#11484
Conversation
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: April 2, 2019. |
modules/shortcodes/crowdsignal.php
Outdated
| * @param array $attr Shortcode attributes. | ||
| * @return string Embed. | ||
| */ | ||
| function crowdsignal_filter_amp_embed_oembed_html( $cache, $url, $attr ) { |
There was a problem hiding this comment.
This oEmbed filter should probably be kept in the AMP plugin since Crowdsignal is supported by core directly:
There was a problem hiding this comment.
Implemented now in ampproject/amp-wp#1929
kraftbj
left a comment
There was a problem hiding this comment.
Agree the oEmbed filter should remain in the AMP plugin since this is a core oembed.
modules/shortcodes/crowdsignal.php
Outdated
| * @param array $attr Shortcode attributes. | ||
| * @return string Embed. | ||
| */ | ||
| function crowdsignal_filter_amp_embed_oembed_html( $cache, $url, $attr ) { |
| $item_id = esc_js( $item_id ); | ||
|
|
||
| if ( $inline ) { | ||
| if ( Jetpack_AMP_Support::is_amp_request() ) { |
There was a problem hiding this comment.
Just a note that we'd need to add in support for this function before merging to WP.com.
There was a problem hiding this comment.
This would be handled by D22154-code .
* Initial Changelog for 7.2 * Testing list: add mention of IE11 testing * Initial Changelog for 7.2 * Testing list: add mention of IE11 testing * Add CL for #11224 * Add CL for #11426 * Add CL for #11442 * Add testing instructions for #11224 * Add CL for #11451 * Reclassify CL item * Add testing instructions for #11451 * Add CL for #11486 * Add CL for #11418 * Add CL for #11524 * Add CL and testing instructions for #11449 * Add CL for #11460 * Add CL for #11520 and #11582 * Add CL for #11531 * Add CL #11644 * Add testing instructions for #11644 * Add testing instructions for #11644 * Add CL for #11618 * Uniform changelog lines * CL #11679 * CL #11661 * CL #11654 * CL #11645 * CL #11643 * CL #11636 * CL #11635 and for other PHPCS commits * CL #11627 * CL #11626 * CL #11598 * CL #11596 * Remove nested items for shortcopy. I don't believe the detailed list is helpful * CL #11570 * CL #11569 * CL #11560 * CL #11558 * CL #11555 * CL #6704 * CL #11298 * CL #11324 * CL #11443 * CL #11484 * CL #11516 * CL #11529 * Expand Ads block enhancement CL item
This consolidates the logic for rendering AMP versions of Crowdsignal/Polldaddy polls and surveys from the AMP plugin. See ampproject/amp-wp#1929 for the code that this PR makes obsolete in the AMP plugin.
This PR also makes sure that a
titleshortcode attribute gets passed onto the rendered poll link on the frontend.I assume this code would also need to be copied into the Crowdsignal plugin.
See #9730.
Changes proposed in this Pull Request:
Testing instructions:
To test:
post_content.remove/bundled-polldaddybranch of the AMP plugin (see Add first-party support for Crowdsignal poll/survey oEmbeds ampproject/amp-wp#1929)Given this
post_content:The non-AMP version looks like this (note the first
crowdsignalshortcode poll fails to render for some reason):And here is the AMP version looks like:
Proposed changelog entry for your changes: