themes->get_item( $theme_id ); } catch ( InvalidArgumentException $e ) { // Return empty object return new PUM_Model_Theme( $theme_id ); } } /** * Queries themes and returns them in a specific format. * * @param array $args * * @return PUM_Model_Theme[] */ function pum_get_themes( $args = array() ) { return pum()->themes->get_items( $args ); } /** * Queries themes and returns them in a specific format. * * @param array $args * * @return PUM_Model_Theme[] */ function pum_get_all_themes( $args = array() ) { $args['posts_per_page'] = -1; return pum_get_themes( $args ); } /** * Gets a count themes with specified args. * * @param array $args * * @return int */ function pum_count_themes( $args = array() ) { $args = wp_parse_args( $args, array( 'post_status' => 'publish', ) ); return pum()->themes->count_items( $args ); }