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 12 months 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 2 weeks ago #

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

    this would really help me.

Reply

You must log in to post.

About this Plugin

About this Topic