Beispiel #1
0
 /**
  * Default settings for video embeds. Can be altered on a per video basis
  * using video embed URL arguments.
  *
  * @since 1.4
  */
 public function arguments()
 {
     $options = get_option('fvp-settings');
     $args = !empty($options['default_args']) ? $options['default_args'] : array();
     $vimeo = !empty($args['vimeo']) ? $args['vimeo'] : array();
     $youtube = !empty($args['youtube']) ? $args['youtube'] : array();
     $dailymotion = !empty($args['dailymotion']) ? $args['dailymotion'] : array();
     echo FVP_HTML::tabbed(array('general' => array(FVP_HTML::description(esc_html__('Not all of the following options might be supported by all providers.', 'featured-video-plus')), FVP_HTML::checkboxes('fvp-settings[default_args][general]', array('autoplay' => esc_html__('Autoplay', 'featured-video-plus'), 'loop' => esc_html__('Loop', 'featured-video-plus')), !empty($args['general']) ? $args['general'] : array())), 'vimeo' => array(FVP_HTML::description(esc_html__('If the owner of a video is a Plus member, some of these settings may be overridden by their preferences.', 'featured-video-plus')), FVP_HTML::colorpicker('Color', 'fvp-settings[default_args][vimeo][color]', !empty($vimeo['color']) ? $vimeo['color'] : null), FVP_HTML::checkboxes('fvp-settings[default_args][vimeo]', array('portrait' => array('value' => '0', 'label' => esc_html__("Hide user's portrait", 'featured-video-plus')), 'title' => array('value' => '0', 'label' => esc_html__('Hide video title', 'featured-video-plus')), 'byline' => array('value' => '0', 'label' => esc_html__('Hide video byline', 'featured-video-plus'))), $vimeo)), 'youtube' => array(FVP_HTML::checkboxes('fvp-settings[default_args][youtube]', array('theme' => array('value' => 'light', 'label' => esc_html__('Light theme', 'featured-video-plus')), 'color' => array('value' => 'white', 'label' => esc_html__('White highlight color', 'featured-video-plus')), 'modestbranding' => esc_html__('Hide YouTube logo', 'featured-video-plus'), 'rel' => array('value' => '0', 'label' => esc_html__('Hide related videos', 'featured-video-plus')), 'fs' => array('value' => '0', 'label' => esc_html__('Disallow fullscreen', 'featured-video-plus')), 'showinfo' => array('value' => '0', 'label' => esc_html__('Hide video info', 'featured-video-plus')), 'enablejsapi' => esc_html__('Enable JavaScript API', 'featured-video-plus')), $youtube)), 'dailymotion' => array(FVP_HTML::colorpicker('Foreground color', 'fvp-settings[default_args][dailymotion][foreground]', !empty($dailymotion['foreground']) ? $dailymotion['foreground'] : null), FVP_HTML::colorpicker('Background color', 'fvp-settings[default_args][dailymotion][background]', !empty($dailymotion['background']) ? $dailymotion['background'] : null), FVP_HTML::colorpicker('Highlight color', 'fvp-settings[default_args][dailymotion][highlight]', !empty($dailymotion['highlight']) ? $dailymotion['highlight'] : null), FVP_HTML::labeled_input('Syndication-Key', 'fvp-settings[default_args][dailymotion][syndication]', !empty($dailymotion['syndication']) ? $dailymotion['syndication'] : null), FVP_HTML::checkboxes('fvp-settings[default_args][dailymotion]', array('logo' => array('value' => '0', 'label' => esc_html__('Hide DailyMotion logo', 'featured-video-plus')), 'info' => array('value' => '0', 'label' => esc_html__('Hide video info', 'featured-video-plus')), 'related' => array('value' => '0', 'label' => esc_html__('Hide related videos', 'featured-video-plus')), 'quality' => array('value' => 1080, 'label' => esc_html__('Turn HD on by default', 'featured-video-plus'))), $dailymotion))));
 }
 /**
  * Default settings for video embeds. Can be altered on a per video basis
  * using video embed URL arguments.
  *
  * @since 1.4
  */
 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();
     $dailymotion = !empty($args['dailymotion']) ? $args['dailymotion'] : array();
     echo FVP_HTML::tabbed(array('general' => array(FVP_HTML::description(esc_html__('Not all of the following options might be supported by all providers.', 'featured-video-plus')), FVP_HTML::checkboxes('fvp-settings[default_args][general]', array('loop' => esc_html__('Loop', 'featured-video-plus')), !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('lazy' => esc_html__('... lazy loading videos.', 'featured-video-plus'), 'single' => sprintf(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($autoplay) ? $autoplay : array())), 'vimeo' => array(FVP_HTML::description(esc_html__('If the owner of a video is a Plus member, some of these settings may be overridden by their preferences.', 'featured-video-plus')), FVP_HTML::colorpicker('Color', 'fvp-settings[default_args][vimeo][color]', !empty($vimeo['color']) ? $vimeo['color'] : null), FVP_HTML::checkboxes('fvp-settings[default_args][vimeo]', array('portrait' => array('value' => '0', 'label' => esc_html__("Hide user's portrait", 'featured-video-plus')), 'title' => array('value' => '0', 'label' => esc_html__('Hide video title', 'featured-video-plus')), 'byline' => array('value' => '0', 'label' => esc_html__('Hide video byline', 'featured-video-plus'))), $vimeo)), 'youtube' => array(FVP_HTML::checkboxes('fvp-settings[default_args][youtube]', array('theme' => array('value' => 'light', 'label' => esc_html__('Light theme', 'featured-video-plus')), 'color' => array('value' => 'white', 'label' => esc_html__('White highlight color', 'featured-video-plus')), 'modestbranding' => esc_html__('Hide YouTube logo', 'featured-video-plus'), 'iv_load_policy' => array('value' => '3', 'label' => esc_html__('Hide annotations', 'featured-video-plus')), 'rel' => array('value' => '0', 'label' => esc_html__('Hide related videos', 'featured-video-plus')), 'fs' => array('value' => '0', 'label' => esc_html__('Disallow fullscreen', 'featured-video-plus')), 'showinfo' => array('value' => '0', 'label' => esc_html__('Hide video info', 'featured-video-plus')), 'enablejsapi' => esc_html__('Enable JavaScript API', 'featured-video-plus')), $youtube)), 'dailymotion' => array(FVP_HTML::colorpicker('Foreground color', 'fvp-settings[default_args][dailymotion][foreground]', !empty($dailymotion['foreground']) ? $dailymotion['foreground'] : null), FVP_HTML::colorpicker('Background color', 'fvp-settings[default_args][dailymotion][background]', !empty($dailymotion['background']) ? $dailymotion['background'] : null), FVP_HTML::colorpicker('Highlight color', 'fvp-settings[default_args][dailymotion][highlight]', !empty($dailymotion['highlight']) ? $dailymotion['highlight'] : null), FVP_HTML::labeled_input('Syndication-Key', 'fvp-settings[default_args][dailymotion][syndication]', !empty($dailymotion['syndication']) ? $dailymotion['syndication'] : null), FVP_HTML::checkboxes('fvp-settings[default_args][dailymotion]', array('logo' => array('value' => '0', 'label' => esc_html__('Hide DailyMotion logo', 'featured-video-plus')), 'info' => array('value' => '0', 'label' => esc_html__('Hide video info', 'featured-video-plus')), 'related' => array('value' => '0', 'label' => esc_html__('Hide related videos', 'featured-video-plus')), 'quality' => array('value' => 1080, 'label' => esc_html__('Turn HD on by default', 'featured-video-plus'))), $dailymotion))));
 }