wp_connect_send_button

Description

The wp_connect_send_button function renders a Facebook Send Button based on the specified setting values. It can be used by theme designers who would like to add specific send buttons(s) to their theme.

Usage

<?php wp_connect_send_button
    $url$font$colorscheme$ref$height$echo 
); ?>

Parameters

$url
(string) (required) The URL to Send. Defaults to the current page.
Default: None. Pass an empty string for the current page.
$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

$colorscheme
(required) The color scheme of the plugin.
Valid Values:
  • WPC_THEME_LIGHT
  • WPC_THEME_DARK

Default: None

$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.
$height
(integer) (required) The height of the plugin in pixels.
Please note that it is necessary to specify the height because widget containers will NOT automatically resize to show the dynamically loaded content (which is displayed below the send button after the user clicks on it).
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 Send Button.

// 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_send_button' ) ){

	require_once( $wpc_constants_file );

	$url = 'http://www.mysite.com/my-post';
	$font = WPC_FONT_ARIAL;
	$colorscheme = WPC_THEME_DARK; // or WPC_THEME_LIGHT
	$ref = '';
	$height = 300;

	// render the send button in place
	wp_connect_send_button(
		$url,
		$font,
		$colorscheme,
		$ref,
		$height
	);
}

Change Log

Source File

wp_connect_send_button() 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_recommendations()