Version Description
- Fixed notices on 404 page when debug mode is set to true
- Fixed blog posts page video background.
Download this release
Release Info
Developer | blakedotvegas |
Plugin | Video Background |
Version | 2.2.0 |
Comparing to | |
See all releases |
Code changes from version 2.1.4 to 2.2.0
- candide-vidbg.php +70 -50
- readme.txt +5 -1
candide-vidbg.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Video Background
|
|
4 |
Plugin URI: http://blake.vegas/plugins/video-background/
|
5 |
Description: jQuery WordPress plugin to easily assign a video background to any element. Awesome.
|
6 |
Author: Blake Wilson
|
7 |
-
Version: 2.
|
8 |
Author URI: http://blake.vegas
|
9 |
*/
|
10 |
|
@@ -21,7 +21,7 @@ add_action('admin_enqueue_scripts', 'vidbg_metabox_scripts');
|
|
21 |
* Enqueue vidbg jquery script
|
22 |
*/
|
23 |
function vidbg_jquery() {
|
24 |
-
wp_enqueue_script('vidbg-video-background', plugins_url('/js/jquery.vidbg-min.js', __FILE__), array('jquery'), '2.
|
25 |
}
|
26 |
add_action('wp_footer', 'vidbg_jquery' );
|
27 |
|
@@ -154,7 +154,7 @@ function vidbg_meta_box_save( $post_id )
|
|
154 |
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;
|
155 |
|
156 |
// if our current user can't edit this post, bail
|
157 |
-
if( !current_user_can( '
|
158 |
|
159 |
// now we can actually save the data
|
160 |
$allowed = array(
|
@@ -190,59 +190,79 @@ function vidbg_meta_box_save( $post_id )
|
|
190 |
* Add inline javascript to footer for video background
|
191 |
*/
|
192 |
function vidbg_initialize_footer() {
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
});
|
214 |
-
|
215 |
-
|
216 |
-
<?php
|
217 |
-
|
218 |
-
jQuery(function($) {
|
219 |
-
$( "<div class='vidbg-overlay'></div>" ).insertAfter( $( ".vidbg-container > video" ) );
|
220 |
-
});
|
221 |
-
</script>
|
222 |
-
<?php endif; ?>
|
223 |
-
<?php }
|
224 |
add_action( 'wp_footer', 'vidbg_initialize_footer' );
|
225 |
|
226 |
/**
|
227 |
* Add overlay css to header
|
228 |
*/
|
229 |
-
function vidbg_initialize_header() {
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
add_action( 'wp_head', 'vidbg_initialize_header' );
|
247 |
|
248 |
/**
|
4 |
Plugin URI: http://blake.vegas/plugins/video-background/
|
5 |
Description: jQuery WordPress plugin to easily assign a video background to any element. Awesome.
|
6 |
Author: Blake Wilson
|
7 |
+
Version: 2.2.0
|
8 |
Author URI: http://blake.vegas
|
9 |
*/
|
10 |
|
21 |
* Enqueue vidbg jquery script
|
22 |
*/
|
23 |
function vidbg_jquery() {
|
24 |
+
wp_enqueue_script('vidbg-video-background', plugins_url('/js/jquery.vidbg-min.js', __FILE__), array('jquery'), '2.2.0', true);
|
25 |
}
|
26 |
add_action('wp_footer', 'vidbg_jquery' );
|
27 |
|
154 |
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;
|
155 |
|
156 |
// if our current user can't edit this post, bail
|
157 |
+
if( !current_user_can( 'edit_posts' ) ) return;
|
158 |
|
159 |
// now we can actually save the data
|
160 |
$allowed = array(
|
190 |
* Add inline javascript to footer for video background
|
191 |
*/
|
192 |
function vidbg_initialize_footer() {
|
193 |
+
if(is_page() || is_single() || is_home()) {
|
194 |
+
if(is_page() || is_single()) {
|
195 |
+
global $post;
|
196 |
+
$container_field = get_post_meta( $post->ID, 'vidbg_metabox_field_container', true );
|
197 |
+
$mp4_field = get_post_meta( $post->ID, 'vidbg_metabox_field_mp4', true );
|
198 |
+
$webm_field = get_post_meta( $post->ID, 'vidbg_metabox_field_webm', true );
|
199 |
+
$poster_field = get_post_meta( $post->ID, 'vidbg_metabox_field_poster', true );
|
200 |
+
$pattern_overlay = get_post_meta( $post->ID, 'vidbg_metabox_field_overlay', true );
|
201 |
+
$no_loop_field = get_post_meta( $post->ID, 'vidbg_metabox_field_no_loop', true );
|
202 |
+
$unmute_field = get_post_meta( $post->ID, 'vidbg_metabox_field_unmute', true );
|
203 |
+
} elseif (is_home()) {
|
204 |
+
$page_object = get_queried_object();
|
205 |
+
$container_field = get_post_meta( $page_object->ID, 'vidbg_metabox_field_container', true );
|
206 |
+
$mp4_field = get_post_meta( $page_object->ID, 'vidbg_metabox_field_mp4', true );
|
207 |
+
$webm_field = get_post_meta( $page_object->ID, 'vidbg_metabox_field_webm', true );
|
208 |
+
$poster_field = get_post_meta( $page_object->ID, 'vidbg_metabox_field_poster', true );
|
209 |
+
$pattern_overlay = get_post_meta( $page_object->ID, 'vidbg_metabox_field_overlay', true );
|
210 |
+
$no_loop_field = get_post_meta( $page_object->ID, 'vidbg_metabox_field_no_loop', true );
|
211 |
+
$unmute_field = get_post_meta( $page_object->ID, 'vidbg_metabox_field_unmute', true );
|
212 |
+
} ?>
|
213 |
+
<?php if($container_field): ?>
|
214 |
+
<script type="text/javascript">
|
215 |
+
jQuery(function($){
|
216 |
+
$('<?php echo $container_field; ?>').vidbg({
|
217 |
+
'mp4': '<?php echo $mp4_field; ?>',
|
218 |
+
'webm': '<?php echo $webm_field; ?>',
|
219 |
+
'poster': '<?php echo $poster_field; ?>',
|
220 |
+
}, {
|
221 |
+
// Options
|
222 |
+
muted: <?php if($unmute_field == 'on'): ?>false<?php else: ?>true<?php endif; ?>,
|
223 |
+
loop: <?php if($no_loop_field == 'on'): ?>false<?php else: ?>true<?php endif; ?>,
|
224 |
+
});
|
225 |
+
});
|
226 |
+
</script>
|
227 |
+
<?php endif; ?>
|
228 |
+
<?php if($pattern_overlay == 'on'): ?>
|
229 |
+
<script type="text/javascript">
|
230 |
+
jQuery(function($) {
|
231 |
+
$( "<div class='vidbg-overlay'></div>" ).insertAfter( $( ".vidbg-container > video" ) );
|
232 |
});
|
233 |
+
</script>
|
234 |
+
<?php endif; ?>
|
235 |
+
<?php }
|
236 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
add_action( 'wp_footer', 'vidbg_initialize_footer' );
|
238 |
|
239 |
/**
|
240 |
* Add overlay css to header
|
241 |
*/
|
242 |
+
function vidbg_initialize_header() {
|
243 |
+
if(is_page() || is_single() || is_home()) {
|
244 |
+
if(is_page() || is_single()) {
|
245 |
+
global $post;
|
246 |
+
$pattern_overlay = get_post_meta( $post->ID, 'vidbg_metabox_field_overlay', true );
|
247 |
+
} elseif (is_home()) {
|
248 |
+
$page_object = get_queried_object();
|
249 |
+
$pattern_overlay = get_post_meta( $page_object->ID, 'vidbg_metabox_field_overlay', true );
|
250 |
+
} ?>
|
251 |
+
<?php if($pattern_overlay == 'on'): ?>
|
252 |
+
<style>
|
253 |
+
.vidbg-overlay {
|
254 |
+
background: url("<?php echo plugins_url( 'images/overlay.png', __FILE__ ); ?>") repeat;
|
255 |
+
position: absolute;
|
256 |
+
top:0;
|
257 |
+
right:0;
|
258 |
+
left:0;
|
259 |
+
bottom:0;
|
260 |
+
z-index: -1;
|
261 |
+
}
|
262 |
+
</style>
|
263 |
+
<?php endif; ?>
|
264 |
+
<?php }
|
265 |
+
}
|
266 |
add_action( 'wp_head', 'vidbg_initialize_header' );
|
267 |
|
268 |
/**
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://blake.vegas/plugins/video-background/
|
|
4 |
Tags: html5, video background, mp4, webm, responsive, shortcode, overlay, fullscreen background, fullscreen, html5 video background, metabox, blake vegas, loop, mute, unmute
|
5 |
Requires at least: 3.2
|
6 |
Tested up to: 4.3.1
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -73,6 +73,10 @@ To add a video background to a class called **header** add ".header" to the cont
|
|
73 |
|
74 |
== Changelog ==
|
75 |
|
|
|
|
|
|
|
|
|
76 |
= 2.1.4 =
|
77 |
* Added toggle loop
|
78 |
* Added toggle mute
|
4 |
Tags: html5, video background, mp4, webm, responsive, shortcode, overlay, fullscreen background, fullscreen, html5 video background, metabox, blake vegas, loop, mute, unmute
|
5 |
Requires at least: 3.2
|
6 |
Tested up to: 4.3.1
|
7 |
+
Stable tag: 2.2.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
73 |
|
74 |
== Changelog ==
|
75 |
|
76 |
+
= 2.2.0 =
|
77 |
+
* Fixed notices on 404 page when debug mode is set to true
|
78 |
+
* Fixed blog posts page video background.
|
79 |
+
|
80 |
= 2.1.4 =
|
81 |
* Added toggle loop
|
82 |
* Added toggle mute
|