coresocial_display_explore
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!
Definition
Arguments
Returns
The shortcode and display function remain callable in Lite, but return an empty string without Pro access.
Omitted options inherit Explore with AI settings. Omitted networks inherits the saved provider list; an explicit empty list renders no provider buttons. Only enabled AI providers are rendered, duplicate codes are removed, and social-network codes are excluded.
The provider codes are openai (ChatGPT), claude, gemini, copilot, perplexity, and grok. Provider order is preserved unless order_by_count is enabled.
The prompt uses the page title and URL, not an upload of the page contents. Gemini uses a copy-and-open dialog. Provider sign-in, prompt submission, and access to the page depend on the provider website. Counts record clicks, not completed conversations.
Context and styling overrides apply only to this render. Output includes the button wrapper and scoped CSS variables. Styling and provider selections are reset to the saved settings afterward.
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): Optional wrapper ID; an empty value generates a unique ID. 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.networks(array|string): Ordered provider codes: openai, claude, gemini, copilot, perplexity, grok. Shortcodes use a comma-separated string. An explicit empty list shows no buttons. Default: Saved Explore provider list.prompt(string): Prompt containing optional {title} and {url} placeholders. Default: Saved Explore prompt.custom_background(string): Hex background color for custom color schemes. Default: Saved Explore setting.custom_text(string): Hex text/icon color for custom_colors. Default: Saved Explore setting.font_size(int|string): Nonnegative pixel value, with or without px. Converted to an integer and capped at 1000px. Default: Saved Explore setting.button_size(int|string): Nonnegative pixel value, with or without px. Converted to an integer and capped at 1000px. Default: Saved Explore setting.button_gap(int|string): Nonnegative pixel value, with or without px. Converted to an integer and capped at 1000px. Default: Saved Explore setting.rounded(int|string): Nonnegative pixel value, with or without px. Converted to an integer and capped at 1000px. Default: Saved Explore setting.share_count_active(bool|string): Show internal Explore click counts. Shortcodes accept true/false or 1/0. Default: Saved Explore setting.share_count_hide_if_zero(bool|string): Hide a zero click count. Shortcodes accept true/false or 1/0. Default: Saved Explore setting.order_by_count(bool|string): Sort by click count; equal counts retain provider order. Shortcodes accept true/false or 1/0. Default: Saved Explore setting.limit_visible_buttons(bool|string): Show only the initial button limit with a More button. Shortcodes accept true/false or 1/0. Default: Saved Explore setting.limit_buttons_count(int): Initially visible button count; clamped to 1–50. Used when limit_visible_buttons is enabled. Default: Saved Explore setting.class(string): Additional CSS classes for this Explore instance. Default: Saved Explore setting.
Example
coresocial_display_explore( array( 'layout' => 'icon', 'align' => 'center' ) );
$html = coresocial_display_explore( array(), false );