Created
September 28, 2023 19:09
-
-
Save everaldomatias/b8b6911f48387785e2d0ef5fa0920eec to your computer and use it in GitHub Desktop.
Tentativas tainacan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$repo_collection = \Tainacan\Repositories\Collections::get_instance(); | |
$repo_items = \Tainacan\Repositories\Items::get_instance(); | |
$repo_metadata = \Tainacan\Repositories\Metadata::get_instance(); | |
$acervo = $repo_collection->fetch_one( ['pagename' => 'acervo'] ); | |
$unidade = $repo_metadata->fetch_one( ['name' => 'Unidade'] ); | |
$item = new \Tainacan\Entities\Item( 7200 ); | |
$get_metadata = new \Tainacan\Entities\Item_Metadata_Entity( $item, $unidade ); | |
$meta = tainacan_get_the_metadata(['metadata' => $get_metadata], 7200); | |
$rand_offset = rand( 0, 9 ); | |
$rest_url = get_rest_url( null, 'tainacan/v2/collection/' . $collection_id . '/items?offset=' . $rand_offset ); | |
$strpos = strpos( $rest_url, "/wp-json/" ) + 9; | |
$base_rest_url = substr( $rest_url, 0, $strpos ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment