Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Use Instagram API oEmbed endpoint to get embed HTML #164

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

montchr
Copy link
Contributor

@montchr montchr commented Dec 10, 2015

#162

Based on the approach utilized by Jetpack.

TODO

  • Cache API response
  • Fix broken hidecaption attribute
  • Fix tests

@montchr
Copy link
Contributor Author

montchr commented Dec 11, 2015

Not sure why hidecaption isn't present in $attrs, as I believe I have it implemented the same way as checkboxes on other shortcodes. Might be related to wp-shortcake/shortcake#564? I'll come back to this after working on caching.

@montchr
Copy link
Contributor Author

montchr commented Dec 11, 2015

Okay, I have a cached implementation ready for review. It uses wp_oembed_get(), which means that it won't work with the shortcodes that aren't listed as default providers in WP, unless we filter oembed_providers.

@montchr
Copy link
Contributor Author

montchr commented Dec 11, 2015

With 9fe321e, hidecaption is now present in shortcode, but it has no effect on the oEmbed response. Looking into it.

Chris Montgomery added 3 commits December 11, 2015 13:47
The URL used in some of the tests would not resolve. I copied the ID of
one of the working URLs used in another test and replaced the broken
ones.
@montchr montchr changed the title WIP: Use Instagram API oEmbed endpoint to get embed HTML Use Instagram API oEmbed endpoint to get embed HTML Dec 14, 2015
*/
protected static function get_oembed_html( $url, $args = array() ) {
global $post;
$post_id = $post->ID;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the global $post isn't working in unit tests. Any suggestions?

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

Successfully merging this pull request may close these issues.

1 participant