coresocial_display_inline

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

PHP
Definition
function coresocial_display_inline( array $args = array(), bool $echo = true );
coreSocial 4.0 — core/functions.php:19
Arguments
Name
Type
Description
Default
$args
array
Optional context and display options, described below.
array()
$echo
bool
Print the markup as well as returning it. Pass false to return it without printing.
true
Returns
string — Rendered markup, returned in both echo modes. Empty string if the inline method is unavailable.

Renders enabled social networks and internal share methods using the current page context unless overridden. Omitted display values come from the saved Inline Styling settings.

The current manual renderer does not implement a networks override or per-instance font_size, button_size, button_gap, or share_count_active overrides. It builds from all currently enabled share networks; selecting networks for automatic insertion does not restrict this manual call.

Use classes for additional wrapper classes. The manual renderer does not read the class key shown in some PHPDoc comments. Custom colors and sizing continue to use the configured CSS variables.

These are display/context options, not registration of arbitrary tracking targets. For a custom URL, supply item=”custom” and item_id=”0″; tracked post and term targets must be publicly viewable.

The function is intended for PHP templates after the WordPress query is available. It returns markup regardless of the $echo flag; do not echo the return value with $echo=true or you will print it twice.

$args options

  • item (string): Tracking context: post, term, or custom. Pair custom URLs with item_id 0. Default: Current page context.
  • item_id (int): WordPress post or term ID; use 0 for custom URLs. Default: Current page context.
  • url (string): Page URL used in links and tracking. Default: Current page URL.
  • title (string): Page title used in sharing text or the AI prompt. Default: Current page title.
  • image (string): Featured-image URL in the context passed to the renderer. Default: Current page image.
  • id (string): Wrapper HTML ID. Use a unique ID if provided. Default: empty string.
  • align (string): none, left, center, right, or justify. Default: Saved display setting.
  • layout (string): left, right, or icon. Default: Saved display setting.
  • color (string): fill, plain, custom_background, or custom_colors. Default: Saved display setting.
  • styling (string): normal, rounded, or round. Default: Saved display setting.
  • classes (string): Additional wrapper CSS classes. The manual inline renderer reads classes, not class. Default: Saved inline class setting.

Example

coresocial_display_inline( array( 'layout' => 'icon', 'align' => 'center' ) );

$html = coresocial_display_inline( array(), false );
Rate this reference
0
0
2

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0