There are 24 files included in the Widget System. Several have not been touched in months, others are using procedural calls, and others are using poor code to pull threads. Two files regarding XenReviews will be deprecated soon.
Work on widgets continued tonight:
- All of the widget file names were redone by stripping out the -xf- prefix.
- Widgets task chart was developed in Google Docs
- XenWord_Dashboard class created and file developed
The widget files included an -xf- prefix. This was stripped out. This is to help match file names and class names. For example, xenword-xf-topposters-widget.php is now named
xenword-top-posters-widget.php. The class name will change to XenWord_Top_Posters_Widget.
Widget Task Chart
I created a quick document to keep the tasks organized and to help me keep track of which widget is finished.
XenWord Dashboard
The dashboard file was changed to a class. I was stuck for a bit on the register_xenword_dashboard_widget method. Changing the third line in the wp_add_dashboad_widget fixed the challenge to getting the widget to load.
PHP:
public function hook() {
add_action( 'wp_dashboard_setup', array( $this, 'register_xenword_dashboard_widget' ) );
}
public function register_xenword_dashboard_widget() {
wp_add_dashboard_widget(
'xenword_dashboard_widget',
'Community Statistics',
array( $this,'xenword_dashboard_widget_display'
) );
}
Incomplete
Work is incomplete on this file. There are many options available in the XenWord settings for board statistics to include select XenForo addons such as Article Management System, User Blogging System, Media Gallery, and XenForo Resource Management. These board totals are not included in the dashboard yet.