fix merge conflict
This commit is contained in:
parent
2ada6bffcf
commit
fb3a829d3d
3 changed files with 25 additions and 6 deletions
|
|
@ -1,5 +1,25 @@
|
|||
snippet pf "public function ..."
|
||||
public function $1($2) {
|
||||
$0
|
||||
$0
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet wpregblock "function register_block() { ..."
|
||||
function ${1:plugin_name}_register_block() {
|
||||
|
||||
// automatically load dependencies and version
|
||||
$asset_file = include( plugin_dir_path( __FILE__ ) . '$2/build/index.asset.php');
|
||||
|
||||
wp_register_script(
|
||||
'${1/_/-/g}-${2:block-name}',
|
||||
plugins_url( '$2/build/block.js', __FILE__ ),
|
||||
$asset_file['dependencies'],
|
||||
$asset_file['version']
|
||||
);
|
||||
|
||||
register_block_type( '${3:namespace}/${1/_/-/g}-$2',
|
||||
array( 'editor_script' => '${1/_/-/g}-$2',) );
|
||||
|
||||
}
|
||||
add_action( 'init', '$1_register_block' );
|
||||
endsnippet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue