| 1 |
<?php |
| 2 |
/** |
| 3 |
* Builder Plugin Compatibility Code |
| 4 |
* |
| 5 |
* @package Themify_Builder |
| 6 |
* @subpackage Themify_Builder/classes |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* ARMember - Complete Membership Plugin |
| 11 |
* @link https://www.armemberplugin.com/ |
| 12 |
*/ |
| 13 |
class Themify_Builder_Plugin_Compat_ARMember { |
| 14 |
|
| 15 |
static function init() { |
| 16 |
add_filter( 'themify_builder_display', array( __CLASS__, 'themify_builder_display' ), 10, 2 ); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Show Builder contents only if user has access |
| 21 |
*/ |
| 22 |
public static function themify_builder_display( bool $display,?int $post_id ):bool { |
| 23 |
global $arm_pay_per_post_feature; |
| 24 |
if ( ! empty( $arm_pay_per_post_feature->isPayPerPostFeature ) ) { |
| 25 |
$result = $arm_pay_per_post_feature->arm_paid_post_content_check_restriction( '' ); // this function returns a message string if content is restricted, returns original string if not. |
| 26 |
if ( ! empty( $result ) ) { |
| 27 |
$display = false; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
return $display; |
| 32 |
} |
| 33 |
} |