Helper::is_vimeo_api_error( \WP_Error $wp_error )

Check if a WP_Error object is a Vimeo API error.


Description

Determines if an object of WP_Error type is an error returned by a Vimeo API query.


Parameters

$wp_error

(Required) The error object.


Return

(bool) True is the error was returned by the Vimeo API or false if it's a generic WP error.


Source

File: includes/libs/helper.class.php

	public static function is_vimeo_api_error( $wp_error ){
		if( !is_wp_error( $wp_error ) ){
			return false;
		}

		$error_data = $wp_error->get_error_data();
		/**
		 * Key 'vimeo_api_error' is set in \Vimeotheque\Vimeo_Api\Vimeo::api_error()
		 * @see \Vimeotheque\Vimeo_Api\Vimeo::api_error()
		 * @since 2.0
		 */
		return ( isset( $error_data['vimeo_api_error'] ) && $error_data['vimeo_api_error'] );
	}

Start your video site now!

Manage and coordinate your Vimeo channels, albums or videos with your WordPress website. Perfect fit for membership, portfolio, online courses or any type of video collection.

Get Vimeotheque PRO!