shopp_add_category_image()

add a category image by filename

shopp_add_category_image ( $category, $file )

@param int $category Category id to attach the image asset to.
@param string $file Full or correct relative path to the image file.
@return mixed false on failure, int image asset id on success.

Description

Add a category image by filename.

Requires full path to the file on your filesystem, or a correct relative path from the WP_CONTENT_DIR. The file will be stored in the currently active storage engine.

Example

$file = '/path/to/file.jpg';

// add image to category 5
$id = shopp_add_category_image( 5, $file );

// display new image using named image setting 'showcase'
shopp( shopp_product_category(5), 'image', "id=$id&setting=showcase" );

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar