From 28c5fa5bef842571772dd0bb169408173e7d5a76 Mon Sep 17 00:00:00 2001 From: Dave Kiss Date: Wed, 21 Mar 2018 10:32:42 -0400 Subject: [PATCH] Allow request embed filter to be overridden, see https://docs.vimeography.com/article/38-how-do-i-display-my-private-hidden-restricted-videos --- lib/core.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/core.php b/lib/core.php index 1a18df1d..051961b2 100644 --- a/lib/core.php +++ b/lib/core.php @@ -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. */