Site icon Hip-Hop Website Design and Development

PHP Warning: Try and learn property "slug" on bool in tax question

Within the tax_query, I’ve used the ‘time period’ = array( $category->slug ).
I am getting an error discover the place utilizing $category->slug, nevertheless, within the frontend it shows the slug of the time period.

Please assist me to debug it.

// Shortcode [phd_vacancies]

add_shortcode( 'phd_vacancies', operate() {
    ob_start();
    international $publish; // information from the present publish within the WP loop
    $classes = get_the_terms( get_the_ID(), 'nation' );
    foreach( (array) $classes as $class ) {
    $args=array(
    //'post__not_in' => array($post->ID),
    'post_type' => 'job',
    'post_status' => 'publish',
    'posts_per_page' => 10,
    'orderby' => array('title' => 'DESC'),
    'tax_query' => array(
        'relation' => 'AND',
        array(
            'taxonomy' => 'nation',
            'subject'    => 'slug',
            'phrases'    => array( $category->slug ), // PHP Warning: Try and learn property "slug" on bool
                ),
        array(
            'taxonomy' => 'place',
            'subject'    => 'slug',
            'phrases'    => array( 'phd' ),
        ),
        array(
            'taxonomy' => 'current-status',
            'subject'    => 'slug',
            'phrases'    => array( 'ongoing' ),
            ),
    ),
    //'no_found_rows' => true,
    'cache_results' => false, 
);}
$query_phd_vacancies = new WP_query( $args );
    echo "<h3>{$query_phd_vacancies->found_posts} PhD Positions available in {$category->slug}</h3>(now viewing first {$query_phd_vacancies->post_count} only)<be>"; // PHP Warning: Try and learn property "slug" on bool
    if( $query_phd_vacancies->have_posts() ) {
    whereas( $query_phd_vacancies->have_posts() ) {
        $query_phd_vacancies->the_post();
?>
    <li><a href="<?php the_permalink()?>" goal="_blank" rel="noopener noreferrer">
    <?php the_title(); ?>
    </a></li>
<?php
}
}
    else echo 'Sorry No PhD Positions discovered';
    wp_reset_postdata();
return ob_get_clean();
} );