Skip to content

Instantly share code, notes, and snippets.

View foliovision's full-sized avatar

Alec Kinnear foliovision

View GitHub Profile
@foliovision
foliovision / wp_is_mobile-wp-rocket.php
Created February 20, 2020 14:07
Make wp_is_mobile() use WP Rocket mobile detection
<?php
/*
Core WordPress function wp_is_mobile() detects iPad as mobile, so we filter it and use WP Rocket mobile detection
*/
add_filter( 'wp_is_mobile', 'fv_bra_wp_is_mobile' );
function fv_bra_wp_is_mobile( $is_mobile ) {
if ( class_exists( 'Rocket_Mobile_Detect' ) ) {
$detect = new Rocket_Mobile_Detect();
var player = jQuery('<div id="background-video"></div>');
jQuery('#wp-custom-header').append(player);
player.flowplayer( {
autoplay: true,
disabled: true,
loop: true,
clip:
{
"sources": [
{ src: "https://s3-eu-west-1.amazonaws.com/fv-player-unprotected/dominika-960-31_HD.mp4", type: "video/mp4" }
@foliovision
foliovision / fv-player-custom-cdn.php
Created May 5, 2021 21:06
Add another CDN for FV Player Pro with custom URL token generator
<?php
/*
Plugin Name: FV Player Pro - Custom CDN
Description: Add Settings -> FV Player Pro -> Hosting -> BunnyCDN Extended which signs the URLs for use in SK and US countries only.
Author: Foliovision
Version: 0.1
*/
add_action( 'plugins_loaded', 'fv_player_custom_cdn_load', 0 );
@foliovision
foliovision / fv-player-handle-video-tags.php
Last active May 10, 2021 09:47
FV Player Bridge for HTML video tags
<?php
/*
Plugin Name: FV Player - Handle video tags
Description: Changes any <video> tag to FV Player
Author: Foliovision
Version: 0.2
Author URI: https://foliovision.com
*/
@foliovision
foliovision / fv-player-memberpress-courses-fix.php
Last active March 31, 2022 14:44
FV Player - fix for MemberPress Courses as it doesn't run with wp_footer()
<?php
/*
* Plugin Name: FV Player - MemberPress Courses fix
* Version: 0.2
* Description: Since memberpress-courses/app/views/classroom/courses_footer.php doesn't contain wp_footer hook we have to provide an alternative way of loading FV Player scripts. Here's another description of the issue: https://blog.calendarscripts.info/watu-watupro-and-memberpress-temporary-solution-to-an-issue/
* Author: Foliovision
* Author URI: https://foliovision.com
*/