wp_connect_live_stream

Description

The wp_connect_live_stream function renders a Facebook Lvie Stream based on the specified setting values. It can be used by theme designers who would like to add specific live stream(s) to their theme.

Usage

<?php wp_connect_live_stream
    $width$height$xid$attribution$post_to_friends$echo 
); ?>

Parameters

$width
(integer) (required) The width of the plugin in pixels.
Default: None
$height
(integer) (required) The width of the plugin in pixels.
Default: None
$xid
(string) (required) If you have multiple live stream boxes on the same page, specify a unique xid for each.
Default: None; an empty string is allowed.
$attribution
(string) (required) The URL that users are redirected to when they click on your app name on a status (if not specified, your Connect URL is used).
Default: None; an empty string is allowed.
$post_to_friends
(required) If set, all user posts will always go to their profile. This option should only be used when users’ posts are likely to make sense outside of the context of the event.
Valid Values:
  • WPC_OPTION_DISABLED
  • WPC_OPTION_ENABLED

Default: None

$echo
(boolean) (optional) Whether to print the plugin code (TRUE) or return it as a PHP variable (FALSE).
Default: TRUE

Examples

Default Usage

Prints the Live Stream plugin.

// this file is required to enable the use of WordPress Connect constants
$wpc_constants_file = WP_PLUGIN_DIR . '/wordpress-connect/src/WordpressConnectConstants.php';

if ( file_exists( $wpc_constants_file ) && function_exists( 'wp_connect_live_stream' ) ){
	require_once( $wpc_constants_file );

	$width = 480;
	$height = 480;
	$xid = md5( 'http://www.mysite.com' );
	$attribution = '';
	$post_to_friends = WPC_OPTION_ENABLED;

	// render the live stream box in place
	wp_connect_live_stream(
		$width,
		$height,
		$xid,
		$attribution,
		$post_to_friends
	);
}

Change Log

Source File

wp_connect_live_stream() is located in wordpress-connect/wordpress-connect-functions.php.

Related

wp_connect_activity_feed, wp_connect_comments, wp_connect_comments_default, wp_connect_facepile, wp_connect_like_box, wp_connect_like_button, wp_connect_like_button_default, wp_connect_login_button, wp_connect_recommendations, wp_connect_send_button