n filters. */ /** * Sets the product ID. * * @return string A product ID. */ function tripp_product_id() { return '44958368'; } add_filter( 'flextension_activation_id', 'tripp_product_id' ); add_filter( 'flextension_editor_page_id', 'tripp_get_page_id' ); add_filter( 'flextension_live_search_post_types', 'tripp_search_post_types' ); /** * Filters the template path for the Flextension module. * * @param string $path The template path. * @param string $name Template name. * @return string The template path. */ function tripp_template_path( $path = '', $name = '' ) { $path = "template-parts/{$name}"; return $path; } add_filter( 'flextension_template_dir_path', 'tripp_template_path', 10, 2 ); /** * Filters the Google Fonts variants. * * @param array $variants An array list of the font variants. * @return array An array list of the font variants. */ function tripp_google_fonts_variants( $variants = array() ) { $variants = array( '300', '400', '700', '300italic', '400italic', '700italic' ); return $variants; } add_filter( 'flextension_google_fonts_variants', 'tripp_google_fonts_variants' ); /** * Removes the placeholder and location from author description. */ remove_filter( 'get_the_author_description', 'flextension_author_description_placeholder', 5 ); /** * Add a Quick View link to exclude it from Single Page. * * @since 1.2.2 * * @param array $list An array object of the excluding list. * @return array New array object of the excluding list. */ function tripp_quick_view_exclude_links( $list = array() ) { if ( true === get_theme_mod( 'blog_quick_view_link', false ) ) { $links = array( '#tripp-quick-view' ); if ( isset( $list['links'] ) ) { $list['links'] = array_merge( (array) $list['links'], $links ); } else { $list['links'] = $links; } } return $list; } add_filter( 'tripp_xt_single_page_excluding_list', 'tripp_quick_view_exclude_links' ); /** * Filters the Categories widget attributes. * * @param array $attributes An array of the widget attributes. * @return array An array of the widget attributes. */ function tripp_categories_widget_attributes( $attributes ) { $attributes['image_size'] = 'thumbnail'; return $attributes; } add_filter( 'flextension_categories_widget_attributes', 'tripp_categories_widget_attributes' ); /** * Returns default settings for the featured media. * * @param array $args An array of the arguments to retrieve the featured media. * @param int|WP_Post $post Post ID or WP_Post object. * @return array An array of the arguments to retrieve the featured media. */ function tripp_featured_media_args( $args = array(), $post = 0 ) { $args['lightbox_size'] = 'tripp-fullwidth'; switch ( $args['type'] ) { case 'gallery': case 'slider': $args['type'] = 'slider'; if ( ! isset( $args['slider'] ) ) { $args['slider'] = array(); } if ( is_single( $post ) ) { $args['slider'] = wp_parse_args( $args['slider'], array( 'navigation' => true, ) ); } else { $args['slider'] = wp_parse_args( $args['slider'], array( 'show_count' => true, ) ); } break; case 'video': if ( ! isset( $args['video'] ) ) { $args['video'] = array(); } if ( is_single( $post ) ) { $args['video'] = wp_parse_args( $args['video'], array( 'autoplay' => 'visible', ) ); } else { $args['video'] = wp_parse_args( $args['video'], array( 'autoplay' => 'hover', ) ); } break; case 'audio': if ( ! isset( $args['audio'] ) ) { $args['audio'] = array(); } if ( is_single( $post ) ) { $args['audio'] = wp_parse_args( $args['audio'], array( 'autoplay' => 'visible', ) ); } else { $args['audio'] = wp_parse_args( $args['audio'], array( 'autoplay' => 'hover', ) ); } break; } return $args; } add_filter( 'flextension_featured_media_args', 'tripp_featured_media_args', 10, 2 ); /** * Filters the thumbnail size for the share content. * * @param string|array $size Thumbnail size. * @return string|array Thumbnail size. */ function tripp_share_content_thumbnail_size( $size ) { $size = 'tripp-large'; return $size; } add_filter( 'flextension_share_content_thumbnail_size', 'tripp_share_content_thumbnail_size' );