| | |
| | | parent::__construct(); |
| | | $this->cache = Cache::for($this->taxonomy, 'term', DAY_IN_SECONDS); |
| | | $this->setupTables(); |
| | | $this->setupCacheConnections(); |
| | | } |
| | | |
| | | add_action('init', [$this, 'registerContentTermsExecutors'], 5); |
| | |
| | | } |
| | | } |
| | | |
| | | protected function setupCacheConnections(): void |
| | | { |
| | | $this->cache |
| | | ->connect('taxonomy') |
| | | ->connect('user'); |
| | | } |
| | | |
| | | public function registerRoutes(): void |
| | | { |
| | | if (!$this->registrar->hasFeature('is_content')) { |
| | |
| | | $page = (int)$request->get_param('page'); |
| | | |
| | | |
| | | return $this->cache->remember(compact('termID', 'status', 'page'), function() use ($termID, $status, $page) { |
| | | return $this->cache->remember(['id'=> $termID, 'status' => $status, 'page' => $page], function() use ($termID, $status, $page) { |
| | | $perPage = 20; |
| | | $offset = ($page - 1) * $perPage; |
| | | |
| | |
| | | $status = $request->get_param('status'); |
| | | $page = (int)$request->get_param('page'); |
| | | |
| | | return $this->cache->remember(compact('termID', 'status', 'page'), function() use ($termID, $status, $page) { |
| | | return $this->cache->remember(['id'=>$termID, 'status' => $status,'page' => $page], function() use ($termID, $status, $page) { |
| | | $perPage = 20; |
| | | $offset = ($page - 1) * $perPage; |
| | | |