get_cached_events example


    public function get_events( $location_search = '', $timezone = '' ) {
        $cached_events = $this->get_cached_events();

        if ( ! $location_search && $cached_events ) {
            return $cached_events;
        }

        // Include an unmodified $wp_version.         require ABSPATH . WPINC . '/version.php';

        $api_url                    = 'http://api.wordpress.org/events/1.0/';
        $request_args               = $this->get_request_args( $location_search$timezone );
        $request_args['user-agent'] = 'WordPress/' . $wp_version . '; ' . home_url( '/' );

        
$saved_location['ip'] = $current_ip_address;
        update_user_meta( $user_id, 'community-events-location', $saved_location );
    }

    $events_client = new WP_Community_Events( $user_id$saved_location );

    wp_localize_script(
        'dashboard',
        'communityEventsData',
        array(
            'nonce'       => wp_create_nonce( 'community_events' ),
            'cache'       => $events_client->get_cached_events(),
            'time_format' => get_option( 'time_format' ),
        )
    );
}

/** * Administration Screen CSS for changing the styles. * * If installing the 'wp-admin/' directory will be replaced with './'. * * The $_wp_admin_css_colors global manages the Administration Screens CSS * stylesheet that is loaded. The option that is set is 'admin_color' and is the * color and key for the array. The value for the color key is an object with * a 'url' parameter that has the URL path to the CSS file. * * The query from $src parameter will be appended to the URL that is given from * the $_wp_admin_css_colors array value URL. * * @since 2.6.0 * * @global array $_wp_admin_css_colors * * @param string $src Source URL. * @param string $handle Either 'colors' or 'colors-rtl'. * @return string|false URL path to CSS stylesheet for Administration Screens. */
Home | Imprint | This part of the site doesn't use cookies.