PluginProbe
Super RSS Reader – Add attractive RSS Feed Widget / 5.2
Super RSS Reader – Add attractive RSS Feed Widget v5.2
trunk 0.8 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 3.0 3.1 3.2 4.0 4.0.1 4.1 4.2 4.3 4.4 4.4.1 4.5 4.6 4.7 4.8 All 33 releases
super-rss-reader / includes / widget.php

widget.php in Super RSS Reader – Add attractive RSS Feed Widget 5.2, at includes/widget.php

63 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Contains the widget admin and its registration
4 *
5 */
6
7 if( ! defined( 'ABSPATH' ) ) exit;
8
9 class SRR_Widget{
10
11 public static function init(){
12
13 add_action( 'widgets_init', array( __CLASS__, 'init_widget' ) );
14
15 add_action( 'wp_enqueue_scripts', array( __CLASS__, 'public_scripts' ) );
16
17 add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_scripts' ) );
18
19 add_filter( 'plugin_action_links_' . SRR_BASE_NAME, array( __CLASS__, 'action_links' ) );
20
21 }
22
23 public static function init_widget(){
24
25 register_widget( 'super_rss_reader_widget' );
26
27 }
28
29 public static function public_scripts(){
30
31 wp_enqueue_script( 'jquery-easy-ticker', SRR_URL . 'public/js/jquery.easy-ticker.min.js', array( 'jquery' ), SRR_VERSION );
32 wp_enqueue_script( 'super-rss-reader', SRR_URL . 'public/js/script.min.js', array( 'jquery' ), SRR_VERSION );
33
34 wp_enqueue_style( 'super-rss-reader', SRR_URL . 'public/css/style.min.css', array(), SRR_VERSION );
35
36 }
37
38 public static function admin_scripts( $hook ){
39
40 if( $hook == 'widgets.php' ){
41 wp_enqueue_style( 'srr_admin_css', SRR_URL . 'admin/css/style-widget.css', array(), SRR_VERSION );
42 wp_enqueue_script( 'srr_admin_js', SRR_URL . 'admin/js/script-widget.js', array( 'jquery' ), SRR_VERSION );
43 }
44
45 }
46
47 public static function render_feed( $options ){
48
49 $feed = new SRR_Feed( $options );
50 echo $feed->html();
51
52 }
53
54 public static function action_links( $links ){
55 array_unshift( $links, '<a href="https://www.aakashweb.com/wordpress-plugins/super-rss-reader/?utm_source=admin&utm_medium=plugin-list&utm_campaign=srr-pro" target="_blank"><b>' . esc_html__( 'Upgrade to PRO', 'super-rss-reader' ) . '</b></a>' );
56 return $links;
57 }
58
59 }
60
61 SRR_Widget::init();
62
63 ?>