'boolean', 'show_in_rest' => true, 'default' => false, ) ); register_setting( 'pdfp_settings', 'bpm_gutenberg_enable', array( 'type' => 'boolean', 'show_in_rest' => true, 'default' => false, ) ); } /** * Register Menu */ function registerMenu() { $page_hook_suffix = add_submenu_page( 'edit.php?post_type=pdfposter', __( 'Settings', 'pdfp' ), __( 'Settings', 'pdfp' ), 'manage_options', 'settings', [$this, 'settings_callback'] ); add_action( "admin_print_scripts-{$page_hook_suffix}", [$this, 'eqnueueAssets'] ); global $submenu; $link = 'https://bplugins.com/products/pdf-poster/#pricing'; $submenu['edit.php?post_type=pdfposter'][] = array( 'Upgrade to PRO', 'manage_options', $link); } /** * Settings Page Callback */ function settings_callback() { echo '
'; } function eqnueueAssets() { wp_enqueue_script( 'pdfp-settings', PDFP_PLUGIN_DIR . 'dist/settings.js', array( 'wp-api', 'wp-i18n', 'wp-components', 'wp-element' ), PDFP_VER, true ); wp_enqueue_style( 'pdfp-settings', PDFP_PLUGIN_DIR . 'dist/settings.css', array( 'wp-components' ) ); } function admin_footer() { $screen = get_current_screen(); if($screen->post_type === 'pdfposter' || $screen->base === 'plugins'){ ?>