coresocial_shortcodes
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
apply_filters( "coresocial_shortcodes", $codes );
coreSocial 4.0 — core/basic/Shortcodes.php:30
Arguments
Name
Type
Description
$codes
array
Map of shortcode names to callable callbacks. Initially includes coresocial-profiles-list, coresocial-share-inline, and coresocial-explore.
Returns
array — Shortcode registrations to add.
Runs before the Shortcodes service calls add_shortcode() for each entry. Register this filter before the service is initialized, for example in a small integration plugin loaded before coreSocial initializes its shortcodes.
The Explore callback is present in the map in both editions, but its output requires Pro access. Adding an alias does not bypass that requirement.
Example
add_filter( 'coresocial_shortcodes', function ( $codes ) {
$codes['my-share-buttons'] = $codes['coresocial-share-inline'];
return $codes;
} );