mirror of
https://github.com/WenPai-org/wpmind.git
synced 2025-08-03 19:19:46 +08:00
fixed loading text domain
remove some unused variables from main class
This commit is contained in:
parent
9546fe357c
commit
2401baf560
3 changed files with 24 additions and 32 deletions
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Rest API functions
|
||||
*
|
||||
* @package @@plugin_name
|
||||
* @package mind
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
48
mind.php
48
mind.php
|
@ -45,20 +45,6 @@ class Mind {
|
|||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the plugin
|
||||
*
|
||||
* @var $plugin_name
|
||||
*/
|
||||
public $plugin_name;
|
||||
|
||||
/**
|
||||
* Basename of plugin main file
|
||||
*
|
||||
* @var $plugin_basename
|
||||
*/
|
||||
public $plugin_basename;
|
||||
|
||||
/**
|
||||
* Path to the plugin directory
|
||||
*
|
||||
|
@ -84,16 +70,31 @@ class Mind {
|
|||
* Init options
|
||||
*/
|
||||
public function init() {
|
||||
$this->plugin_name = esc_html__( 'Mind', 'mind' );
|
||||
$this->plugin_basename = plugin_basename( __FILE__ );
|
||||
$this->plugin_path = plugin_dir_path( __FILE__ );
|
||||
$this->plugin_url = plugin_dir_url( __FILE__ );
|
||||
|
||||
// load textdomain.
|
||||
load_plugin_textdomain( 'mind', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
||||
|
||||
// include helper files.
|
||||
$this->include_dependencies();
|
||||
|
||||
// hooks.
|
||||
add_action( 'init', [ $this, 'init_hook' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Include dependencies
|
||||
*/
|
||||
private function include_dependencies() {
|
||||
require_once $this->plugin_path . 'classes/class-admin.php';
|
||||
require_once $this->plugin_path . 'classes/class-assets.php';
|
||||
require_once $this->plugin_path . 'classes/class-rest.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Init Hook
|
||||
*/
|
||||
public function init_hook() {
|
||||
// load textdomain.
|
||||
load_plugin_textdomain( 'mind', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,15 +111,6 @@ class Mind {
|
|||
public function deactivation_hook() {
|
||||
// Nothing here yet.
|
||||
}
|
||||
|
||||
/**
|
||||
* Include dependencies
|
||||
*/
|
||||
private function include_dependencies() {
|
||||
require_once $this->plugin_path . 'classes/class-admin.php';
|
||||
require_once $this->plugin_path . 'classes/class-assets.php';
|
||||
require_once $this->plugin_path . 'classes/class-rest.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Contributors: nko
|
||||
Tags: ai, openai, gpt, copywriting, assistant
|
||||
Requires at least: 6.2
|
||||
Tested up to: 6.4
|
||||
Tested up to: 6.7
|
||||
Requires PHP: 7.2
|
||||
Stable tag: 0.1.1
|
||||
License: GPL-2.0-or-later
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue