PHP code example of humanmade / entity-base
1. Go to this page and download the library: Download humanmade/entity-base library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
humanmade / entity-base example snippets
$connected_posts = EntityBase\Utils\query_connected_posts( $entity_post );
// Or
$connected_posts = new WP_Query( [
'post_type' => 'any',
'post_status' => 'publish',
'meta_key' => mb_strcut( '_entity_' . $entity->post_name, 0, 256 ),
'meta_compare' => 'EXISTS',
] );
$entities = EntityBase\Utils\get_entities_for_post( WP_Post $post );