Changeset 2926513
- Timestamp:
- 06/15/2023 11:23:16 AM (3 years ago)
- Location:
- wallkit
- Files:
-
- 14 edited
- 1 copied
-
tags/3.1.7 (copied) (copied from wallkit/trunk)
-
tags/3.1.7/admin/class-wallkit-wp-admin.php (modified) (5 diffs)
-
tags/3.1.7/includes/class-wallkit-wp-access.php (modified) (1 diff)
-
tags/3.1.7/includes/class-wallkit-wp-settings.php (modified) (1 diff)
-
tags/3.1.7/includes/class-wallkit-wp.php (modified) (1 diff)
-
tags/3.1.7/public/js/wallkit-setup.js (modified) (1 diff)
-
tags/3.1.7/readme.txt (modified) (1 diff)
-
tags/3.1.7/wallkit-wp.php (modified) (2 diffs)
-
trunk/admin/class-wallkit-wp-admin.php (modified) (5 diffs)
-
trunk/includes/class-wallkit-wp-access.php (modified) (1 diff)
-
trunk/includes/class-wallkit-wp-settings.php (modified) (1 diff)
-
trunk/includes/class-wallkit-wp.php (modified) (1 diff)
-
trunk/public/js/wallkit-setup.js (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wallkit-wp.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wallkit/tags/3.1.7/admin/class-wallkit-wp-admin.php
r2901062 r2926513 529 529 public function action_add_meta_box( ) { 530 530 531 $selectedPostTypes = [ 'post'];531 $selectedPostTypes = []; 532 532 $registeredPostTypes = $this->collection->get_settings()->get_option("wk_check_post_type_access"); 533 533 if( !empty($registeredPostTypes) && $this->collection->get_settings()->get_option("wk_check_post_access") ) 534 534 { 535 $selectedPostTypes = array_ values( array_flip( array_filter($registeredPostTypes, function($post_type) { return $post_type; })) );535 $selectedPostTypes = array_keys( array_filter($registeredPostTypes, function($post_type) { return $post_type; }) ); 536 536 } 537 537 … … 541 541 542 542 add_meta_box( "wallkit-post-settings", "Wallkit Content", function(WP_Post $WP_Post) { 543 wp_nonce_field( basename( __FILE__ ), 'wkwp_meta_box_nonce' ); 543 544 ?> 544 545 <table> … … 561 562 562 563 <tr> 563 <td>Content Price:</td>564 <td><b><?php echo esc_html((number_format($Content["price"] / 100, 2))) ?> <?php echo esc_html((strtoupper($Content["currency"]))); ?></b></td>565 </tr>566 567 <tr>568 564 <td>Content Created:</td> 569 565 <td><b><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $Content["created_at"] ) ) ); ?></b></td> … … 576 572 <?php 577 573 } 574 575 $disablePaywall = get_post_meta($WP_Post->ID, 'disable_paywall_on_post', true); 578 576 ?> 577 579 578 <tr> 580 <td>Auto Sync:</td> 581 <td><b><?php 582 if($this->collection->get_settings()->get_option("wk_is_auto_sync")) {?> 583 ON <?php } 584 else { ?> OFF <?php } ?> 585 </b></td> 579 <td>Disable paywall:</td> 580 <td> 581 <input type="hidden" name="disable_paywall_on_post" value="0" /> 582 <input type="checkbox" name="disable_paywall_on_post" value="1" <?php checked( $disablePaywall, '1' ); ?>> 583 </td> 586 584 </tr> 587 <tr>588 <td>Access Granted:</td>589 <td><b><?php echo esc_html($Statistic["number_of_check_access_allow"]); ?></b></td>590 </tr>591 <tr>592 <td>Access Restricted:</td>593 <td><b><?php echo esc_html($Statistic["number_of_check_access_deny"]); ?></b></td>594 </tr>595 596 585 597 586 </table> … … 599 588 600 589 }, $selectedPostTypes, "side", "high", NULL ); 590 } 591 592 public function wkwp_meta_box_save( $post_id ) { 593 if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE || wp_is_post_autosave($post_id) ) { 594 return; 595 } 596 597 // verify nonce 598 if (!isset($_POST['wkwp_meta_box_nonce']) || !wp_verify_nonce($_POST['wkwp_meta_box_nonce'], basename(__FILE__))) { 599 return; 600 } 601 602 if ( isset($_POST['disable_paywall_on_post']) ) { 603 update_post_meta( $post_id, 'disable_paywall_on_post', $_POST['disable_paywall_on_post'] ); 604 } 601 605 } 602 606 -
wallkit/tags/3.1.7/includes/class-wallkit-wp-access.php
r2874245 r2926513 91 91 } 92 92 93 $disablePaywallOnPost = get_post_meta($WP_Post->ID, 'disable_paywall_on_post', true); 94 if($disablePaywallOnPost === '1') 95 { 96 return true; 97 } 98 93 99 try { 94 100 -
wallkit/tags/3.1.7/includes/class-wallkit-wp-settings.php
r2923962 r2926513 380 380 ); 381 381 382 //Selected post types for paywalled 383 $selectedPostTypes = []; 384 $registeredPostTypes = $this->get_option("wk_check_post_type_access"); 385 if( !empty($registeredPostTypes) && $this->get_option("wk_check_post_access") ) 386 { 387 $selectedPostTypes = array_keys( array_filter($registeredPostTypes, function($post_type) { return $post_type; }) ); 388 } 389 382 390 $settings['config'] = [ 383 391 'sign_in_button' => (bool) $this->get_option('wk_sign_in_button', true), 392 'check_post_types' => (array) $selectedPostTypes, 384 393 'reload_on_logout' => (bool) $this->get_option('wk_reload_on_logout', true), 385 394 'wk_free_paragraph' => (int) $this->get_option('wk_free_paragraph', 1), -
wallkit/tags/3.1.7/includes/class-wallkit-wp.php
r2916784 r2926513 251 251 252 252 $this->loader->add_action("add_meta_boxes", $plugin_admin, 'action_add_meta_box'); 253 254 $this->loader->add_action("save_post", $plugin_admin, 'wkwp_meta_box_save'); 253 255 254 256 $this->loader->add_action('wpwkp_task_create', $plugin_admin, 'action_create_task'); -
wallkit/tags/3.1.7/public/js/wallkit-setup.js
r2923962 r2926513 208 208 postPaywallBlock = document.createElement('div'); 209 209 postPaywallBlock.classList.add('wkwp-paywall-block'); 210 postPaywallBlock.insertAdjacentHTML('beforeend', wkPaywallBlock) 210 postPaywallBlock.insertAdjacentHTML('beforeend', wkPaywallBlock); 211 211 postContentBody.parentNode.insertBefore(postPaywallBlock, postContentBody); 212 212 } -
wallkit/tags/3.1.7/readme.txt
r2923962 r2926513 27 27 28 28 == Changelog == 29 30 = 3.1.7 = 31 *Release Date - 15 June 2023* 32 33 #### Updates including: 34 - Allow admins disable paywall on post. 29 35 30 36 = 3.1.6 = -
wallkit/tags/3.1.7/wallkit-wp.php
r2923962 r2926513 10 10 * Plugin URI: https://wallkit.net 11 11 * Description: A Plug & Play paid-content system to manage subscribers, gather fees and drive additional content sales. 12 * Version: 3.1. 612 * Version: 3.1.7 13 13 * Author: Wallkit <dev@wallkit.net> 14 14 * Author URI: https://wallkit.net/ … … 27 27 * Rename this for your plugin and update it as you release new versions. 28 28 */ 29 define( 'WPWKP_VERSION', '3.1. 6' );29 define( 'WPWKP_VERSION', '3.1.7' ); 30 30 31 31 /** -
wallkit/trunk/admin/class-wallkit-wp-admin.php
r2901062 r2926513 529 529 public function action_add_meta_box( ) { 530 530 531 $selectedPostTypes = [ 'post'];531 $selectedPostTypes = []; 532 532 $registeredPostTypes = $this->collection->get_settings()->get_option("wk_check_post_type_access"); 533 533 if( !empty($registeredPostTypes) && $this->collection->get_settings()->get_option("wk_check_post_access") ) 534 534 { 535 $selectedPostTypes = array_ values( array_flip( array_filter($registeredPostTypes, function($post_type) { return $post_type; })) );535 $selectedPostTypes = array_keys( array_filter($registeredPostTypes, function($post_type) { return $post_type; }) ); 536 536 } 537 537 … … 541 541 542 542 add_meta_box( "wallkit-post-settings", "Wallkit Content", function(WP_Post $WP_Post) { 543 wp_nonce_field( basename( __FILE__ ), 'wkwp_meta_box_nonce' ); 543 544 ?> 544 545 <table> … … 561 562 562 563 <tr> 563 <td>Content Price:</td>564 <td><b><?php echo esc_html((number_format($Content["price"] / 100, 2))) ?> <?php echo esc_html((strtoupper($Content["currency"]))); ?></b></td>565 </tr>566 567 <tr>568 564 <td>Content Created:</td> 569 565 <td><b><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $Content["created_at"] ) ) ); ?></b></td> … … 576 572 <?php 577 573 } 574 575 $disablePaywall = get_post_meta($WP_Post->ID, 'disable_paywall_on_post', true); 578 576 ?> 577 579 578 <tr> 580 <td>Auto Sync:</td> 581 <td><b><?php 582 if($this->collection->get_settings()->get_option("wk_is_auto_sync")) {?> 583 ON <?php } 584 else { ?> OFF <?php } ?> 585 </b></td> 579 <td>Disable paywall:</td> 580 <td> 581 <input type="hidden" name="disable_paywall_on_post" value="0" /> 582 <input type="checkbox" name="disable_paywall_on_post" value="1" <?php checked( $disablePaywall, '1' ); ?>> 583 </td> 586 584 </tr> 587 <tr>588 <td>Access Granted:</td>589 <td><b><?php echo esc_html($Statistic["number_of_check_access_allow"]); ?></b></td>590 </tr>591 <tr>592 <td>Access Restricted:</td>593 <td><b><?php echo esc_html($Statistic["number_of_check_access_deny"]); ?></b></td>594 </tr>595 596 585 597 586 </table> … … 599 588 600 589 }, $selectedPostTypes, "side", "high", NULL ); 590 } 591 592 public function wkwp_meta_box_save( $post_id ) { 593 if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE || wp_is_post_autosave($post_id) ) { 594 return; 595 } 596 597 // verify nonce 598 if (!isset($_POST['wkwp_meta_box_nonce']) || !wp_verify_nonce($_POST['wkwp_meta_box_nonce'], basename(__FILE__))) { 599 return; 600 } 601 602 if ( isset($_POST['disable_paywall_on_post']) ) { 603 update_post_meta( $post_id, 'disable_paywall_on_post', $_POST['disable_paywall_on_post'] ); 604 } 601 605 } 602 606 -
wallkit/trunk/includes/class-wallkit-wp-access.php
r2874245 r2926513 91 91 } 92 92 93 $disablePaywallOnPost = get_post_meta($WP_Post->ID, 'disable_paywall_on_post', true); 94 if($disablePaywallOnPost === '1') 95 { 96 return true; 97 } 98 93 99 try { 94 100 -
wallkit/trunk/includes/class-wallkit-wp-settings.php
r2923962 r2926513 380 380 ); 381 381 382 //Selected post types for paywalled 383 $selectedPostTypes = []; 384 $registeredPostTypes = $this->get_option("wk_check_post_type_access"); 385 if( !empty($registeredPostTypes) && $this->get_option("wk_check_post_access") ) 386 { 387 $selectedPostTypes = array_keys( array_filter($registeredPostTypes, function($post_type) { return $post_type; }) ); 388 } 389 382 390 $settings['config'] = [ 383 391 'sign_in_button' => (bool) $this->get_option('wk_sign_in_button', true), 392 'check_post_types' => (array) $selectedPostTypes, 384 393 'reload_on_logout' => (bool) $this->get_option('wk_reload_on_logout', true), 385 394 'wk_free_paragraph' => (int) $this->get_option('wk_free_paragraph', 1), -
wallkit/trunk/includes/class-wallkit-wp.php
r2916784 r2926513 251 251 252 252 $this->loader->add_action("add_meta_boxes", $plugin_admin, 'action_add_meta_box'); 253 254 $this->loader->add_action("save_post", $plugin_admin, 'wkwp_meta_box_save'); 253 255 254 256 $this->loader->add_action('wpwkp_task_create', $plugin_admin, 'action_create_task'); -
wallkit/trunk/public/js/wallkit-setup.js
r2923962 r2926513 208 208 postPaywallBlock = document.createElement('div'); 209 209 postPaywallBlock.classList.add('wkwp-paywall-block'); 210 postPaywallBlock.insertAdjacentHTML('beforeend', wkPaywallBlock) 210 postPaywallBlock.insertAdjacentHTML('beforeend', wkPaywallBlock); 211 211 postContentBody.parentNode.insertBefore(postPaywallBlock, postContentBody); 212 212 } -
wallkit/trunk/readme.txt
r2923962 r2926513 27 27 28 28 == Changelog == 29 30 = 3.1.7 = 31 *Release Date - 15 June 2023* 32 33 #### Updates including: 34 - Allow admins disable paywall on post. 29 35 30 36 = 3.1.6 = -
wallkit/trunk/wallkit-wp.php
r2923962 r2926513 10 10 * Plugin URI: https://wallkit.net 11 11 * Description: A Plug & Play paid-content system to manage subscribers, gather fees and drive additional content sales. 12 * Version: 3.1. 612 * Version: 3.1.7 13 13 * Author: Wallkit <dev@wallkit.net> 14 14 * Author URI: https://wallkit.net/ … … 27 27 * Rename this for your plugin and update it as you release new versions. 28 28 */ 29 define( 'WPWKP_VERSION', '3.1. 6' );29 define( 'WPWKP_VERSION', '3.1.7' ); 30 30 31 31 /**
Note: See TracChangeset
for help on using the changeset viewer.