| 1 |
<?php |
| 2 |
/** |
| 3 |
* Public Class |
| 4 |
* |
| 5 |
* @package Wow_Plugin |
| 6 |
* @subpackage Public |
| 7 |
* @copyright Copyright (c) 2018, Dmytro Lobov |
| 8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 |
* @since 1.0 |
| 10 |
*/ |
| 11 |
namespace wpcoder; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 14 |
|
| 15 |
class Wow_Public_Class { |
| 16 |
|
| 17 |
private $arg; |
| 18 |
|
| 19 |
public function __construct( $arg ) { |
| 20 |
|
| 21 |
$this->plugin_name = $arg['plugin_name']; |
| 22 |
$this->plugin_menu = $arg['plugin_menu']; |
| 23 |
$this->plugin_home_url = $arg['plugin_home_url']; |
| 24 |
$this->plugin_version = $arg['plugin_version']; |
| 25 |
$this->plugin_file = $arg['plugin_file']; |
| 26 |
$this->plugin_slug = $arg['plugin_slug']; |
| 27 |
$this->plugin_dir = $arg['plugin_dir']; |
| 28 |
$this->plugin_url = $arg['plugin_url']; |
| 29 |
$this->plugin_pref = $arg['plugin_pref']; |
| 30 |
$this->author_url = $arg['author_url']; |
| 31 |
$this->pro_url = $arg['pro_url']; |
| 32 |
$this->shortcode = $arg['shortcode']; |
| 33 |
|
| 34 |
$upload = wp_upload_dir(); |
| 35 |
$this->basedir = $upload['basedir'] . '/' . $this->plugin_slug . '/'; |
| 36 |
$this->baseurl = $upload['baseurl'] . '/' . $this->plugin_slug . '/'; |
| 37 |
|
| 38 |
add_shortcode( $this->shortcode, array( $this, 'shortcode' ) ); |
| 39 |
|
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
function shortcode( $atts ) { |
| 44 |
ob_start(); |
| 45 |
require plugin_dir_path( __FILE__ ) . 'shortcode.php'; |
| 46 |
$shortcode = ob_get_contents(); |
| 47 |
ob_end_clean(); |
| 48 |
return $shortcode; |
| 49 |
} |
| 50 |
|
| 51 |
} |