*/ class TICA_Team_Public { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of the plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; } /** * Register the stylesheets for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_styles() { wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/tica-team-public.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_scripts() { wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/tica-team-public.js', array( 'jquery' ), $this->version, false ); } public function team_list_sc() { $list = ''; $team_query = new WP_Query( [ 'post_type' => TICA_Team::POST_TYPE, 'orderby' => TICA_Team::DEFAULT_ORDERBY, 'order' => TICA_Team::DEFAULT_ORDER, 'posts_per_page' => -1, 'meta_query' => [ [ 'key' => TICA_Team::POST_TYPE . '_previous_intern', 'value' => 'y', 'compare' => '!=', ] ], ] ); $prev_team_query = new WP_Query( [ 'post_type' => TICA_Team::POST_TYPE, 'orderby' => TICA_Team::DEFAULT_ORDERBY, 'order' => TICA_Team::DEFAULT_ORDER, 'posts_per_page' => -1, 'meta_query' => [ [ 'key' => TICA_Team::POST_TYPE . '_previous_intern', 'value' => 'y', ] ], ] ); if ( $team_query->have_posts() || $prev_team_query->have_posts() ) { ob_start(); include plugin_dir_path( __FILE__ ) . 'partials/team-list-sc.php'; $list = ob_get_contents(); ob_end_clean(); } return $list; } }