coresocial_method_networks
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_method_networks", $codes, $method, $context, $method_instance );
Arguments
Name
Type
Description
$codes
string[]
Selected network codes in their current order.
$method
string
Method name: inline, floating, or explore.
$context
array
Item context: item, item_id, url, title, image.
$method_instance
Dev4Press\Plugin\coreSocial\Base\Method
Current method instance.
Returns
string[] — ordered network codes.
Return ordered codes before button construction and online-count queueing. Empty arrays render no buttons. Unavailable and duplicate codes are ignored, and AI/social and edition boundaries remain enforced. Non-array returns preserve the original selection. Pro count sorting runs afterward.
Example
add_filter( 'coresocial_method_networks', function ( $codes, $method, $context ) {
return $method === 'inline' ? array_reverse( $codes ) : $codes;
}, 10, 3 );