Skip to main content

benecaster_get_social_platforms()

Utilities Free
benecaster_get_social_platforms(): array

The social platforms a show can link to, in the order [benecaster_social_links] and the show’s Social Links settings display them. Use it to offer the shortcode’s platforms choices in a block or widget, so your picker lists exactly what the shortcode renders instead of a copy that drifts.

Return Value

Type: array

slug => label, in display order, with translated labels: twitter_x, instagram, facebook, youtube, tiktok, linkedin, threads, bluesky, mastodon, discord, newsletter.

Example

foreach ( benecaster_get_social_platforms() as $slug => $label ) {
    printf( '<label><input type="checkbox" value="%s"> %s</label>', esc_attr( $slug ), esc_html( $label ) );
}

Notes

Read-only, with no filter, by design. The show's Social Links settings keep their own list, so a platform added here could be rendered but never chosen by a podcaster.

A show can also carry custom links whose slugs are not in this list; the shortcode renders those with a label of their own.

To pass the list to an editor script, use wp_localize_script() rather than copying it into JavaScript.

Need this built rather than just documented? See our services →