$tag_settings['show_breadcrumbs'], 'current_page_id' => ! empty( $pages_settings['tag'] ) ? (int) $pages_settings['tag'] : 0, 'show_episodes' => $tag_settings['show_episodes'], 'episodes_title' => $tag_settings['episodes_title'] ); $attributes = shortcode_atts( $defaults, $atts, 'aiopod_tag' ); // Enqueue dependencies wp_enqueue_style( AIOPOD_PLUGIN_SLUG . '-public' ); wp_enqueue_script( AIOPOD_PLUGIN_SLUG . '-public' ); // Process output ob_start(); include apply_filters( 'aiopod_load_template', AIOPOD_PLUGIN_DIR . 'public/templates/single-tag.php', $attributes ); $content = ob_get_clean(); } else { $content = do_shortcode( '[aiopod_tags]' ); } return $content; } /** * Render the shortcode [aiopod_tags]. * * @since 1.0.0 * @param array $atts An associative array of attributes. */ public function render_shortcode_tags( $atts ) { // Vars $attributes = shortcode_atts( $this->get_defaults(), $atts, 'aiopod_tags' ); $attributes['shortcode'] = 'aiopod_tags'; if ( ! in_array( $attributes['layout'], array( 'cloud', 'list', 'dropdown' ) ) ) { $attributes['layout'] = 'cloud'; } // Enqueue dependencies wp_enqueue_style( AIOPOD_PLUGIN_SLUG . '-public' ); wp_enqueue_script( AIOPOD_PLUGIN_SLUG . '-public' ); // Process output ob_start(); include apply_filters( 'aiopod_load_template', AIOPOD_PLUGIN_DIR . 'public/templates/tags/tags-' . sanitize_file_name( $attributes['layout'] ) . '.php', $attributes ); return ob_get_clean(); } /** * Get the default shortcode attribute values. * * @since 1.0.0 * @return array $atts An associative array of attributes. */ public function get_defaults() { if ( empty( $this->defaults ) ) { $fields = aiopod_get_shortcode_fields(); foreach ( $fields['tags']['sections'] as $section ) { foreach ( $section['fields'] as $field ) { $this->defaults[ $field['name'] ] = $field['value']; } } $this->defaults['source'] = 'tags'; $this->defaults['title'] = ''; $this->defaults['include'] = ''; $this->defaults['exclude'] = ''; $this->defaults['hide_if_empty'] = 0; } return $this->defaults; } }