Out of Memory when Uploading an Image

This isn’t a WordPress problem. There’s no telling on a shared environment what the culprit might be. You probably don’t have access to your php.ini config, nor do we know how many websites your hosting company has jammed on your server. The very nature of a shared server is that each client shares the resources … Read more

update user information

You’re not closing the first if tag. /* Update user information. */ if ( !empty( $_POST[‘url’] ) ){ update_user_meta( $current_user->id, ‘user_url’, esc_url( $_POST[‘url’] ) ); } else{ delete_user_meta( $current_user->id, ‘user_url’); } Also, you should use esc_url_raw on a raw url and then if you’re echoing into the html use esc_url. You also shouldn’t save esc_attr … Read more

How we store error/success messages to the next page

You could save the messages in a $_SESSION variable. This way, the values will be preserved untill you decide to remove them again. function save_message( $type, $message=”” ) { $_SESSION[‘messages’][$type] = $message; } function get_messages() { $return = ”; if ( isset( $_SESSION[‘messages’] ) && is_array( $_SESSION[‘messages’] ) ) { foreach( $_SESSION[‘messages’] as $type => … Read more

wp_handle_upload returns empty error array

Okay so Milo was on track to what the answer was. and I needed to brush up on muliple file uploads… anyway the solution for me to at least get it to upload… was this $daFile = $_FILES[‘files’]; foreach ($_FILES[‘files’] as $key => $value) { $daFile[$key] = $value[0]; } $upload = wp_handle_upload($daFile , array(‘test_form’ => … Read more