MPFT_Video :: embed( Array / String $args, Array / String $options = uses the defaults in the player embed documentation., Boolean $get = false )

Returns:

  • String Note: always returns the embed code regardless of whether the get parameter is true or not.

Embeds the video using appropriate embed code for the host of the video. 

Allows you to specify the flashvars, params, and embed API options in an arguments parameter.

For API options relevant to Vimeo, see here.

For API options relevant to YouTube, see here.

Note: Embedding videos requires swfobject to be enqueued in your page. Please see the example for example code that you can place in your functions.php file.

Example:

Parameters:

  • Array / String $args

    An associative array or query string (compatible with wp_parse_args) which supports the following values:

    • id – the ID of the embed wrapping element – defaults to “player-“.md5(video_id)
    • version – the minimum flash player version required (for flash embeds). default 8
    • width – default 640
    • height – default 360
    • params – an args array or query string with the embed flash params.
      default: array( “allowScriptAccess” => “always”, “wmode” => “transparent” )
    • flashvars – an args array or query string with the flashvars.
      default: array()
    • attr – the HTML attributes in the output object tag (flash embed)
      default: array()
  • Array / String $options = uses the defaults in the player embed documentation.

    An associative array or query string (compatible with wp_parse_args) with the player options for the relevant video host (see method description).

  • Boolean $get = false

    Whether to get the embed code only. If this is false, the code will be echoed immediately, otherwise it is returned.

Latest From the Blog

MasterPress 1.1.4 now available

MasterPress 1.1.4 is now available. This release contains an important compatibility fix for WordPress 4.5 to allow correct detection of the taxonomy term editing screen. Without this fix, any custom fields you have attached to custom taxonomies will not be shown at all in the editing form. Note also that MasterPress will still detect the edit screen correctly in… 

Plugin Requirements

MasterPress requires a minimum of WordPress version 3.4, MySQL 5, and PHP version 5.2.4.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Traversal