$item2['menu_order']; }); // Bail if no fields if (! $fields) return $content; // If we have fields add them to the end of the content // Buffer the output ob_start(); $post_id = get_the_ID(); // Render each field foreach( $fields as $field ) { acfd_render_field( $post_id, $field ); } // Get the HTML $form = ob_get_contents(); ob_end_clean(); // Return the content and out fields return $content . $form; } /** * Render the given field * Adds a wrapper around the field value */ function acfd_render_field( $post_id, $field ) { // Don't render some field types if ( $field['type'] == 'password') { return; } ?>