%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/atv-api/wp-content/themes/atv/inc/
Upload File :
Create Path :
Current File : /var/www/html/atv-api/wp-content/themes/atv/inc/helpers.php

<?php 

function partial($partial, $data) {
    include get_template_directory() . '/templates/partials/'. $partial.'.php';
}

function getPosts($type = false, $limit = false, $category = false, $taxonomy = false, $not_in = false) {
    
    $args = [
        'post_type' => [$type], 
        'post_status' => ['publish'], 
        'posts_per_page' => ($limit ?? -1 ),
        'orderby' => 'menu_order',
        'order' => 'ASC',
    ];

    if($category) {
        $args['tax_query'] = [['taxonomy' => $taxonomy, 'terms' => $category]];
    }
    if($not_in) {
        $args['post__not_in'] = $not_in;
    }

    $query = new WP_Query( $args );

    return $query->posts; 

    wp_reset_postdata();
}

?>

Zerion Mini Shell 1.0