Skip to content
Snippets Groups Projects
Commit fe7a0dae authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

1.8

parent dcd2b5b7
Branches
Tags
No related merge requests found
......@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
require_once 'functions.php';
if ( ! class_exists( 'WPDesk_Plugin_1_7' ) ) {
if ( ! class_exists( 'WPDesk_Plugin_1_8' ) ) {
require_once 'class-settings.php';
......@@ -14,9 +14,9 @@ if ( ! class_exists( 'WPDesk_Plugin_1_7' ) ) {
* @author Grzegorz
*
*/
class WPDesk_Plugin_1_7 {
class WPDesk_Plugin_1_8 {
const VERSION = '1.7';
const VERSION = '1.8';
protected $plugin_is_active = true;
......@@ -45,7 +45,7 @@ if ( ! class_exists( 'WPDesk_Plugin_1_7' ) ) {
$this->init_base_variables( $base_file );
if ( $this->plugin_is_active ) {
if ( $this->plugin_has_settings ) {
$this->settings = new WPDesk_Settings_1_7( $this, $this->get_namespace(), $this->default_settings_tab );
$this->settings = new WPDesk_Settings_1_8( $this, $this->get_namespace(), $this->default_settings_tab );
$this->options = $this->settings->get_settings();
}
}
......@@ -155,19 +155,26 @@ if ( ! class_exists( 'WPDesk_Plugin_1_7' ) ) {
* @return string
*/
public function load_template( $name, $path = '', $args = array() ) {
$path = trim( $path, '/' );
$plugin_template_path = trailingslashit( $this->plugin_path ) . 'templates/';
$template_name = implode( '/', array( get_template_directory(), $this->get_template_path(), $path, $name . '.php' ) );
// Look within passed path within the theme - this is priority.
$template = locate_template(
array(
trailingslashit( $this->get_template_path() ) . trailingslashit( $path ) . $name . '.php',
)
);
if ( !file_exists( $template_name ) ) {
$template_name = implode( '/', array( untrailingslashit( $this->plugin_path ), 'templates', $path, $name . '.php' ) );
if ( ! $template ) {
$template = $plugin_template_path . trailingslashit( $path ) . $name . '.php';
}
extract( $args );
ob_start();
include( $template_name );
include( $template );
return ob_get_clean();
}
public function admin_enqueue_scripts( $hooq ) {
}
......
......@@ -2,9 +2,9 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! class_exists( 'WPDesk_Settings_1_7' ) ) {
if ( ! class_exists( 'WPDesk_Settings_1_8' ) ) {
if ( ! class_exists( 'WPDesk_S214_Settings_1_7' ) ) {
if ( ! class_exists( 'WPDesk_S214_Settings_1_8' ) ) {
require_once 'settings-api/class.s214-settings.php';
}
......@@ -14,7 +14,7 @@ if ( ! class_exists( 'WPDesk_Settings_1_7' ) ) {
* @author Grzegorz
*
*/
class WPDesk_Settings_1_7 extends WPDesk_S214_Settings_1_7 {
class WPDesk_Settings_1_8 extends WPDesk_S214_Settings_1_8 {
private $slug;
......@@ -26,7 +26,7 @@ if ( ! class_exists( 'WPDesk_Settings_1_7' ) ) {
protected $func = 'wpdesk_plugin';
public function __construct( WPDesk_Plugin_1_7 $plugin, $slug = 'wpdesk-settings', $default_tab = 'general' ) {
public function __construct( WPDesk_Plugin_1_8 $plugin, $slug = 'wpdesk-settings', $default_tab = 'general' ) {
parent::__construct( $slug, $default_tab );
$this->slug = $slug;
$this->plugin = $plugin;
......
......@@ -18,7 +18,7 @@ if( ! defined( 'ABSPATH' ) ) {
*
* @since 1.0.0
*/
class WPDesk_S214_Settings_1_7 {
class WPDesk_S214_Settings_1_8 {
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment