32
32
require_once PIXALB_ACCORDION_BLOCK_PATH . 'vendor/autoload.php ' ;
33
33
}
34
34
35
- $ updater = PucFactory::buildUpdateChecker (
35
+ PucFactory::buildUpdateChecker (
36
36
'https://github.com/pixelalbatross/accordion-block/ ' ,
37
37
__FILE__ ,
38
38
'accordion-block '
39
- );
40
-
41
- $ updater ->setBranch ( 'main ' );
39
+ )->setBranch ( 'main ' );
42
40
43
41
/**
44
42
* Registers the block using the metadata loaded from the `block.json` file.
47
45
*
48
46
* @see https://developer.wordpress.org/reference/functions/register_block_type/
49
47
*/
50
- function accordion_block_init () {
48
+ function init () {
51
49
52
50
$ block_json_files = glob ( PIXALB_ACCORDION_BLOCK_PATH . 'build/*/block.json ' );
53
51
@@ -67,24 +65,24 @@ function accordion_block_init() {
67
65
}
68
66
}
69
67
}
70
- add_action ( 'init ' , __NAMESPACE__ . '\accordion_block_init ' );
68
+ add_action ( 'init ' , __NAMESPACE__ . '\init ' );
71
69
72
70
/**
73
71
* Registers the block textdomain.
74
72
*
75
73
* @return void
76
74
*/
77
- function accordion_block_i18n () {
75
+ function i18n () {
78
76
load_plugin_textdomain ( 'accordion-block ' , false , plugin_basename ( PIXALB_ACCORDION_BLOCK_PATH ) . '/languages ' );
79
77
}
80
- add_action ( 'plugins_loaded ' , __NAMESPACE__ . '\accordion_block_i18n ' );
78
+ add_action ( 'init ' , __NAMESPACE__ . '\i18n ' );
81
79
82
80
/**
83
81
* Handles JavaScript detection.
84
82
*
85
83
* Adds a `js` class to the root `<html>` element when JavaScript is detected.
86
84
*/
87
- function accordion_block_js_detection () {
85
+ function js_detection () {
88
86
echo "<script>!function(s){s.classList.contains('js')?s.classList:s.classList.add('js')}(document.documentElement);</script> \n" ;
89
87
}
90
- add_action ( 'wp_head ' , __NAMESPACE__ . '\accordion_block_js_detection ' , 0 );
88
+ add_action ( 'wp_head ' , __NAMESPACE__ . '\js_detection ' , 0 );
0 commit comments