wp_connect_activity_feed

Description

The wp_connect_activity_feed function renders a Facebook Activity Feed based on the specified setting values. It can be used by theme designers who would like to add specific activity feed(s) to their theme.

Usage

<?php wp_connect_activity_feed
    $domain$width$height$show_header$colorscheme$font
    $border_color$show_recommendations$filter$ref$echo 
); ?>

Parameters

$domain
(string) (required) The domain to show activity for e.g. “www.example.com”. Defaults to the domain the plugin is on.
Default: None. Pass an empty string for the current domain.
$width
(integer) (required) The width of the plugin in pixels.
Default: None
$height
(integer) (required) The height of the plugin in pixels.
Default: None
$show_header
(required) Whether to show Facebook header on the plugin or not.
Valid Values:
  • WPC_OPTION_DISABLED
  • WPC_OPTION_ENABLED

Default: None

$colorscheme
(required) The color scheme of the plugin.
Valid Values: WPC_THEME_LIGHT, WPC_THEME_DARK
Default: None
$font
(required) The font of the plugin.
Valid Values:
  • WPC_FONT_ARIAL
  • WPC_FONT_LUCIDA_GRANDE
  • WPC_FONT_SEGOE_UI
  • WPC_FONT_TAHOMA
  • WPC_FONT_TREBUCHET_MS
  • WPC_FONT_VERDANA

Default: None

$border_color
(string) (required) The color border of the plugin
Default: None; an empty string is allowed
$show_recommendations
(required) Whether to show recommendations on the plugin or not.
Valid Values:
  • WPC_OPTION_DISABLED
  • WPC_OPTION_ENABLED

Default: None

$filter
(string) (required) allows you to filter which URLs are shown in the plugin. The plugin will only include URLs which contain the filter string in the first two path parameters of the URL. If nothing in the first two path parameters of the URL matches the filter, the URL will not be included. For example, if the ‘acitivty_domain’ parameter is set to ‘www.example.com’ and the ‘filter’ parameter was set to ‘/section1/section2’ then only pages which matched ‘http://www.example.com/section1/section2/*’ would be included in the activity feed section of this plugin. The filter parameter does not apply to any recommendations which may appear in this plugin (see above); Recommendations are based only on ‘activity_domain’ parameter.
Default: None; an empty string is allowed
$ref
(string) (required) a label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_). Specifying a value for the ref attribute adds the ‘fb_ref’ parameter to the any links back to your site which are clicked from within the plugin. Using different values for the ref parameter for different positions and configurations of this plugin within your pages allows you to track which instances are performing the best.
Default: None; an empty string is allowed
$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 Activity feeds 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_activity_feed' ) ){
	require_once( $wpc_constants_file );

	$activity_domain = 'mysite.com';
	$activity_width = 400;
	$activity_height = 400;
	$show_header = WPC_OPTION_ENABLED;
	$colorscheme = WPC_THEME_DARK;
	$font = WPC_FONT_ARIAL;
	$border_color = '#000';
	$show_recommendations = WPC_OPTION_DISABLED;
	$filter = '';
	$ref = '';

	// render the activity feed box in place
	wp_connect_activity_feed(
		$activity_domain,
		$activity_width,
		$activity_height,
		$show_header,
		$colorscheme,
		$font,
		$border_color,
		$show_recommendations,
		$filter,
		$ref
	);
}

Change Log

Source File

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

Related

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_live_stream, wp_connect_login_button, wp_connect_recommendations, wp_connect_send_button