Jump to content

admin-bar.php conflict with file upload


jrunk

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/278862-admin-barphp-conflict-with-file-upload/
Share on other sites

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,
// )
// ) );
//}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.