Carbon_Fields\Container\Post_Meta_Container::init PHP Method

init() public method

Bind attach() and save() to the appropriate WordPress actions.
public init ( )
    public function init()
    {
        if (isset($_GET['post'])) {
            $this->set_post_id($_GET['post']);
        }
        // force post_type to be array
        if (!is_array($this->settings['post_type'])) {
            $this->settings['post_type'] = array($this->settings['post_type']);
        }
        add_action('admin_init', array($this, '_attach'));
        add_action('save_post', array($this, '_save'));
        // support for attachments
        add_action('add_attachment', array($this, '_save'));
        add_action('edit_attachment', array($this, '_save'));
    }