PHP code example of alleyinteractive / wp-find-one
1. Go to this page and download the library: Download alleyinteractive/wp-find-one 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/ */
alleyinteractive / wp-find-one example snippets
use function Alley\WP\find_one_post;
// Returns a \WP_Post or null.
$person = find_one_post(
[
'meta_key' => 'twitter',
'meta_value' => '@potatomaster',
'post_type' => 'person',
]
);