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

Fix conflict with Jetpack shortcodes and Sensei video #2426

Merged
merged 5 commits into from Feb 19, 2019

Conversation

Projects
None yet
3 participants
@donnapep
Copy link
Contributor

commented Feb 8, 2019

Fixes #2420.

The solution here was discussed with the Jetpack team. They recommended using the jetpack_shortcodes_to_include filter to turn off the Jetpack shortcodes for Vimeo and Youtube, which are video types both Sensei and Jetpack support.

Ideally, this code would only run for courses and lessons, but the plugins_loaded hook from which the filter fires seems too early to be able to determine the post type. Let me know if you've other ideas.

Testing

  1. Install Jetpack and connect to your WordPress.com account (you will not be able to do this locally).
  2. Add Vimeo embed code to the Video Embed Code field of a lesson and save.
  3. Refresh the page and ensure that the field has not changed to a shortcode.
  4. Browse to the lesson on the front-end and ensure the video is visible.
  5. Add Youtube embed code to the Course Video field of a course and save.
  6. Refresh the page and ensure that the field has not changed to a shortcode.
  7. Browse to the course on the front-end and ensure the video is visible.

@donnapep donnapep added this to the 2.0.0 milestone Feb 8, 2019

@donnapep donnapep self-assigned this Feb 8, 2019

@donnapep donnapep requested review from jom and alexsanford Feb 8, 2019

@jom
Copy link
Member

left a comment

This works well. We could move this into a new includes/3rd-party/jetpack.php file to start segregating third-party code, following what Alex has started in includes/3rd-party/woocommerce.php.

Show resolved Hide resolved includes/class-sensei.php Outdated

@donnapep donnapep force-pushed the fix/jetpack-and-video branch from a5b59d4 to 438db4e Feb 19, 2019

donnapep added some commits Feb 19, 2019

@jom

jom approved these changes Feb 19, 2019

Copy link
Member

left a comment

Looks good, works well! 💯

@donnapep donnapep merged commit 8fad0bf into release/2.0 Feb 19, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@donnapep donnapep deleted the fix/jetpack-and-video branch Feb 19, 2019

alexsanford added a commit that referenced this pull request Mar 25, 2019

Fix conflict with Jetpack shortcodes and Sensei video (#2426)
* Fix conflict with Jetpack shortcodes and Sensei video

* Fix linter issues

* Move Jetpack code to separate file

* Simplify remove of Jetpack shortcodes

* Rename function

@donnapep donnapep modified the milestones: 2.0.0, 1.12.3 Mar 27, 2019

@chvillanuevap

This comment has been minimized.

Copy link

commented Apr 6, 2019

Hi there!

I have multiple Vimeo videos inside the content of my lesson, as I like to have more than one video per lesson. This fix is removing the shortcodes, so now all of my videos are not showing up. I can fix this issue on my theme, but just thought to let you know in case other people experience the same issue. Maybe instead of removing the shortcodes, just prevent the Jetpack filters from being applied to the video custom field?

Thanks!

Hernan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.