From b01f31a98ee0a572271c7575259bf3fd8c516846 Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Wed, 13 Mar 2024 17:27:49 +0100 Subject: [PATCH] added control if functions do not exitst --- includes/enable-svg.php | 11 ++++++----- includes/plugin-init-textdomain.php | 11 ++++++----- includes/stylesheet-public.php | 11 ++++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/includes/enable-svg.php b/includes/enable-svg.php index e115fe0..75d56e8 100644 --- a/includes/enable-svg.php +++ b/includes/enable-svg.php @@ -11,9 +11,10 @@ * @subpackage xarxaprod-wp-plugin/includes * @author Jorge - vitrubio.net */ - - function enable_mime_types( $mimes ) { - $mimes['svg'] = 'image/svg+xml'; - return $mimes; + if (! function_exists ('enable_mime_types') ){ + function enable_mime_types( $mimes ) { + $mimes['svg'] = 'image/svg+xml'; + return $mimes; + } + add_filter('upload_mimes', 'enable_mime_types'); } - add_filter('upload_mimes', 'enable_mime_types'); diff --git a/includes/plugin-init-textdomain.php b/includes/plugin-init-textdomain.php index a1011ad..d493e22 100644 --- a/includes/plugin-init-textdomain.php +++ b/includes/plugin-init-textdomain.php @@ -10,8 +10,9 @@ * @subpackage xarxaprod-wp-plugin/includes * @author Jorge - vitrubio.net */ - -function xarxaprod_wpplugin_init_textdomain() { - load_plugin_textdomain( 'xarxaprod-wpplugin-textdomain', null, plugin_dir_path( __FILE__ ).'/assets/languages/' ); -} -add_action('plugins_loaded', 'xarxaprod_wpplugin_init_textdomain'); + if (! function_exists ('xarxaprod_wpplugin_init_textdomain') ){ + function xarxaprod_wpplugin_init_textdomain() { + load_plugin_textdomain( 'xarxaprod-wpplugin-textdomain', null, plugin_dir_path( __FILE__ ).'/assets/languages/' ); + } + add_action('plugins_loaded', 'xarxaprod_wpplugin_init_textdomain'); + } diff --git a/includes/stylesheet-public.php b/includes/stylesheet-public.php index eb7b148..ffd5c15 100644 --- a/includes/stylesheet-public.php +++ b/includes/stylesheet-public.php @@ -11,8 +11,9 @@ * @subpackage xarxaprod_wp-plugin/includes * @author Jorge - vitrubio.net */ - -function xarxaprod_public_styles() { - add_editor_style( 'assets/css/xarxaprod-wpplugin-styles.css' ); -} -add_action( 'admin_init', 'xarxaprod_public_styles' ); + if (! function_exists ('xarxaprod_public_styles') ){ + function xarxaprod_public_styles() { + add_editor_style( 'assets/css/xarxaprod-wpplugin-styles.css' ); + } + add_action( 'admin_init', 'xarxaprod_public_styles' ); + }