• Hi, i am using the wp_editor with the add media button in my theme for a members only area and i need to set a minimum image upload resolution for design reasons… i tried add_atachment any ideas this is what i came out to so far

    function CheckImageUpload($attachmentID){
    $metadata = wp_get_attachment_metadata($attachmentID);
    if ($metadata[‘width’] < 560 and $metadata[‘height’] < 470)
    {
    wp_delete_attachment($attachmentID);
    }
    }

    add_action( “add_attachment” , ‘CheckImageUpload’ );

  • The topic ‘Check for image size after uploading’ is closed to new replies.