Guide

Icon Library architecture

Sprite delivery constants, build, and how other plugins render icons.

Role

At load time the plugin defines:

ConstantValue
PRC_PLATFORM_ICONS_URL{plugin_dir_url}/build/icons/sprites/
PRC_PLATFORM_ICONS_PATH{plugin_dir_path}/build/icons/sprites/

\PRC\Platform\Icons\* helpers in prc-scripts resolve icons against those paths. If the plugin is inactive or a sprite is missing, helpers return HTML comments instead of throwing.

Rendering APIs (in prc-scripts, not this plugin):

  • Icons\render( $library, $icon, $size ) — cached inline <i> markup
  • Icons\get_icon_as_svg() — SVG fragment
  • Icons\get_icon_as_data_uri() — data URI for CSS
  • Icons\get_icon_as_url() — sprite fragment URL (…/solid.svg#arrow-right)

Sprite libraries

On the private monorepo, Pro style sprites live under build/icons/sprites/. The public sibling repo ships only brands.svg (Font Awesome Free Brands). Other styles require a local Font Awesome Pro kit build.

bin/build.sh copies sprites from node_modules/@awesome.me/kit-*/icons/sprites/ into build/icons/sprites/. After rebuilding sprites, regenerate the @prc/icons index used by IconPicker (see the plugin README).

Robots

On public sites the plugin appends a robots.txt disallow for /wp-content/plugins/prc-icon-library/ under both User-agent: * and User-agent: Googlebot.

Future direction

PRC plans to move from vendored SVG sprites toward WordPress core’s SVG Icon API (WP_Icons_Registry, collection registration, editor icon picker) as those APIs stabilize. Until then, this sprite-reference pattern remains the supported path for prc-block-bits/icon-span, shareable-text brand icons, and Icons\render().

Was this helpful?