Sprache wechseln
wpseek auf Twitter


Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren




get_post_mime_type [ ]

get_post_mime_type ( $ID = '' )
Parameter:
  • (int) $ID Optional. Post ID.
Gibt zurück:
  • (bool|string) False on failure or returns the mime type
Definiert in:
Codex



Retrieve the mime type of an attachment based on the ID.

This function can be used with any post type, but it makes more sense with attachments.

Quellcode

function get_post_mime_type($ID = '') {
	$post = get_post($ID);

	if ( is_object($post) )
		return $post->post_mime_type;

	return false;
}

Beispiele [ wp-snippets.com ]

Top Google Suchergebnisse

Mehr ...

Nutzerduskussionen [ wordpress.org ]

0 Nutzerkommentare

Noch keine. Sei der Erste!

Neu hinzufügen ...