acf_admin_tools::metabox_html
Output the metabox HTML for specific tools
Method of the class: acf_admin_tools{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_admin_tools = new acf_admin_tools(); $acf_admin_tools->metabox_html( $post, $metabox );
- $post(mixed) (required)
- The post this metabox is being displayed on, should be an empty string always for us on a tools page.
- $metabox(array) (required)
- An array of the metabox attributes.
Changelog
| Since 5.6.3 | Introduced. |
acf_admin_tools::metabox_html() acf admin tools::metabox html code ACF 6.8.8
public function metabox_html( $post, $metabox ) {
$tool = $this->get_tool( $metabox['args']['tool'] );
$form_attrs = array( 'method' => 'post' );
if ( $metabox['args']['tool'] === 'import' ) {
$form_attrs['onsubmit'] = 'acf.disableForm(event)';
}
printf( '<form %s>', acf_esc_attrs( $form_attrs ) );
$tool->html();
acf_nonce_input( $tool->name );
echo '</form>';
}