PluginProbe
Stream – Activity Log & Audit Trail / 3.4.2
Stream – Activity Log & Audit Trail v3.4.2
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
← All changes | includes/functions.php +26 -7 3.13.4.2 View file →
@@ -35,9 +35,9 @@
35 35 /**
36 36 * Converts a time into an ISO 8601 extended formatted string.
37 37 *
38 38 * @param int|bool $time Seconds since unix epoc
39 - * @param int $offset Hour offset
39 + * @param int $offset Hour offset
40 40 *
41 41 * @return string an ISO 8601 extended formatted time
42 42 */
43 43 function wp_stream_get_iso_8601_extended_date( $time = false, $offset = 0 ) {
@@ -64,10 +64,10 @@
64 64 /**
65 65 * Encode to JSON in a way that is also backwards compatible
66 66 *
67 67 * @param mixed $data
68 - * @param int $options (optional)
69 - * @param int $depth (optional)
68 + * @param int $options (optional)
69 + * @param int $depth (optional)
70 70 *
71 71 * @return string
72 72 */
73 73 function wp_stream_json_encode( $data, $options = 0, $depth = 512 ) {
@@ -88,16 +88,18 @@
88 88
89 89 /**
90 90 * Return an array of sites for a network in a way that is also backwards compatible
91 91 *
92 + * @param string|array $args
93 + *
92 94 * @return array
93 95 */
94 -function wp_stream_get_sites() {
96 +function wp_stream_get_sites( $args = array() ) {
95 97 if ( function_exists( 'get_sites' ) ) {
96 - $sites = get_sites();
98 + $sites = get_sites( $args );
97 99 } else {
98 100 $sites = array();
99 - foreach ( wp_get_sites() as $site ) {
101 + foreach ( wp_get_sites( $args ) as $site ) { // @codingStandardsIgnoreLine Specifically for old version of WP first, in order to provide backward compatibility
100 102 $sites[] = WP_Site::get_instance( $site['blog_id'] );
101 103 }
102 104 }
103 105
@@ -113,11 +115,28 @@
113 115 return function_exists( 'wpcom_vip_load_plugin' );
114 116 }
115 117
116 118 /**
117 - * True if native WP Cron is enabled, otherwise false
119 + * Check if the default front-end WP Cron is enabled. It doesn't
120 + * mean that the Cron is disabled in general.
118 121 *
119 122 * @return bool
120 123 */
121 124 function wp_stream_is_cron_enabled() {
122 125 return ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ? false : true;
126 +}
127 +
128 +/**
129 + * Get the asset min suffix if defined.
130 + *
131 + * @return string
132 + */
133 +function wp_stream_min_suffix() {
134 + $min = '';
135 + $is_script_debugging = ! defined( 'SCRIPT_DEBUG' ) || false === SCRIPT_DEBUG;
136 +
137 + if ( apply_filters( 'wp_stream_load_min_assets', $is_script_debugging ) ) {
138 + $min = 'min.';
139 + }
140 +
141 + return $min;
123 142 }