. */ /* * Внешний вид и ховер-эффекты для кнопок разработаны Kyle Brumm https://codepen.io/kjbrum/pen/wBBLXx * Внешний вид разделителей разработан Joey Hoer https://codepen.io/joeyhoer/pen/BmqIx * Флекс-сетка для колонок разработана Dave Hauser https://codepen.io/davehauser/pen/qIpoz * Размытый спойлер разработан Filipe Kiss https://codepen.io/filipekiss/pen/wDlBz * Все, что не указано отдельно - разработано автором плагина */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } define( 'ADS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'ADS_PLUGIN_URI', plugin_dir_url( __FILE__ ) ); $ads_data = get_file_data( __FILE__, array( 'ver' => 'Version', 'name' => 'Plugin Name', 'text_domain' => 'Text Domain', ) ); define( 'ADS_PLUGIN_VER', $ads_data['ver'] ); define( 'ADS_PLUGIN_NAME', $ads_data['name'] ); /** * Class ADS_Shortcodes * * Main class, initialized the plugin * * @class ADS_Shortcodes * @version 1.5.0 * @author Artem Abramovich */ class ADS_Shortcodes { /** * Instance of ADS_Shortcodes. * * @since 1.5.0 * @access private * @var object $instance The instance of ADS_Shortcodes. */ private static $instance; /** * Construct. * * @since 1.5.0 */ public function __construct() { $this->init(); // Load textdomain $this->load_textdomain(); } /** * Init. * * Initialize plugin parts. * * * @since 1.5.0 */ public function init() { if ( version_compare( PHP_VERSION, '5.6', 'lt' ) ) { return add_action( 'admin_notices', array( $this, 'php_version_notice' ) ); } if ( is_admin() ) { /** * Admin */ require_once ADS_PLUGIN_DIR . 'includes/class-ads-admin.php'; $this->admin_settings = new ADS_Shortcodes_Admin(); } if ( ! is_admin() ) : /** * Front end */ require_once ADS_PLUGIN_DIR . 'includes/class-ads-frontend.php'; $this->admin_settings = new ADS_Shortcodes_Frontend(); endif; } /** * Textdomain. * * Load the textdomain based on WP language. * * @since 1.5.0 */ public function load_textdomain() { $locale = apply_filters( 'plugin_locale', get_locale(), 'art-decoration-shortcode' ); load_textdomain( 'art-decoration-shortcode', WP_LANG_DIR . '/art-decoration-shortcode/art-decoration-shortcode-' . $locale . '.mo' ); load_plugin_textdomain( 'art-decoration-shortcode', false, basename( dirname( __FILE__ ) ) . '/languages' ); } /** * Instance. * * An global instance of the class. Used to retrieve the instance * to use on other files/plugins/themes. * * @since 1.5.0 * @return object Instance of the class. */ public static function instance() { if ( is_null( self::$instance ) ) : self::$instance = new self(); endif; return self::$instance; } /** * Display PHP 5.6 required notice. * * Display a notice when the required PHP version is not met. * * @since 1.5.0 */ public function php_version_notice() { ?>