name = 'import'; $this->title = __("Import Field Groups", 'acf'); $this->icon = 'dashicons-upload'; } /** * html * * This function will output the metabox HTML * * @date 10/10/17 * @since 5.6.3 * * @param n/a * @return n/a */ function html() { // vars $choices = array(); $field_groups = acf_get_field_groups(); // loop if( $field_groups ) { foreach( $field_groups as $field_group ) { $choices[ $field_group['key'] ] = esc_html( $field_group['title'] ); } } // html ?>
$field_group['ID'], 'title' => $field_group['title'], 'updated' => $id ? 1 : 0 ); } // messages if( !empty($imported) ) { // vars $links = array(); $count = count($imported); $message = sprintf(_n( 'Imported 1 field group', 'Imported %s field groups', $count, 'acf' ), $count) . '.'; // populate links foreach( $imported as $import ) { $links[] = '' . $import['title'] . ''; } // append links $message .= ' ' . implode(', ', $links); // add notice acf_add_admin_notice( $message ); } } } // initialize acf_register_admin_tool( 'ACF_Admin_Tool_Import' ); endif; // class_exists check ?>