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.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

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.

Three AM