[Plugin: Front-end Editor] Use the_terms() to change the category
-
This is an amazing plugin. I believe it will evolve to a really powerfull tool.
Can someone explain how can i use the_terms field to change the category?
I tried to use it like this, but did not work:
<?php the_terms($post->ID,'category');?>
Is this possible or do i have to write a new filter? If so, this is what i did, but didnt work either:
// Handles the_category field class frontEd_category extends frontEd_basic { function wrap($content, $separator, $parents) { if ( empty($content) ) $content = self::placeholder(); else $content = str_replace('', '', $content); return parent::wrap($content); } function get($post_id) { $cats = get_the_category($post_id); if ( empty($cats) ) return; foreach ( $cats as &$cat ) $cat = $cat->name; return implode(', ', $cats); } function save($post_id, $cats) { wp_set_post_categories($post_id, $cats); $response = get_the_term_list($post_id, 'category', '', ', '); if ( empty($response) ) return self::placeholder(); return $response; } }
And this
'the_category' => array( 'title' => __('Post category', 'front-end-editor'), 'class' => 'frontEd_category', 'argc' => 3, ),
Thanks!
https://www.ads-software.com/extend/plugins/front-end-editor/
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘[Plugin: Front-end Editor] Use the_terms() to change the category’ is closed to new replies.