/** * Spexo functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package Spexo */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } $tmpcoder_theme = (is_object(wp_get_theme()->parent())) ? wp_get_theme()->parent() : wp_get_theme(); define('TMPCODER_THEME_NAME', $tmpcoder_theme->get( 'Name' )); if ( ! defined( 'TMPCODER_THEME_SLUG' ) ) { define( 'TMPCODER_THEME_SLUG', $tmpcoder_theme->get( 'TextDomain' ) ); } if ( ! defined( 'TMPCODER_THEME_CORE_VERSION' ) ) { define( 'TMPCODER_THEME_CORE_VERSION', trim( $tmpcoder_theme->get('Version'))); } if ( !defined('TMPCODER_THEME_OPTION_NAME') ){ define('TMPCODER_THEME_OPTION_NAME', 'tmpcoder_global_theme_options_'.TMPCODER_THEME_SLUG); } if ( !defined('TMPCODER_SPEXO_ADDONS_WIDGETS_URL') ){ define('TMPCODER_SPEXO_ADDONS_WIDGETS_URL', 'https://spexoaddons.com/widgets'); } if ( ! defined( 'TMPCODER_PURCHASE_PRO_URL' ) ) { define( 'TMPCODER_PURCHASE_PRO_URL', esc_url( 'https://spexoaddons.com/spexo-addons-pro/' ) ); } if ( ! defined( 'TMPCODER_CUSTOMIZER_ASSETS' ) ) { define( 'TMPCODER_CUSTOMIZER_ASSETS', trailingslashit( get_template_directory_uri() ) . 'inc/admin/customizer/assets/' ); } if ( ! function_exists('tmpcoder_display_php_version_notices') ){ add_action( 'admin_notices', 'tmpcoder_display_php_version_notices' ); function tmpcoder_display_php_version_notices(){ $php_version = null; if ( defined( 'PHP_VERSION' ) ) { $php_version = PHP_VERSION; } elseif ( function_exists( 'phpversion' ) ) { $php_version = phpversion(); } if ( null === $php_version ) { echo wp_kses( '
PHP Version could not be detected.
'; printf( /* translators: %s is the PHP version */ esc_html__('Your site is running on an outdated version of PHP %s. The minimum recommended version of PHP is 7.4.', 'spexo'), esc_html($php_version) ); echo ''. esc_html('See more details') .''; echo '
'; printf( /* translators: 1$s is the memory size, 2$s is the URL to the documentation */ esc_html__( '%1$s - We recommend setting memory to at least 128MB. Please define memory limit in wp-config.php file. To learn how, see: Increasing memory allocated to PHP.', 'spexo' ), esc_html( size_format( $memory ) ), esc_url( 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) ); echo '