' . "\n"; echo "\t" . '' . "\n"; echo "\t" . '' . "\n"; if ( $type == 'text' ) { ?>

/> ' . "\n"; echo '' . "\n"; } /** * Show the SEO inputs for term. * * @param object $term Term to show the edit boxes for. */ function term_seo_form( $term ) { $tax_meta = get_option( 'wpseo_taxonomy_meta' ); $options = get_wpseo_options(); if ( isset( $tax_meta[$term->taxonomy][$term->term_id] ) ) $tax_meta = $tax_meta[$term->taxonomy][$term->term_id]; echo '

' . __( 'Yoast WordPress SEO Settings', 'wordpress-seo' ) . '

'; echo ''; $this->form_row( 'wpseo_title', __( 'SEO Title', 'wordpress-seo' ), __( 'The SEO title is used on the archive page for this term.', 'wordpress-seo' ), $tax_meta ); $this->form_row( 'wpseo_desc', __( 'SEO Description', 'wordpress-seo' ), __( 'The SEO description is used for the meta description on the archive page for this term.', 'wordpress-seo' ), $tax_meta ); if ( isset( $options['usemetakeywords'] ) && $options['usemetakeywords'] ) $this->form_row( 'wpseo_metakey', __( 'Meta Keywords', 'wordpress-seo' ), __( 'Meta keywords used on the archive page for this term.', 'wordpress-seo' ), $tax_meta ); $this->form_row( 'wpseo_canonical', __( 'Canonical', 'wordpress-seo' ), __( 'The canonical link is shown on the archive page for this term.', 'wordpress-seo' ), $tax_meta ); $this->form_row( 'wpseo_bctitle', __( 'Breadcrumbs Title', 'wordpress-seo' ), sprintf( __( 'The Breadcrumbs title is used in the breadcrumbs where this %s appears.', 'wordpress-seo' ), $term->taxonomy ), $tax_meta ); if ( isset( $tax_meta['wpseo_noindex'] ) && $tax_meta['wpseo_noindex'] == 'on' ) $tax_meta['wpseo_noindex'] = 'noindex'; $current = ( isset( $options['noindex-' . $term->taxonomy] ) && $options['noindex-' . $term->taxonomy] ) ? 'noindex' : 'index'; $noindex_options = array( 'default' => sprintf( __( 'Use %s default (Currently: %s)', 'wordpress-seo' ), $term->taxonomy, $current ), 'index' => __( 'Always index', 'wordpress-seo' ), 'noindex' => __( 'Always noindex', 'wordpress-seo' ) ); $this->form_row( 'wpseo_noindex', sprintf( __( 'Noindex this %s', 'wordpress-seo' ), $term->taxonomy ), sprintf( __( 'This %s follows the indexation rules set under Metas and Titles, you can override it here.', 'wordpress-seo' ), $term->taxonomy ), $tax_meta, 'select', $noindex_options ); $this->form_row( 'wpseo_sitemap_include', __( 'Include in sitemap?', 'wordpress-seo' ), '', $tax_meta, 'select', array( "-" => __( "Auto detect", 'wordpress-seo' ), "always" => __( "Always include", 'wordpress-seo' ), "never" => __( "Never include", 'wordpress-seo' ), ) ); echo '
'; } /** * Update the taxonomy meta data on save. * * @param int $term_id ID of the term to save data for * @param int $tt_id The taxonomy_term_id for the term. * @param string $taxonomy The taxonmy the term belongs to. */ function update_term( $term_id, $tt_id, $taxonomy ) { $tax_meta = get_option( 'wpseo_taxonomy_meta' ); foreach ( array( 'title', 'desc', 'metakey', 'bctitle', 'canonical', 'noindex', 'sitemap_include' ) as $key ) { if ( isset( $_POST['wpseo_' . $key] ) ) $tax_meta[$taxonomy][$term_id]['wpseo_' . $key] = $_POST['wpseo_' . $key]; } update_option( 'wpseo_taxonomy_meta', $tax_meta ); if ( defined( 'W3TC_DIR' ) && class_exists( 'W3_ObjectCache' ) ) { require_once W3TC_DIR . '/lib/W3/ObjectCache.php'; $w3_objectcache = &W3_ObjectCache::instance(); $w3_objectcache->flush(); } } /** * Allows HTML in descriptions */ function custom_category_descriptions_allow_html() { $filters = array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ); foreach ( $filters as $filter ) { remove_filter( $filter, 'wp_filter_kses' ); } remove_filter( 'term_description', 'wp_kses_data' ); } /** * Adds shortcode support to category descriptions. * * @param string $desc String to add shortcodes in. * @return string */ function custom_category_descriptions_add_shortcode_support( $desc ) { return do_shortcode( $desc ); } } $wpseo_taxonomy = new WPSEO_Taxonomy();