format( 'Y-m-d\TH:i:sO' ); } /** * Return an array of sites for a network in a way that is also backwards compatible * * @param string|array $args Argument to filter results by. * * @return array */ function wp_stream_get_sites( $args = array() ) { if ( empty( $args['limit'] ) ) { $args['limit'] = 0; } if ( function_exists( 'get_sites' ) ) { // Account for get_sites() which uses 'number' while wp_get_sites() uses 'limit'. $args['number'] = $args['limit']; $sites = get_sites( $args ); } else { $sites = array(); foreach ( wp_get_sites( $args ) as $site ) { // @codingStandardsIgnoreLine Specifically for old version of WP first, in order to provide backward compatibility $sites[] = WP_Site::get_instance( $site['blog_id'] ); } } return $sites; } /** * Check if Stream is running on WordPress.com VIP * * @return bool */ function wp_stream_is_vip() { return function_exists( 'wpcom_vip_load_plugin' ); } /** * Check if the default front-end WP Cron is enabled. It doesn't * mean that the Cron is disabled in general. * * @return bool */ function wp_stream_is_cron_enabled() { return ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ? false : true; }