Advertisements

media_buttons

Definition:
function media_buttons() {}

Parameters

  • $editor_id

Defined filters

  • media_buttons_context
    apply_filters('media_buttons_context', __('Upload/Insert %s')

Source code

function media_buttons() {

	$do_image = $do_audio = $do_video = true;

	if ( is_multisite() ) {

		$media_buttons = get_site_option( 'mu_media_buttons' );

		if ( empty($media_buttons['image']) )

			$do_image = false;

		if ( empty($media_buttons['audio']) )

			$do_audio = false;

		if ( empty($media_buttons['video']) )

			$do_video = false;

	}

	$out = '';



	if ( $do_image )

		$out .= _media_button(__('Add an Image'), 'images/media-button-image.gif?ver=20100531', 'image');

	if ( $do_video )

		$out .= _media_button(__('Add Video'), 'images/media-button-video.gif?ver=20100531', 'video');

	if ( $do_audio )

		$out .= _media_button(__('Add Audio'), 'images/media-button-music.gif?ver=20100531', 'audio');



	$out .= _media_button(__('Add Media'), 'images/media-button-other.gif?ver=20100531', 'media');



	$context = apply_filters('media_buttons_context', __('Upload/Insert %s'));



	printf($context, $out);

}

2347

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: