Skip to content

Commit

Permalink
Update metabox.php
Browse files Browse the repository at this point in the history
added init_action
  • Loading branch information
kroppenstedt committed Oct 10, 2019
1 parent 088d658 commit 67940ca
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions classes/metabox.php
Expand Up @@ -18,13 +18,21 @@ class MetaBox {
private $screens;

/**
* Post constructor.
*
* @param Plugin $plugin
*/
function __construct(Plugin $plugin) {
* Post constructor.
*
* @param Plugin $plugin
*/
public function __construct(Plugin $plugin) {
$this->plugin = $plugin;
$this->store = $plugin->store;
add_action( "init", array( $this, "init" ) );
}

/**
*
*/
function init() {

$this->screens = get_post_types( array('public' => true) ); //@todo could get a setting page where to choose for which post_types postqueues should be available
/**
* registers add_meta_boxes action that adds metaboxes to post edit
Expand Down Expand Up @@ -122,4 +130,4 @@ function ajax_callback_remove_post() {
echo "Postqueue ID: " . $queue_id;
wp_die(); // this is required to terminate immediately and return a proper response
}
}
}

0 comments on commit 67940ca

Please sign in to comment.