diff --git a/disable-shortcode-pasting.php b/disable-shortcode-pasting.php index ad0f14c..9412930 100644 --- a/disable-shortcode-pasting.php +++ b/disable-shortcode-pasting.php @@ -3,12 +3,15 @@ * Plugin Name: Disable Shortcode Pasting in Plain Text Blocks * Description: Prevents automatic shortcode blocks from being inserted when pasting into plain text blocks like paragraphs or headings. * Version: 1.0 - * Author: Your Name + * Author: Joel Schlotterer * License: GPLv2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html */ -function dsp_enqueue_block_editor_assets() { +namespace Flexline\DisableShortcodePasting; + +// Enqueue the block editor script +function enqueue_block_editor_assets() { wp_enqueue_script( 'dsp-shortcode-paste-handler', plugin_dir_url(__FILE__) . 'shortcode-paste-handler.js', @@ -18,4 +21,4 @@ function dsp_enqueue_block_editor_assets() { ); } -add_action('enqueue_block_editor_assets', 'dsp_enqueue_block_editor_assets'); +add_action('enqueue_block_editor_assets', __NAMESPACE__ . '\\enqueue_block_editor_assets');