Search by

concept-image / wp-social-nav

concept-image

Social network links for Concept Image Acorn themes: a <x-social-nav> component, a "Réseaux sociaux" ACF options page and the network icons, published into the theme by `social-nav:install`, unused icons removed by `social-nav:clean`.

Package info

gitlab.com/concept-image-public/wp-social-nav

Issues

pkg:composer/concept-image/wp-social-nav

Statistics

Installs: 2 700

Dependents: 2

Suggesters: 0

Stars: 0

3.0.0 2026-12-04 10:38 UTC

This package is auto-updated.

Last update: 2026-12-04 09:38:49 UTC


README

WP Social Nav

Social network links for Acorn WordPress themes

For Concept Image themes (Bedrock + Sage): a <x-social-nav> Blade component, a "Réseaux sociaux" ACF options page and the network icons, published into the theme and owned by it. One list of networks in config/social-nav.php drives the admin select, the icons and the rendering. Unknown networks and unsafe URLs are never rendered. Admin labels are French, with English translations included.

Requirements

  • PHP 8.3+
  • Roots Acorn 6.1+
  • concept-image/wp-hook-attributes ^0.1 (installed with the package)
  • ACF Pro and log1x/acf-composer for the options page (both come with wp-starter-theme)
  • wp-starter-theme's sprite system for the icons (mask-sprite-* utilities, sprites.css)

Installation

wp-header and wp-footer-base already require the package. Otherwise:

composer require concept-image/wp-social-nav

Then, from the Bedrock root:

wp acorn social-nav:install

It copies into the theme:

FileRole
app/View/Components/SocialNav.phpThe <x-social-nav> component
resources/views/components/social-nav.blade.phpIts view (Tailwind)
app/Options/SocialOptions.php"Réseaux sociaux" options page, under "Autres contenus" (general-options)
config/social-nav.phpThe networks, value => label, in display order
resources/images/icons/social/*.svgThe icons of the configured networks

Existing files are kept (--force overwrites them). The command then warns about networks without an icon and prints the --sprite-* lines missing from resources/styles/src/components/sprites.css.

Once the site's networks are set in config/social-nav.php, wp acorn social-nav:clean --dry-run, then wp acorn social-nav:clean, removes the other icons from the theme (and from the sprite map).

Usage

<x-social-nav />
<x-social-nav class="justify-center gap-5" />
<x-social-nav :socials="$shop_social_links" />

Without socials, the component renders the rows of the options page. Read them elsewhere with get_field('social_media_link', 'option') (rows social_type and link), or with safe URLs through app(ConceptImage\WpSocialNav\SocialLinks::class)->fromOptions().

Networks

ValueLabel
facebookFacebook
linkedinLinkedIn
xX (Twitter)
instagramInstagram
youtubeYouTube
tiktokTikTok
blueskyBluesky
mastodonMastodon
threadsThreads
vimeoVimeo
welcome-to-the-jungleWelcome to the Jungle
spotifySpotify
whatsappWhatsApp
twitchTwitch
pinterestPinterest

The list suits French corporate, educational and medical sites: Bluesky and Mastodon are where many universities, hospitals and public bodies moved from X, Welcome to the Jungle carries the employer brand, Vimeo and Spotify carry corporate videos and podcasts, Pinterest suits training, recipe or design content.

To add a network, add a line to the theme's config/social-nav.php ('doctolib' => 'Doctolib'), its SVG to resources/images/icons/social/doctolib.svg, and --sprite-doctolib: url("/__spritemap#sprite-doctolib-view"); to sprites.css. Never rename or remove a value already used: saved rows keep it.

Commands

CommandDoes
wp acorn social-nav:install [--force]Copies the component, view, options page, config and icons into the theme, then reports missing icons and sprite variables
wp acorn social-nav:clean [--dry-run] [--force]Deletes the theme icons of networks absent from config/social-nav.php (asks first; --dry-run lists them), then lists the --sprite-* lines to remove. social-nav:install restores an icon once its network is configured again
wp acorn vendor:publish --tag=wp-social-navThe same files without the report (2.x tag, run by wp-header and wp-footer-base)

Customizing

The published files are project code: change the classes of the view (bg-primary hocus:bg-secondary colours the icon, which is a CSS mask; w-6 sizes it), the page capability, the networks. Keep the field names social_media_link, social_type and link: saved values are stored under their keys.

Translations

Admin strings are written in French (text domain wp-social-nav). The package ships languages/wp-social-nav.pot and English translations (en_US, en_GB, used for every en_* locale), loaded on init.

Claude Code

wp acorn starter:ai (wp-starter-theme) publishes the wp-social-nav skill and rules into the project's .claude/; alone: wp acorn vendor:publish --tag=wp-social-nav-ai.

Upgrading

From 2.x: see UPGRADE. Files published by 2.x keep working unchanged.

Development

composer install
composer ci   # Pint, Larastan (src/), PHPStan (components/), Pest

Changelog

See CHANGELOG.

Contributing

Contributions are welcome! Please submit a merge request or open an issue to discuss what you would like to change. See CONTRIBUTING.

License

This package is open-sourced software licensed under the MIT license. Please see License File for more information.

Credits