From 0db0a94eafeef356a883bf1a5e1d277112fe2283 Mon Sep 17 00:00:00 2001 From: Joel Schlotterer <103943917+schlotterer@users.noreply.github.com> Date: Sat, 24 Aug 2024 17:24:59 -0500 Subject: [PATCH] Update disable-shortcode-pasting.php --- disable-shortcode-pasting.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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');