wp_media_insert_url_form

函数


wp_media_insert_url_form ( $default_view = 'image' )
参数
  • (string)
    $default_view
    Required:
    Default: ‘image’
返回值
  • (string) HTML content of the form.
定义位置
  • wp-admin/includes/media.php
    , line 2899
引入
2.7.0
弃用

Creates the form for external url.

function wp_media_insert_url_form( $default_view = 'image' ) {
	/** This filter is documented in wp-admin/includes/media.php */
	if ( ! apply_filters( 'disable_captions', '' ) ) {
		$caption = '
		
				
			
			
		';
	} else {
		$caption = '';
	}

	$default_align = get_option( 'image_default_align' );

	if ( empty( $default_align ) ) {
		$default_align = 'none';
	}

	if ( 'image' === $default_view ) {
		$view        = 'image-only';
		$table_class = '';
	} else {
		$view        = 'not-image';
		$table_class = $view;
	}

	return '
	

   

' . wp_required_field_message() . '

‘ . $caption . ‘


‘ . __( ‘Link text, e.g. “Ransom Demands (PDF)”’ ) . ‘

‘ . __( ‘Alt text for the image, e.g. “The Mona Lisa”’ ) . ‘






‘ . __( ‘Enter a link URL or click above for presets.’ ) . ‘

‘ . get_submit_button( __( ‘Insert into Post’ ), ”, ‘insertonlybutton’, false ) . ‘

‘;
}