# gamipress/8.0.3/integrations/vimeo/includes/functions.php

GamiPress – Gamification plugin to reward points, badges &amp; ranks in WordPress, now with AI, version 8.0.3. 55 lines.

- Page: https://pluginprobe.com/plugins/gamipress/8.0.3/code/integrations/vimeo/includes/functions.php
- Raw: https://pluginprobe.com/plugins/gamipress/8.0.3/raw/integrations/vimeo/includes/functions.php
- Modified: 2026-09-21T06:17:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gamipress/8.0.3/code/integrations/vimeo/includes/functions.php#L10-L20`.

```php
<?php
/**
 * Admin
 *
 * @package GamiPress\Vimeo\Admin
 * @since 1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;

/**
 * Extract the video ID from the given URL
 *
 * @since 1.0.0
 *
 * @param string $url
 *
 * @return string
 */
function gamipress_vimeo_get_video_id_from_url( $url ) {

    // Support for the following valid URLs
    // http://vimeo.com/{video_id}
    // http://player.vimeo.com/video/{video_id}
    // http://player.vimeo.com/video/{video_id}?title=0&byline=0&portrait=0
    // http://vimeo.com/channels/user/{video_id}
    preg_match("#(?:https?://)?(?:www.)?(?:player.)?vimeo.com/(?:[a-z]*/)*([0-9]{6,11})[?]?.*#", $url, $matches);

    $video_id = (isset( $matches[1] ) ? $matches[1] : $url );

    return $video_id;

}

/**
 * Check the video ID format
 *
 * @since 1.0.0
 *
 * @param string $video_id
 *
 * @return string
 */
function gamipress_vimeo_check_video_id_format( $video_id ) {

    $video_id = trim( $video_id );

    // Check if video ID has 6 to 11 characters
    if ( preg_match( '/^[0-9]{6,11}$/', $video_id ) ) {
        return true;
    }

    return false;

}
```
