Support » Alpha/Beta/RC » prepend_attachment() does not handle all MIME types, e.g., "text"

  • Resolved David Lingren


    Using version 3.9-beta3-27857

    In /wp-includes/post-template.php, function prepend_attachment() has been rewritten to prepend different content based on post_mime_type.

    Only image, audio and video MIME types are handled. Other MIME types, such as “text” and “application”, fall out the bottom of the if/elseif tests and leave the $p variable undefined.

    This produces a PHP Notice: regarding the undefined variable.

    Perhaps adding a final else clause to show the icon for other MIME types would be useful

    else {
    		$p = '<p class="attachment">';
    		// show the medium sized image representation of the attachment if available, and link to the raw file
    		$p .= wp_get_attachment_link(0, 'medium', false, true );
    		$p .= '</p>';
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘prepend_attachment() does not handle all MIME types, e.g., "text"’ is closed to new replies.