51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
|
|
<?php
|
||
|
|
/**
|
||
|
|
* Plugin Name: CV Experience Blocks
|
||
|
|
* Description: Adds Gutenberg CV Experience blocks (Company + Positions)
|
||
|
|
* Version: 1.0.0
|
||
|
|
* Author: Andreas Andersen (Ansico)
|
||
|
|
* Author URI: https://ansico.dk/Ansico
|
||
|
|
* Plugin URI: https://ansico.dk/Ansico/CV-Experience-Blocks
|
||
|
|
* License: GPL3 or later
|
||
|
|
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||
|
|
*/
|
||
|
|
|
||
|
|
if (!defined('ABSPATH')) exit;
|
||
|
|
|
||
|
|
function cv_v1_register_blocks() {
|
||
|
|
|
||
|
|
wp_register_script(
|
||
|
|
'cv-v1-blocks',
|
||
|
|
plugins_url('block.js', __FILE__),
|
||
|
|
array('wp-blocks','wp-element','wp-block-editor','wp-components'),
|
||
|
|
filemtime(plugin_dir_path(__FILE__) . 'block.js')
|
||
|
|
);
|
||
|
|
|
||
|
|
wp_register_style(
|
||
|
|
'cv-v1-style',
|
||
|
|
plugins_url('style.css', __FILE__),
|
||
|
|
array(),
|
||
|
|
filemtime(plugin_dir_path(__FILE__) . 'style.css')
|
||
|
|
);
|
||
|
|
|
||
|
|
wp_register_style(
|
||
|
|
'cv-v1-editor',
|
||
|
|
plugins_url('editor.css', __FILE__),
|
||
|
|
array('wp-edit-blocks'),
|
||
|
|
filemtime(plugin_dir_path(__FILE__) . 'editor.css')
|
||
|
|
);
|
||
|
|
|
||
|
|
register_block_type('cv/company', [
|
||
|
|
'editor_script' => 'cv-v1-blocks',
|
||
|
|
'style' => 'cv-v1-style',
|
||
|
|
'editor_style' => 'cv-v1-editor',
|
||
|
|
]);
|
||
|
|
|
||
|
|
register_block_type('cv/position', [
|
||
|
|
'editor_script' => 'cv-v1-blocks',
|
||
|
|
'style' => 'cv-v1-style',
|
||
|
|
'editor_style' => 'cv-v1-editor',
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
add_action('init', 'cv_v1_register_blocks');
|