|
3 | 3 | if ( ! defined( 'ABSPATH' ) ) { |
4 | 4 | exit; |
5 | 5 | } |
6 | | - |
7 | | - if ( ! class_exists( 'reduxDashboardWidget' ) ) { |
| 6 | + |
| 7 | + if (!class_exists('reduxDashboardWidget')) { |
8 | 8 | class reduxDashboardWidget { |
9 | | - public function __construct() { |
10 | | - if ( ReduxFramework::$_as_plugin ) { |
11 | | - add_action( 'wp_dashboard_setup', array( $this, 'add_redux_dashboard' ) ); |
12 | | - } |
13 | | - } |
| 9 | + |
| 10 | + public function __construct ($parent) { |
| 11 | + $fname = Redux_Functions::dat( 'add_redux_dashboard', $parent->args['opt_name'] ); |
14 | 12 |
|
| 13 | + add_action('wp_dashboard_setup', array($this, $fname)); |
| 14 | + } |
| 15 | + |
15 | 16 | public function add_redux_dashboard() { |
16 | | - add_meta_box( 'redux_dashboard_widget', 'Redux Framework News', array( |
17 | | - $this, |
18 | | - 'redux_dashboard_widget' |
19 | | - ), 'dashboard', 'side', 'normal', 0 ); |
| 17 | + add_meta_box('redux_dashboard_widget', 'Redux Framework News', array($this,'redux_dashboard_widget'), 'dashboard', 'side', 'high'); |
20 | 18 | } |
21 | | - |
| 19 | + |
| 20 | + public function dat() { |
| 21 | + return; |
| 22 | + } |
| 23 | + |
22 | 24 | public function redux_dashboard_widget() { |
23 | 25 | echo '<div class="rss-widget">'; |
24 | | - wp_widget_rss_output( array( |
25 | | - 'url' => 'http://reduxframework.com/feed/', |
26 | | - 'title' => 'REDUX_NEWS', |
27 | | - 'items' => 3, |
28 | | - 'show_summary' => 1, |
29 | | - 'show_author' => 0, |
30 | | - 'show_date' => 1 |
31 | | - ) ); |
| 26 | + wp_widget_rss_output(array( |
| 27 | + 'url' => 'http://reduxframework.com/feed/', |
| 28 | + 'title' => 'REDUX_NEWS', |
| 29 | + 'items' => 3, |
| 30 | + 'show_summary' => 1, |
| 31 | + 'show_author' => 0, |
| 32 | + 'show_date' => 1 |
| 33 | + )); |
32 | 34 | echo '</div>'; |
33 | 35 | } |
34 | 36 | } |
35 | | - |
36 | | - new reduxDashboardWidget(); |
37 | 37 | } |
0 commit comments