Skip to content

Commit

Permalink
Allow request embed filter to be overridden, see https://docs.vimeogr…
Browse files Browse the repository at this point in the history
  • Loading branch information
davekiss committed Mar 21, 2018
1 parent 755e5cd commit 28c5fa5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,19 @@ private function _make_vimeo_request( $endpoint, $params = array(), $last_modifi
*/
$params = array_merge( array(
'fields' => implode( $fields, ',' ),
'filter' => 'embeddable',
'filter_embeddable' => 'true',
), $params );

/**
* Allows Vimeography to disclude videos in the request response
* that cannot be embedded due to their privacy settings or domain restrictions.
*/
$filter = apply_filters('vimeography.request.privacy.filter', 'embeddable', $this->gallery_id, $this->gallery_settings);

if ( $filter === 'embeddable' ) {
$params['filter'] = $embeddable;
$params['filter_embeddable'] = 'true';
}

/**
* Set the headers to send along with the Vimeo request.
*/
Expand Down

0 comments on commit 28c5fa5

Please sign in to comment.