PluginProbe
FileBird – WordPress Media Library Folders & File Manager / 5.5
FileBird – WordPress Media Library Folders & File Manager v5.5
6.5.8 6.5.7 6.5.5 6.5.4 trunk 4.3.1 5.1.6 5.3 5.3.2 5.4.3 5.4.4 5.4.5 5.5 5.5.3 5.5.5 5.5.8 5.5.8.1 5.6 5.6.1 5.6.2 5.6.3 5.6.4 6.2.3 6.2.5 6.3 All 36 releases
filebird / includes / Support / DocumentGallery.php

DocumentGallery.php in FileBird – WordPress Media Library Folders & File Manager 5.5, at includes/Support/DocumentGallery.php

35 lines 807 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FileBird\Support;
4
5 defined( 'ABSPATH' ) || exit;
6
7 use FileBird\Model\Folder as FolderModel;
8
9 class DocumentGallery {
10 public function __construct() {
11 add_action( 'init', array( $this, 'init' ) );
12 }
13
14 public function init() {
15 if ( ! defined( 'DG_VERSION' ) || version_compare( DG_VERSION, '4.3.2', '<=' ) ) {
16 return;
17 }
18 add_action( 'dg_query', array( $this, 'dg_query' ), 10, 4 );
19 }
20
21 public function dg_query( &$query, $taxa, &$excluded_keys, &$errs ) {
22 if ( ! empty( $taxa['fbv'] ) ) {
23 $excluded_keys[] = 'fbv';
24
25 if ( is_null( FolderModel::findById( $taxa['fbv'] ) ) ) {
26 $errs[] = __( 'This folder ID does not exist, please check again.', 'filebird' );
27 return;
28 }
29
30 $query['fbv'] = $taxa['fbv'];
31 $query['suppress_filters'] = false;
32 }
33 }
34 }
35