Skip to content

Commit

Permalink
Revamp autoplay options.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoereth committed Jul 20, 2015
1 parent 1d81ecc commit 9640904
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions php/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ public function alignment() {
*/
public function arguments() {
$options = get_option( 'fvp-settings' );
$autoplay = ! empty( $options['autoplay'] ) ? $options['autoplay'] : array();
$args = ! empty( $options['default_args'] ) ? $options['default_args'] : array();
$vimeo = ! empty( $args['vimeo'] ) ? $args['vimeo'] : array();
$youtube = ! empty( $args['youtube'] ) ? $args['youtube'] : array();
Expand All @@ -353,17 +354,24 @@ public function arguments() {
),
! empty( $args['general'] ) ? $args['general'] : array()
),
FVP_HTML::radios(
'fvp-settings[autoplay][always]',
array(
'1' => esc_html__( 'Always autoplay.', 'featured-video-plus' ),
'0' => esc_html__( 'Autoplay when...', 'featured-video-plus' ),
),
! empty( $autoplay['always'] ) ? $autoplay['always'] : '0'
),
FVP_HTML::checkboxes(
'fvp-settings[autoplay]',
array(
'always' => esc_html__( 'Always autoplay.', 'featured-video-plus' ),
'lazy' => esc_html__( 'Autoplay when lazy loading.', 'featured-video-plus' ),
'lazy' => esc_html__( '... lazy loading videos.', 'featured-video-plus' ),
'single' => sprintf(
esc_html__( 'Autoplay when viewing %ssingle%s posts and pages.', 'featured-video-plus' ),
esc_html__( '... viewing %ssingle%s posts and pages.', 'featured-video-plus' ),
'<a href="http://codex.wordpress.org/Function_Reference/is_single" target="_blank">', '</a>'
),
),
! empty( $options['autoplay'] ) ? $options['autoplay'] : array()
! empty( $autoplay ) ? $autoplay : array()
)
),

Expand Down

0 comments on commit 9640904

Please sign in to comment.