PATH:
home
/
ajwellnessmassag
/
angelictravels.online
/
wp-content
/
plugins
/
templately
/
includes
/
API
<?php namespace Templately\API; use Templately\Utils\Database; use WP_REST_Request; class Tags extends API { private $endpoint = 'tags'; public function permission_check( WP_REST_Request $request ) { $this->request = $request; return true; } public function register_routes() { $this->get($this->endpoint, [$this, 'tags']); } public function tags() { $tags = Database::get_transient( $this->endpoint ); if( $tags ){ return $this->success( $tags ); } $response = $this->http()->query( 'tags', 'id, name' )->post(); if( ! is_wp_error( $response ) ) { $_tags = []; if( ! empty( $response ) ) { foreach( $response as $tag ) { $_tags[] = [ 'label' => $tag['name'], 'value' => $tag['id'], ]; } } Database::set_transient( $this->endpoint, $_tags ); return $_tags; } return $response; } }
[-] Login.php
[edit]
[-] Dependencies.php
[edit]
[-] Profile.php
[edit]
[-] Items.php
[edit]
[-] LogoGeneration.php
[edit]
[-] API.php
[edit]
[-] Categories.php
[edit]
[-] Conditions.php
[edit]
[-] Sites.php
[edit]
[+]
..
[-] AIContent.php
[edit]
[-] SignUp.php
[edit]
[-] ThemeBuilderApi.php
[edit]
[-] SavedTemplates.php
[edit]
[-] Tags.php
[edit]
[-] WorkSpaces.php
[edit]
[-] FullSiteImport.php
[edit]
[-] MyClouds.php
[edit]
[-] Import.php
[edit]
[-] TemplateTypes.php
[edit]