-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp-support-admin-feed.php
More file actions
91 lines (85 loc) · 2.98 KB
/
wp-support-admin-feed.php
File metadata and controls
91 lines (85 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* Dashboard WP.org support forum feed
*
* Displays a widget in the Dashboard of the .org support forums for AE plugins
*
* @package WP Support Forum Feed
* @author davebonds
* @license GPL-2.0+
* @link http://agentevolution.com
* @copyright 2014 Agent Evolution
*
* @wordpress-plugin
* Plugin Name: Dashboard WP.org support forum feed
* Plugin URI: @TODO
* Description: Displays a widget in the Dashboard of the .org support forums for AE plugins
* Version: 1.0.0
* Author: davebonds
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* GitHub Plugin URI: https://github.com/
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/*----------------------------------------------------------------------------*
* Dashboard and Administrative Functionality
*----------------------------------------------------------------------------*/
/*
* @TODO:
*
* - replace `class-plugin-name-admin.php` with the name of the plugin's admin file
* - replace Plugin_Name_Admin with the name of the class defined in
* `class-plugin-name-admin.php`
*
* If you want to include Ajax within the dashboard, change the following
* conditional to:
*
* if ( is_admin() ) {
* ...
* }
*
* The code below is intended to to give the lightest footprint possible.
*/
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
/**
* Add Dashboard RSS feed widget for wp.org support forum
*/
add_action('wp_dashboard_setup', 'ae_dashboard_widgets');
function ae_dashboard_widgets() {
global $wp_meta_boxes;
unset(
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'],
$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'],
$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']
);
wp_add_dashboard_widget( 'dashboard_wplistings_feed', 'Support » WP Listings' , 'dashboard_org_wplistings_support_feed_output' );
wp_add_dashboard_widget( 'dashboard_gap_feed', 'Support » Genesis Agent Profiles' , 'dashboard_org_gap_support_feed_output' );
}
function dashboard_org_wplistings_support_feed_output() {
echo '<div class="rss-widget">';
wp_widget_rss_output(array(
'url' => 'http://wordpress.org/support/rss/plugin/wp-listings',
'title' => 'Support » WP Listings',
'items' => 6,
'show_summary' => 1,
'show_author' => 1,
'show_date' => 1
));
echo '</div>';
}
function dashboard_org_gap_support_feed_output() {
echo '<div class="rss-widget">';
wp_widget_rss_output(array(
'url' => 'http://wordpress.org/support/rss/plugin/genesis-agent-profiles',
'title' => 'Support » Genesis Agent Profiles',
'items' => 6,
'show_summary' => 1,
'show_author' => 1,
'show_date' => 1
));
echo '</div>';
}
}