chatbot.php
2 years ago
discussions.php
2 years ago
files.php
2 years ago
security.php
2 years ago
utilities.php
2 years ago
utilities.php
33 lines
| 1 | <?php |
| 2 | |
| 3 | class Meow_MWAI_Modules_Utilities { |
| 4 | private $core = null; |
| 5 | private $module_woocommerce = false; |
| 6 | |
| 7 | public function __construct() { |
| 8 | global $mwai_core; |
| 9 | $this->core = $mwai_core; |
| 10 | $this->module_woocommerce = $this->core->get_option( 'module_woocommerce' ); |
| 11 | |
| 12 | // Add Metadata Metabox to Product Post Type Edit Page |
| 13 | if ( $this->module_woocommerce ) { |
| 14 | add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | function add_meta_boxes() { |
| 19 | if ( get_post_type() !== 'product' ) { |
| 20 | return; |
| 21 | } |
| 22 | add_meta_box( 'meow-mwai-metadata', |
| 23 | __( 'AI Engine', 'meow-mwai' ), |
| 24 | array( $this, 'render_metadata_metabox' ), |
| 25 | 'product', 'side', 'high' |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | function render_metadata_metabox( $post ) { |
| 30 | $this->core->uiNeeded = true; |
| 31 | echo '<div id="mwai-admin-wcAssistant"></div>'; |
| 32 | } |
| 33 | } |