Skip to content

Commit

Permalink
updated: thumbnail upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-rafi committed Jan 26, 2022
1 parent 75d2678 commit 7b0daef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions includes/Admin/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public function create_product( $args ) {

$this->set_base_price( $product_id, ( $args['price'] / 100 ) );
$this->set_gumroad_short_url( $product_id, $args['short_url'] );
$this->set_product_featured_image( $product_id, $args['name'], $args['preview_url'] );
$product_image_url = $args['thumbnail_url'] ? $args['thumbnail_url'] : $args['preview_url'];
$this->set_product_featured_image( $product_id, $args['name'], $product_image_url );

return $product_id;
}
Expand All @@ -56,9 +57,11 @@ public function update_product( $product_id, $args ) {

$this->set_base_price( $product_id, ( $args['price'] / 100 ) );
$this->set_gumroad_short_url( $product_id, $args['short_url'] );
$this->set_product_featured_image( $product_id,
$product_image_url = $args['thumbnail_url'] ? $args['thumbnail_url'] : $args['preview_url'];
$this->set_product_featured_image(
$product_id,
$args['name'],
$args['preview_url'],
$product_image_url,
true
);

Expand Down
2 changes: 1 addition & 1 deletion includes/Admin/views/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<table class="form-table">
<tbody>
<tr>
<th>Gumroad access token [<a href="https://help.gumroad.com/article/280-create-application-api#Generatinganaccessto" title="Generating an access token">?</a>]</th>
<th>Gumroad access token [<a href="https://help.gumroad.com/article/280-create-application-api#Generatinganaccessto" title="Generating an access token" target="_blank">?</a>]</th>
<td>
<input type="text" value="<?php echo esc_attr(get_option('gumroad_http_token')); ?>" placeholder="Gumroad token" name="gumroad-http-token" id="gumroad-http-token" class="regular-text">
</td>
Expand Down

0 comments on commit 7b0daef

Please sign in to comment.