Sindbad~EG File Manager
<?php
namespace RealPress\Shortcodes;
use RealPress\Helpers\Template;
use RealPress\Helpers\Settings;
/**
* Class PropertyList
* @package RealPress\Shortcodes
*/
class PropertyList extends AbstractShortcode {
protected $shortcode_name = 'realpress_property_list';
/**
* PropertyList constructor.
*/
public function __construct() {
parent::__construct();
}
/**
* @param $attrs
*
* @return string
*/
public function render( $attrs ): string {
ob_start();
$args = array(
'post_type' => REALPRESS_PROPERTY_CPT,
'posts_per_page' => $attrs['limit'] ?? Settings::get_setting_detail( 'group:property:fields:property_per_page' ),
'page' => $attrs['page'] ?? 1,
);
if ( isset( $attrs['ids'] ) ) {
$args['post__in'] = $attrs['ids'];
}
$data = array(
'args' => $args,
);
Template::instance( true )->get_frontend_template_type_classic( 'shortcodes/property-list.php', compact( 'data' ) );
return ob_get_clean();
}
/**
* @return void
*/
public function enqueue_scripts() {
}
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists