1. Go to this page and download the library: Download brw/wp-eloquent 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/ */
use WPEloquent\Models\Post;
$posts = Post::limit(10)->where('post_status', 'publish')->get();
foreach ($posts as $post) :
use WPEloquent\Models\Post;
class CustomPostType extends Post
{
/**
* The post type for the model.
*
* @var array|string
*/
$postType = 'custom_post_type';
}
use WPEloquent\Models\Model;
class CustomTable extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'custom_table';
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.