Add function from a plugin to the json model
-
Hello,
I have added a plugin which adds category images to the normal post category. I would like to output the category image URL to the API as a value. I modified the category.php controller by adding:
var $image;and by adding the following
function import_wp_object($wp_category) { $this->id = (int) $wp_category->term_id; $this->slug = $wp_category->slug; $this->title = $wp_category->name; $this->description = $wp_category->description; $this->parent = (int) $wp_category->parent; $this->post_count = (int) $wp_category->count; // image: $this->image = z_taxonomy_image_url($this->id); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Add function from a plugin to the json model’ is closed to new replies.