WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
Fetch Custom Image URL added to Categories Via Category Images (2 posts)

  1. evilopinions
    Member
    Posted 1 year ago #

    Hey,

    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 but it keeps giving me null.

    I modified the category.php controller by adding

    var $image; //string
    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;
    	$this->image = $wp_category->z_taxonomy_image_url;
      }

    http://wordpress.org/plugins/json-api/

  2. amarchauhan
    Member
    Posted 6 months ago #

    Im trying to do the same thing. have you figured it out yet?

    this would really help me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic