-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathback-to-top-block.php
36 lines (33 loc) · 1.02 KB
/
back-to-top-block.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Plugin Name: Back To Top Block
* Plugin URI: https://github.com/philhoyt/Back-to-Top-Block
* Description: Adds a customizable Back to Top button that helps visitors return to the top of the page.
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 1.0.2
* Author: Phil Hoyt
* Author URI: https://philhoyt.com
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: back-to-top-block
*
* @package back-to-top-block
*/
namespace BackToTopBlock;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Registers the Back to Top block type.
*
* This function is called during WordPress initialization to register
* the Back to Top block using the compiled assets from the build directory.
*
* @since 1.0.2
* @return void
*/
function back_to_top_block_init() {
register_block_type( __DIR__ . '/build' );
}
add_action( 'init', __NAMESPACE__ . '\\back_to_top_block_init' );