$posts_per_page,
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'leasing',
'fields' => 'ids',
'post_status' => 'publish',
);
$ids = get_posts( $args );
return $ids;
}
function abr_leasing_html($nums){
$nums=''? $nums='-1':$nums;
$ids = abr_retrieve_all_leasing_ids($nums);
if(!empty($ids)){
$html = '';
$html.='
';
foreach((array) $ids as $id){
$title = get_the_title($id);
$publish_date = get_post_meta($id,'cf_leasing_publish_date', true);
$expire_date = get_post_meta($id,'cf_leasing_expire_date', true);
$desc = get_post_meta($id,'cf_leasing_description', true);
$aids = get_post_meta($id,'cf_leasing_apartment', true);
$aids = is_array($aids) ? $aids : array($aids);
$html.='
';
$html.='
'.$title.'
';
$html.='
'.__('Publish date:','ar').$publish_date.'
';
$html.='
'.__('Expiry date:','ar').$expire_date.'
';
$html.='
'.$desc.'
';
$html.='
';
$html.='
';
if(!empty($aids)){
$html.='
';
foreach($aids as $aid){
$html.=abr_apartment_post($aid);
}
$html.='
';
}
$html.='
';
$html.='
';
$html.='
';
}
$html.='
';
}
return $html;
}
add_shortcode('ar_leasing_specials','abr_leasing_special');
/**
* leasing_special
*
* @return html
*/
function abr_leasing_special(){
return abr_leasing_html($nums='');
}