API Reference
Vimeify provides comprehensive PHP functions and REST API endpoints for programmatic video management.
PHP Functions
Video Functions
Get Video by ID
vimeify_get_video( int $post_id )Get video post by WordPress post ID.
Returns: WP_Post object or null
Example:
$video = vimeify_get_video( 123 );
if ( $video ) {
echo $video->post_title;
}Get Video by Vimeo ID
vimeify_get_video_by_vimeo_id( string $vimeo_id )Get video by Vimeo ID.
Returns: WordPress post ID or null
Get Video Metadata
vimeify_get_video_meta( int $post_id, string $key = '' )Get video metadata.
Returns: Meta value or array
Available Meta Keys:
vimeo_id- Vimeo video IDduration- Duration in secondswidth- Video widthheight- Video heightembed_url- Vimeo embed URLprivacy- Privacy settingthumbnail- Thumbnail URLs
Get Video Embed
vimeify_get_video_embed( int $post_id, array $args = [] )Get video embed HTML.
Args:
width- Player width (default: 640)height- Player height (default: 360)autoplay- Auto-play video (default: false)loop- Loop video (default: false)
Returns: HTML embed code
Gallery Functions
Get Gallery
vimeify_get_gallery( int $gallery_id )Get gallery by ID.
Get Gallery Videos
vimeify_get_gallery_videos( int $gallery_id, array $args = [] )Get videos from gallery.
Returns: Array of WP_Post objects
Sync Functions
Sync Metadata
vimeify_sync_metadata( bool $fresh = false )Sync video metadata from Vimeo.
Sync Status
vimeify_sync_status( bool $fresh = false )Check for deleted videos.
Upload Functions
Upload Video
vimeify_upload_video( string $file_path, array $args = [] )Upload video to Vimeo.
Returns: Array with success status and data
REST API Endpoints
Authentication
All endpoints require WordPress authentication.
List Videos
Endpoint: GET /wp-json/vimeify/v1/videos
Parameters:
per_page- Videos per page (default: 10)page- Page number (default: 1)category- Filter by category slugsearch- Search term
Response:
{
"videos": [
{
"id": 123,
"title": "My Video",
"vimeo_id": "987654321",
"duration": 120,
"embed_url": "https://...",
"thumbnail": "https://..."
}
],
"total": 50,
"pages": 5
}Get Single Video
Endpoint: GET /wp-json/vimeify/v1/videos/{id}
Returns detailed video information.
List Folders
Endpoint: GET /wp-json/vimeify/v1/folders
Returns Vimeo folders.
List Galleries
Endpoint: GET /wp-json/vimeify/v1/galleries
Returns all galleries.
Constants
Post Types
VIMEIFY_VIDEO_POST_TYPE = 'vimeify-video'
VIMEIFY_PROFILE_POST_TYPE = 'vimeify-profile'
VIMEIFY_GALLERY_POST_TYPE = 'vimeify-gallery'Taxonomies
VIMEIFY_CATEGORY_TAXONOMY = 'vimeify-category'
VIMEIFY_GALLERY_TAXONOMY = 'vimeify-gallery'Meta Keys
VIMEIFY_VIMEO_ID_META = '_vimeify_vimeo_id'
VIMEIFY_DURATION_META = '_vimeify_duration'
VIMEIFY_PRIVACY_META = '_vimeify_privacy'Related
- Hooks & Filters - Customize behavior
- CLI Commands - Command-line interface
- Frontend Uploads - Pro upload features