İlk sürüm: Eklenti temel yapısı ve metadata tanımları
This commit is contained in:
69
himsakiye.php
Normal file
69
himsakiye.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: hImsakiye - Ramazan İmsakiye Eklentisi
|
||||
* Plugin URI: https://www.mustafaozkaya.tr/
|
||||
* Description: Osmanlı temalı, yerel hesaplama yöntemli interaktif Ramazan imsakiye eklentisi.
|
||||
* Version: 1.0.0
|
||||
* Author: Mustafa ÖZKAYA & hOLOlu
|
||||
* Author URI: https://www.mustafaozkaya.tr/
|
||||
* Text Domain: himsakiye
|
||||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
// Doğrudan erişimi engelle
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Sabitleri tanımla
|
||||
define( 'HIMSAKIYE_VERSION', '1.0.0' );
|
||||
define( 'HIMSAKIYE_PATH', plugin_dir_path( __FILE__ ) );
|
||||
define( 'HIMSAKIYE_URL', plugin_dir_url( __FILE__ ) );
|
||||
|
||||
/**
|
||||
* Eklenti Ana Sınıfı
|
||||
*/
|
||||
class HImsakiye {
|
||||
private static $instance = null;
|
||||
|
||||
public static function get_instance() {
|
||||
if ( null === self::$instance ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
private function __construct() {
|
||||
$this->includes();
|
||||
$this->init_hooks();
|
||||
}
|
||||
|
||||
private function includes() {
|
||||
// Hesaplama motoru, widget ve shortcode sınıflarını buraya ekleyeceğiz
|
||||
// require_once HIMSAKIYE_PATH . 'includes/class-himsakiye-calc.php';
|
||||
// require_once HIMSAKIYE_PATH . 'includes/class-himsakiye-widget.php';
|
||||
// require_once HIMSAKIYE_PATH . 'includes/class-himsakiye-shortcode.php';
|
||||
}
|
||||
|
||||
private function init_hooks() {
|
||||
add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] );
|
||||
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
||||
}
|
||||
|
||||
public function load_textdomain() {
|
||||
load_plugin_textdomain( 'himsakiye', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
||||
}
|
||||
|
||||
public function enqueue_assets() {
|
||||
wp_enqueue_style( 'himsakiye-theme', HIMSAKIYE_URL . 'assets/css/theme.css', [], HIMSAKIYE_VERSION );
|
||||
wp_enqueue_script( 'himsakiye-main', HIMSAKIYE_URL . 'assets/js/main.js', [ 'jquery' ], HIMSAKIYE_VERSION, true );
|
||||
|
||||
wp_localize_script( 'himsakiye-main', 'hImsakiyeVars', [
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'nonce' => wp_create_nonce( 'himsakiye_nonce' )
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Eklentiyi başlat
|
||||
HImsakiye::get_instance();
|
||||
Reference in New Issue
Block a user