wp_connect_recommendations

Description

The wp_connect_recommendations function renders a Facebook Recommendations based on the specified setting values. It can be used by theme designers who would like to add specific recommendations plugin(s) to their theme.

Usage

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

Parameters

$domain
(string) (required) The domain for which to show recommendations 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
$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 Recommendations 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_recommendations' ) ){
	require_once( $wpc_constants_file );

	$domain = 'mysite.com';
	$width = 400;
	$height = 400;
	$show_header = WPC_OPTION_ENABLED;
	$colorscheme = WPC_THEME_DARK;
	$font = WPC_FONT_ARIAL;
	$border_color = '#000';
	$ref = '';

	// render the recommendations box in place
	wp_connect_recommendations(
		$domain,
		$width,
		$height,
		$show_header,
		$colorscheme,
		$font,
		$border_color,
		$ref
	);
}

Change Log

Source File

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