' . "\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 '';
}
/**
* 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();
|