GRAYBYTE WORDPRESS FILE MANAGER6474

Server IP : 162.213.255.40 / Your IP : 216.73.216.149
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/updraft/plugins-old/jetpack/extensions/blocks/tock/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/updraft/plugins-old/jetpack/extensions/blocks/tock//tock.php
<?php
/**
 * Tock Block.
 *
 * @since 12.3
 *
 * @package automattic/jetpack
 */

namespace Automattic\Jetpack\Extensions\Tock;

use Automattic\Jetpack\Blocks;
use Jetpack_Gutenberg;

/**
 * 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() {
	Blocks::jetpack_register_block(
		__DIR__,
		array( 'render_callback' => __NAMESPACE__ . '\render_block' )
	);
}
add_action( 'init', __NAMESPACE__ . '\register_block' );

/**
 * Render the widget and associated JS
 *
 * @param array $attr    The block attributes.
 */
function render_block( $attr ) {
	$content = '<div id="Tock_widget_container" data-tock-display-mode="Button" data-tock-color-mode="Blue" data-tock-locale="en-us" data-tock-timezone="America/New_York"></div>';
	if ( empty( $attr['url'] ) ) {
		if ( ! current_user_can( 'edit_posts' ) ) {
			return;
		}

		return Jetpack_Gutenberg::notice(
			__( 'The block will not be shown to your site visitors until a Tock business name is set.', 'jetpack' ),
			'warning',
			Blocks::classes( Blocks::get_block_feature( __DIR__ ), $attr )
		);
	}

	wp_enqueue_script( 'tock-widget', 'https://www.exploretock.com/tock.js', array(), JETPACK__VERSION, true );

	// Add CSS to hide direct link.
	Jetpack_Gutenberg::load_assets_as_required( __DIR__ );

	wp_add_inline_script(
		'tock-widget',
		"!function(t,o){if(!t.tock){var e=t.tock=function(){e.callMethod?
		  e.callMethod.apply(e,arguments):e.queue.push(arguments)};t._tock||(t._tock=e),
		  e.push=e,e.loaded=!0,e.version='1.0',e.queue=[];}}(window,document);
			tock('init', '" . esc_js( $attr['url'] ) . "');",
		'before'
	);
	return sprintf(
		'<div class="%1$s">%2$s</div>',
		esc_attr( Blocks::classes( Blocks::get_block_feature( __DIR__ ), $attr ) ),
		$content
	);
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:27
hellrfbn / hellrfbn
0644
tock.php
1.789 KB
June 11 2024 05:16:28
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF