realhomes-currency-switcher
Last commit date
admin
3 months ago
includes
3 months ago
languages
3 months ago
public
3 months ago
LICENSE.txt
3 months ago
README.txt
3 months ago
index.php
3 months ago
realhomes-currency-switcher.php
3 months ago
uninstall.php
3 months ago
realhomes-currency-switcher.php
100 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: RealHomes Currency Switcher |
| 4 | * Plugin URI: https://themeforest.net/item/real-homes-wordpress-real-estate-theme/5373914 |
| 5 | * Description: Provides multiple currencies support and currency switching for RealHomes theme. |
| 6 | * Version: 1.1.0 |
| 7 | * Tested up to: 6.9 |
| 8 | * Requires PHP: 8.3 |
| 9 | * Author: InspiryThemes |
| 10 | * Author URI: https://inspirythemes.com/ |
| 11 | * License: GPL-2.0+ |
| 12 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 13 | * Text Domain: realhomes-currency-switcher |
| 14 | * Domain Path: /languages |
| 15 | * |
| 16 | * @since 1.0.0 |
| 17 | * @package realhomes-currency-switcher |
| 18 | */ |
| 19 | |
| 20 | // If this file is called directly, abort. |
| 21 | if ( ! defined( 'WPINC' ) ) { |
| 22 | die; |
| 23 | } |
| 24 | |
| 25 | // Currently plugin version. |
| 26 | define( 'REALHOMES_CURRENCY_SWITCHER_VERSION', rcs_get_plugin_details() ); |
| 27 | |
| 28 | // Plugin unique identifier. |
| 29 | define( 'REALHOMES_CURRENCY_SWITCHER_NAME', 'realhomes-currency-switcher' ); |
| 30 | |
| 31 | // Plugin text domain. |
| 32 | define( 'RCS_TEXT_DOMAIN', 'realhomes-currency-switcher' ); |
| 33 | |
| 34 | // Plugin directory path. |
| 35 | define( 'RH_CURRENCY_SWITCHER_DIR', plugin_dir_path( __FILE__ ) ); |
| 36 | |
| 37 | /** |
| 38 | * The code that runs during plugin activation. |
| 39 | * This action is documented in includes/class-realhomes-currency-switcher-activator.php |
| 40 | */ |
| 41 | function activate_realhomes_currency_switcher() { |
| 42 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-realhomes-currency-switcher-activator.php'; |
| 43 | Realhomes_Currency_Switcher_Activator::activate(); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * The code that runs during plugin deactivation. |
| 48 | * This action is documented in includes/class-realhomes-currency-switcher-deactivator.php |
| 49 | */ |
| 50 | function deactivate_realhomes_currency_switcher() { |
| 51 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-realhomes-currency-switcher-deactivator.php'; |
| 52 | Realhomes_Currency_Switcher_Deactivator::deactivate(); |
| 53 | } |
| 54 | |
| 55 | register_activation_hook( __FILE__, 'activate_realhomes_currency_switcher' ); |
| 56 | register_deactivation_hook( __FILE__, 'deactivate_realhomes_currency_switcher' ); |
| 57 | |
| 58 | /** |
| 59 | * The core plugin class that is used to define internationalization, |
| 60 | * admin-specific hooks, and public-facing site hooks. |
| 61 | */ |
| 62 | require plugin_dir_path( __FILE__ ) . 'includes/class-realhomes-currency-switcher.php'; |
| 63 | |
| 64 | /** |
| 65 | * Get plugin details safely |
| 66 | * |
| 67 | * @since 1.0.11 |
| 68 | * |
| 69 | * @param string $key Key to fetch plugin detail |
| 70 | * |
| 71 | * @return string|mixed |
| 72 | */ |
| 73 | function rcs_get_plugin_details( $key = 'Version' ) { |
| 74 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 75 | |
| 76 | // Prevent early translation call by setting $translate to false. |
| 77 | $plugin_data = get_plugin_data( __FILE__,false,false ); |
| 78 | |
| 79 | return $plugin_data[$key]; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Begins execution of the plugin. |
| 84 | * |
| 85 | * Since everything within the plugin is registered via hooks, |
| 86 | * then kicking off the plugin from this point in the file does |
| 87 | * not affect the page life cycle. |
| 88 | * |
| 89 | * @since 1.0.0 |
| 90 | */ |
| 91 | function run_realhomes_currency_switcher() { |
| 92 | |
| 93 | $plugin = new Realhomes_Currency_Switcher(); |
| 94 | $plugin->run(); |
| 95 | |
| 96 | } |
| 97 | |
| 98 | run_realhomes_currency_switcher(); |
| 99 | |
| 100 |