jrunk Posted June 6, 2013 Share Posted June 6, 2013 I added a file upload option to the contact form and it works perfectly when I comment out <?php wp_footer(); ?> from the footer.php I'm assumed the admin bar search form caused a conflict, so I included the enctype="multipart/form-data" code to the form like this; admin-bar.php $form = '<form action="' . esc_url( home_url( '/' ) ) . '" method="get" id="adminbarsearch" enctype="multipart/form-data" >'; $form .= '<input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150" />'; $form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>'; $form .= '</form>'; When I include the admin bar, the $_FILES array returns back empty and I can't figure out why. This is a custom template so I viewed source from the browser to see if I was missing a form, but no luck. There are other forms, but all from my contact form, which works without the admin bar. This is Wordpress 3.5.1 running on a GoDaddy environment. Ideas? Quote Link to comment Share on other sites More sharing options...
joea Posted June 6, 2013 Share Posted June 6, 2013 Input type must be "file:" type="file" Quote Link to comment Share on other sites More sharing options...
jrunk Posted June 6, 2013 Author Share Posted June 6, 2013 The type on the contact form is type="file", but I dont want to change the other search forms input types. One is a search from the admin bar at the top and the other is a search form nested in the header of the page. Quote Link to comment Share on other sites More sharing options...
jrunk Posted June 6, 2013 Author Share Posted June 6, 2013 I dont believe its the search form from the admin-bar.php page anymore because I commented out the entire function. The search box disappeared from the right side of the admin bar, but the $_FILES array is still null. Theres a conflict somewhere, but I'm not sure what would cause grief from the admin-bar.php page? /** * Add search form. * * @since 3.3.0 */ //function wp_admin_bar_search_menu( $wp_admin_bar ) { // if ( is_admin() ) // return; // $form = '<form enctype="multipart/form-data" action="' . esc_url( home_url( '/' ) ) . '" method="get" id="adminbarsearch" >'; // $form .= '<input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150" />'; // $form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>'; // $form .= '</form>'; // $wp_admin_bar->add_menu( array( // 'parent' => 'top-secondary', // 'id' => 'search', // 'title' => $form, // 'meta' => array( // 'class' => 'admin-bar-search', // 'tabindex' => -1, // ) // ) ); //} Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.