我正在使用一小段代码(经过修改,原来是插件分类术语列表)在帖子后显示自定义分类,
显示术语时,将显示一个href
标签我不想让这些术语成为链接,我只想要简单的术语文本。
我怎样才能得到它?
这是我当前的代码:
if( !function_exists( \'pr\' ) ) {
function pr1( $var ) {
print \'<pre>\' . print_r( $var, true ) . \'</pre>\';
}
}
if( !function_exists( \'mfields_taxonomy_terms_list1\' ) ) {
function mfields_taxonomy_terms_list1( $c ) {
global $post;
$o = \'\';
$terms = array();
$lists = array();
$custom_taxonomy_names = array();
$custom_taxonomies = mfields_get_custom_taxonomies1();
if( !empty( $custom_taxonomies ) )
foreach( $custom_taxonomies as $name => $config )
$custom_taxonomy_names[] = $config->name;
if( !empty( $custom_taxonomy_names ) )
$terms = get_terms( $custom_taxonomy_names );
foreach( $custom_taxonomies as $name => $config )
$o.= get_the_term_list( $post->ID, $name, $before = \'\', $sep = \' | \', $after = \'\' );
if( is_single() )
return $c . $o;
return $c;
}
add_shortcode(\'terms1\', \'mfields_taxonomy_terms_list1\');
}
if( !function_exists( \'mfields_get_custom_taxonomies1\' ) ) {
function mfields_get_custom_taxonomies1( ) {
global $wp_taxonomies;
$custom_taxonomies = array();
$default_taxonomies = array( \'post_tag\', \'category\', \'link_category\' );
foreach( $wp_taxonomies as $slug => $config )
if( !in_array( $slug, $default_taxonomies ) )
$custom_taxonomies[$slug] = $config;
return $custom_taxonomies;
}
}
add_action( \'wp_print_scripts\', \'enqueue_slideout\' );