PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.5
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.5
8.0.5 8.0.4 8.0.3 8.0.1 8.0.2 8.0.0 7.9.9.7 7.9.9.6 7.9.9.5 7.9.9.4 7.9.9.3 7.9.9.2 7.9.9.1 7.9.9 7.9.8 7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 7.9.0 7.8.9 7.8.8 All 47 releases
← All changes | integrations/youtube/includes/widgets/youtube-widget.php +42 -0 7.9.2 → 8.0.5 View file →
@@ -1,0 +1,42 @@
1 +<?php
2 +/**
3 + * Youtube Widget
4 + *
5 + * @package GamiPress\Widgets\Widget\Youtube
6 + * @author GamiPress <[email protected]>, Ruben Garcia <[email protected]>
7 + * @since 1.0.0
8 + */
9 +// Exit if accessed directly
10 +if( !defined( 'ABSPATH' ) ) exit;
11 +
12 +class GamiPress_Youtube_Widget extends GamiPress_Widget {
13 +
14 + public function __construct() {
15 +
16 + parent::__construct(
17 + 'gamipress_youtube_widget',
18 + __( 'GamiPress: Youtube', 'gamipress' ),
19 + __( 'Display a Youtube video.', 'gamipress' )
20 + );
21 +
22 + }
23 +
24 + public function get_fields() {
25 +
26 + return GamiPress()->shortcodes['gamipress_youtube']->fields;
27 +
28 + }
29 +
30 + public function get_widget( $args, $instance ) {
31 +
32 + echo gamipress_do_shortcode( 'gamipress_youtube', array(
33 + 'url' => $instance['url'],
34 + 'width' => $instance['width'],
35 + 'height' => $instance['height'],
36 + 'autoplay' => ( $instance['autoplay'] === 'on' ? 'yes' : 'no' ),
37 + 'controls' => ( $instance['controls'] === 'on' ? 'yes' : 'no' ),
38 + ) );
39 +
40 + }
41 +
42 +}