PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
← All changes | includes/widgets/widget-comments.php +23 -30 0.9.51.1.10 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2 /**
3 - * Desktop Mode — Recent Comments Widget.
3 + * OpenStation — Recent Comments Widget.
4 4 *
5 5 * Shows a live feed of recent comments with status badges
6 6 * (Approved / Pending / Spam), the commenter name, the post title
7 7 * it belongs to, and a time-ago stamp. Pending count badge
@@ -8,12 +8,11 @@
8 8 * on the card header keeps moderators on top of the queue at a glance.
9 9 *
10 10 * Data source: WordPress REST API /wp/v2/comments (logged-in).
11 11 * Refresh: every 60 seconds via setInterval.
12 - * Requires: Desktop Mode 0.18.0+ (desktop_mode_register_widget).
12 + * Requires: OpenStation 0.18.0+ (openstation_register_widget).
13 13 *
14 - * @package WPDesktopMode
15 - * @since 0.26.0
14 + * @package OpenStation
16 15 */
17 16
18 17 defined( 'ABSPATH' ) || exit;
19 18
@@ -18,68 +17,62 @@
18 17 defined( 'ABSPATH' ) || exit;
19 18
20 19 /**
21 20 * Register the JS + CSS assets.
22 - *
23 - * @since 0.26.0
24 21 */
25 -function desktop_mode_register_comments_widget_assets() {
26 - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
27 - $version = defined( 'DESKTOP_MODE_VERSION' ) ? DESKTOP_MODE_VERSION : '0';
22 +function openstation_register_comments_widget_assets() {
23 + $suffix = openstation_asset_suffix();
24 + $version = defined( 'OPENSTATION_VERSION' ) ? OPENSTATION_VERSION : '0';
28 25
29 - $js_path = DESKTOP_MODE_DIR . 'assets/js/widget-recent-comments' . $suffix . '.js';
30 - $css_path = DESKTOP_MODE_DIR . 'assets/js/widget-recent-comments' . $suffix . '.css';
26 + $js_path = OPENSTATION_DIR . 'assets/js/widget-recent-comments' . $suffix . '.js';
27 + $css_path = OPENSTATION_DIR . 'assets/js/widget-recent-comments' . $suffix . '.css';
31 28
32 29 wp_register_style(
33 - 'desktop-mode-comments-widget',
34 - DESKTOP_MODE_URL . 'assets/js/widget-recent-comments' . $suffix . '.css',
30 + 'os-comments-widget',
31 + OPENSTATION_URL . 'assets/js/widget-recent-comments' . $suffix . '.css',
35 32 array(),
36 33 file_exists( $css_path ) ? (string) filemtime( $css_path ) : $version
37 34 );
38 35
39 36 wp_register_script(
40 - 'desktop-mode-comments-widget',
41 - DESKTOP_MODE_URL . 'assets/js/widget-recent-comments' . $suffix . '.js',
37 + 'os-comments-widget',
38 + OPENSTATION_URL . 'assets/js/widget-recent-comments' . $suffix . '.js',
42 39 array( 'wp-api-fetch' ),
43 40 file_exists( $js_path ) ? (string) filemtime( $js_path ) : $version,
44 41 true
45 42 );
46 43 }
47 -add_action( 'init', 'desktop_mode_register_comments_widget_assets', 5 );
44 +add_action( 'init', 'openstation_register_comments_widget_assets', 5 );
48 45
49 46 /**
50 47 * Eagerly enqueue the CSS on shell pages so there is no flash of
51 48 * unstyled content while the lazy JS bundle loads.
52 - *
53 - * @since 0.26.0
54 49 */
55 -function desktop_mode_enqueue_comments_widget_styles() {
56 - if ( function_exists( 'desktop_mode_is_enabled' ) && ! desktop_mode_is_enabled() ) {
50 +function openstation_enqueue_comments_widget_styles() {
51 + if ( function_exists( 'openstation_is_enabled' ) && ! openstation_is_enabled() ) {
57 52 return;
58 53 }
59 - if ( function_exists( 'desktop_mode_is_chromeless_request' ) && desktop_mode_is_chromeless_request() ) {
54 + if ( function_exists( 'openstation_is_chromeless_request' ) && openstation_is_chromeless_request() ) {
60 55 return;
61 56 }
62 - wp_enqueue_style( 'desktop-mode-comments-widget' );
57 + wp_enqueue_style( 'os-comments-widget' );
63 58 }
64 -add_action( 'admin_enqueue_scripts', 'desktop_mode_enqueue_comments_widget_styles', 20 );
59 +add_action( 'admin_enqueue_scripts', 'openstation_enqueue_comments_widget_styles', 20 );
65 60
66 61 /**
67 62 * Register the widget definition.
68 - *
69 - * @since 0.26.0
70 63 */
71 -function desktop_mode_register_comments_widget() {
72 - if ( ! function_exists( 'desktop_mode_register_widget' ) ) {
64 +function openstation_register_comments_widget() {
65 + if ( ! function_exists( 'openstation_register_widget' ) ) {
73 66 return;
74 67 }
75 - desktop_mode_register_widget(
68 + openstation_register_widget(
76 69 'desktop-mode/recent-comments',
77 70 array(
78 71 'label' => __( 'Recent Comments', 'desktop-mode' ),
79 72 'description' => __( 'Live feed of the latest comments with pending count.', 'desktop-mode' ),
80 73 'icon' => 'dashicons-admin-comments',
81 - 'script' => 'desktop-mode-comments-widget',
74 + 'script' => 'os-comments-widget',
82 75 'movable' => true,
83 76 'resizable' => true,
84 77 'min_width' => 280,
85 78 'min_height' => 220,
@@ -87,5 +80,5 @@
87 80 'default_height' => 380,
88 81 )
89 82 );
90 83 }
91 -add_action( 'init', 'desktop_mode_register_comments_widget', 6 );
84 +add_action( 'init', 'openstation_register_comments_widget', 6 );