permalink-manager-actions.php
7 years ago
permalink-manager-admin-functions.php
7 years ago
permalink-manager-core-functions.php
7 years ago
permalink-manager-gutenberg.php
7 years ago
permalink-manager-helper-functions.php
7 years ago
permalink-manager-third-parties.php
7 years ago
permalink-manager-uri-functions-post.php
7 years ago
permalink-manager-gutenberg.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Additional hooks for "Permalink Manager Pro" |
| 5 | */ |
| 6 | class Permalink_Manager_Gutenberg extends Permalink_Manager_Class { |
| 7 | |
| 8 | public function __construct() { |
| 9 | add_action('enqueue_block_editor_assets', array($this, 'init')); |
| 10 | } |
| 11 | |
| 12 | public function init() { |
| 13 | // add_action('enqueue_block_editor_assets', array($this, 'pm_gutenberg_scripts')); |
| 14 | add_meta_box('permalink-manager', __('Permalink Manager', 'permalink-manager'), array($this, 'meta_box'), '', 'side', 'high' ); |
| 15 | } |
| 16 | |
| 17 | public function pm_gutenberg_scripts() { |
| 18 | wp_enqueue_script('permalink-manager-gutenberg', PERMALINK_MANAGER_URL . '/out/permalink-manager-gutenberg.js', array('wp-blocks', 'wp-element', 'wp-components', 'wp-i18n'), PERMALINK_MANAGER_VERSION, true); |
| 19 | } |
| 20 | |
| 21 | public function meta_box($post) { |
| 22 | global $permalink_manager_uris; |
| 23 | |
| 24 | if(empty($post->ID)) { |
| 25 | return ''; |
| 26 | } |
| 27 | |
| 28 | // Display URI Editor |
| 29 | echo Permalink_Manager_Admin_Functions::display_uri_box($post, true); |
| 30 | } |
| 31 | |
| 32 | } |
| 33 | |
| 34 | ?> |
| 35 |