added control if functions do not exitst

This commit is contained in:
jorge 2024-03-13 17:27:49 +01:00
parent 5d183925c5
commit b01f31a98e
3 changed files with 18 additions and 15 deletions

View File

@ -11,9 +11,10 @@
* @subpackage xarxaprod-wp-plugin/includes * @subpackage xarxaprod-wp-plugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net> * @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/ */
if (! function_exists ('enable_mime_types') ){
function enable_mime_types( $mimes ) { function enable_mime_types( $mimes ) {
$mimes['svg'] = 'image/svg+xml'; $mimes['svg'] = 'image/svg+xml';
return $mimes; return $mimes;
} }
add_filter('upload_mimes', 'enable_mime_types'); add_filter('upload_mimes', 'enable_mime_types');
}

View File

@ -10,8 +10,9 @@
* @subpackage xarxaprod-wp-plugin/includes * @subpackage xarxaprod-wp-plugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net> * @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/ */
if (! function_exists ('xarxaprod_wpplugin_init_textdomain') ){
function xarxaprod_wpplugin_init_textdomain() { function xarxaprod_wpplugin_init_textdomain() {
load_plugin_textdomain( 'xarxaprod-wpplugin-textdomain', null, plugin_dir_path( __FILE__ ).'/assets/languages/' ); load_plugin_textdomain( 'xarxaprod-wpplugin-textdomain', null, plugin_dir_path( __FILE__ ).'/assets/languages/' );
} }
add_action('plugins_loaded', 'xarxaprod_wpplugin_init_textdomain'); add_action('plugins_loaded', 'xarxaprod_wpplugin_init_textdomain');
}

View File

@ -11,8 +11,9 @@
* @subpackage xarxaprod_wp-plugin/includes * @subpackage xarxaprod_wp-plugin/includes
* @author Jorge - vitrubio.net <jorge@vitrubio.net> * @author Jorge - vitrubio.net <jorge@vitrubio.net>
*/ */
if (! function_exists ('xarxaprod_public_styles') ){
function xarxaprod_public_styles() { function xarxaprod_public_styles() {
add_editor_style( 'assets/css/xarxaprod-wpplugin-styles.css' ); add_editor_style( 'assets/css/xarxaprod-wpplugin-styles.css' );
} }
add_action( 'admin_init', 'xarxaprod_public_styles' ); add_action( 'admin_init', 'xarxaprod_public_styles' );
}