CMB2::render_form_open PHP Метод

render_form_open() публичный Метод

Outputs the opening form markup and runs corresponding hooks: 'cmb2_before_form' and "cmb2_before_{$object_type}_form_{$this->cmb_id}"
С версии: 2.2.0
public render_form_open ( integer $object_id, string $object_type = '' ) : void
$object_id integer Object ID
$object_type string Object type
Результат void
    public function render_form_open($object_id = 0, $object_type = '')
    {
        $object_type = $this->object_type($object_type);
        $object_id = $this->object_id($object_id);
        $this->nonce_field();
        echo "\n<!-- Begin CMB2 Fields -->\n";
        /**
         * Hook before form table begins
         *
         * @param array  $cmb_id      The current box ID
         * @param int    $object_id   The ID of the current object
         * @param string $object_type The type of object you are working with.
         *	                           Usually `post` (this applies to all post-types).
         *	                           Could also be `comment`, `user` or `options-page`.
         * @param array  $cmb         This CMB2 object
         */
        do_action('cmb2_before_form', $this->cmb_id, $object_id, $object_type, $this);
        /**
         * Hook before form table begins
         *
         * The first dynamic portion of the hook name, $object_type, is the type of object
         * you are working with. Usually `post` (this applies to all post-types).
         * Could also be `comment`, `user` or `options-page`.
         *
         * The second dynamic portion of the hook name, $this->cmb_id, is the meta_box id.
         *
         * @param array  $cmb_id      The current box ID
         * @param int    $object_id   The ID of the current object
         * @param array  $cmb         This CMB2 object
         */
        do_action("cmb2_before_{$object_type}_form_{$this->cmb_id}", $object_id, $this);
        echo '<div class="', $this->box_classes(), '"><div id="cmb2-metabox-', sanitize_html_class($this->cmb_id), '" class="cmb2-metabox cmb-field-list">';
    }