Plugin Directory

Changeset 2306325


Ignore:
Timestamp:
05/16/2020 05:05:30 PM (6 years ago)
Author:
transact
Message:

don't show transact button if no premium blocks

Location:
transact
Files:
5 edited
12 copied

Legend:

Unmodified
Added
Removed
  • transact/tags/4.2.4/frontend/assets/style.css

    r2264115 r2306325  
    66  z-index: 1;
    77  text-align: center;
     8  display: none;
     9}
     10.transact-purchase_button.active {
     11  display: block;
    812}
    913.transact-purchase_button.transact-fade {
  • transact/tags/4.2.4/frontend/assets/transact_post.js

    r2264115 r2306325  
    141141                    reloadKnownScripts();
    142142                } else {
     143                    if(data.has_premium) {
     144                        jQuery('.transact-purchase_button').addClass('active');
     145                    }
     146
    143147                    gtmEvent('view-preview-content');
    144148                }
  • transact/tags/4.2.4/frontend/controllers/transact-single-post.php

    r2266126 r2306325  
    4646    protected $post_id;
    4747
     48    protected $post_has_premium = false;
    4849    protected static $instance = NULL;
    4950
     
    337338            $premium = $transact->is_premium();
    338339
     340            $post_object = get_post($post_id);
     341
     342            $premium_from_meta = $transact->get_premium_content();
     343            $has_premium = (isset($premium_from_meta) && $premium_from_meta !== '') || ($post_object && strpos($post_object->post_content, 'transact/premium-content') > -1);
     344
    339345            $result = array(
    340                 'is_premium' => $premium
     346                'is_premium' => $premium,
     347                'has_premium' => $has_premium
    341348            );
    342349            if($premium) {
    343350                $button_controller = new transactHandleButtons($post_id, $transact);
    344                 $premium_from_meta = $transact->get_premium_content();
    345                 $post_object = get_post($post_id);
    346351                global $post;
    347352                // Must set the global $post object here as well because some plugins rely on it to add data in their the_content filters
  • transact/tags/4.2.4/readme.txt

    r2269448 r2306325  
    66Requires PHP: 5.6
    77Tested up to: 5.3.2
    8 Stable tag: 4.2.3
     8Stable tag: 4.2.4
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8181== Changelog ==
    8282
     83= 4.2.4 =
     84* Don't show purchase button if post has no premium blocks or premium content
     85
    8386= 4.2.3 =
    8487* Fix with price of 0
  • transact/tags/4.2.4/transact-plugin.php

    r2269448 r2306325  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 4.2.3
     5 * Version: 4.2.4
    66 * Author: transact.io
    77 * Author URI: https://transact.io
  • transact/trunk/frontend/assets/style.css

    r2264115 r2306325  
    66  z-index: 1;
    77  text-align: center;
     8  display: none;
     9}
     10.transact-purchase_button.active {
     11  display: block;
    812}
    913.transact-purchase_button.transact-fade {
  • transact/trunk/frontend/assets/transact_post.js

    r2264115 r2306325  
    141141                    reloadKnownScripts();
    142142                } else {
     143                    if(data.has_premium) {
     144                        jQuery('.transact-purchase_button').addClass('active');
     145                    }
     146
    143147                    gtmEvent('view-preview-content');
    144148                }
  • transact/trunk/frontend/controllers/transact-single-post.php

    r2266126 r2306325  
    4646    protected $post_id;
    4747
     48    protected $post_has_premium = false;
    4849    protected static $instance = NULL;
    4950
     
    337338            $premium = $transact->is_premium();
    338339
     340            $post_object = get_post($post_id);
     341
     342            $premium_from_meta = $transact->get_premium_content();
     343            $has_premium = (isset($premium_from_meta) && $premium_from_meta !== '') || ($post_object && strpos($post_object->post_content, 'transact/premium-content') > -1);
     344
    339345            $result = array(
    340                 'is_premium' => $premium
     346                'is_premium' => $premium,
     347                'has_premium' => $has_premium
    341348            );
    342349            if($premium) {
    343350                $button_controller = new transactHandleButtons($post_id, $transact);
    344                 $premium_from_meta = $transact->get_premium_content();
    345                 $post_object = get_post($post_id);
    346351                global $post;
    347352                // Must set the global $post object here as well because some plugins rely on it to add data in their the_content filters
  • transact/trunk/readme.txt

    r2269448 r2306325  
    66Requires PHP: 5.6
    77Tested up to: 5.3.2
    8 Stable tag: 4.2.3
     8Stable tag: 4.2.4
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8181== Changelog ==
    8282
     83= 4.2.4 =
     84* Don't show purchase button if post has no premium blocks or premium content
     85
    8386= 4.2.3 =
    8487* Fix with price of 0
  • transact/trunk/transact-plugin.php

    r2269448 r2306325  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 4.2.3
     5 * Version: 4.2.4
    66 * Author: transact.io
    77 * Author URI: https://transact.io
Note: See TracChangeset for help on using the changeset viewer.