wp_connect_like_box

Description

The wp_connect_like_box function renders a Facebook Like Box based on the specified setting values. It can be used by theme designers who would like to add specific like box(es) to their theme.

Usage

<?php wp_connect_like_box
    $width$height$colorscheme$show_faces
    $show_stream$show_header$echo 
); ?>

Parameters

$width
(integer) (required) The width of the plugin in pixels.
Default: None
$height
(integer) (required) The height of the plugin in pixels.
Default: None
$colorscheme
(required) The color scheme of the plugin.
Valid Values:
  • WPC_THEME_LIGHT
  • WPC_THEME_DARK

Default: None

$show_faces
(required) Whether to show profile photos in the plugin or not.
Valid Values:
  • WPC_OPTION_DISABLED
  • WPC_OPTION_ENABLED

Default: None

$show_stream
(required) Whether to show the profile stream for the public profile.
Valid Values:
  • WPC_OPTION_DISABLED
  • WPC_OPTION_ENABLED

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

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

Please note that the Facebook Page URL must be set by the user through the WordPress Connect options pages. The like box will be rendered only if the user has specified the Like Box URL through the WordPress Connect setting pages; otherwise an empty string will be printee/returned!

Examples

Default Usage

Prints the Like Box.

// 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_like_box' ) ){
	require_once( $wpc_constants_file );

	$like_box_width = 480;
	$like_box_height = 180;
	$colorscheme = WPC_THEME_DARK; // or WPC_THEME_LIGHT
	$show_faces = WPC_OPTION_ENABLED; // or WPC_OPTION_DISABLED
	$show_stream = WPC_OPTION_ENABLED; // or WPC_OPTION_DISABLED
	$show_header = WPC_OPTION_ENABLED; // or WPC_OPTION_DISABLED

	// render the like box in place
	wp_connect_like_box(
		$like_box_width,
		$like_box_height,
		$colorscheme,
		$show_faces,
		$show_stream,
		$show_header
	);
}

Change Log

Source File

wp_connect_like_box() 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_button, wp_connect_like_button_default, wp_connect_live_stream, wp_connect_login_button, wp_connect_recommendations, wp_connect_send_button