JPKCOM_FASVG_PATH
public
mixed
JPKCOM_FASVG_PATH
= \jpkcom_fasvg_path()
public
mixed
JPKCOM_FASVG_PATH
= \jpkcom_fasvg_path()
public
mixed
JPKCOM_FASVG_PLUGIN_PATH
= \plugin_dir_path(__FILE__)
public
mixed
JPKCOM_FASVG_PLUGIN_URL
= \plugin_dir_url(__FILE__)
public
mixed
JPKCOM_FASVG_URL
= \jpkcom_fasvg_url()
public
mixed
JPKCOM_FASVG_VERSION
= '2.0.16'
Filesystem base for the Font Awesome CSS and SVGs.
jpkcom_fasvg_path() : string
Resolved on every call rather than once at load time. The plugin can be
network-activated, and on multisite each site has its own upload
directory: a value captured while the file was included would keep
pointing at the site that happened to be active then, which is wrong for
anything rendered after switch_to_blog().
Uses wp_get_upload_dir(), i.e. wp_upload_dir( null, false ) — the
variant that does not try to create the directory. Reading icons never
needs that side effect. Both are statically cached, so the per-call cost
is a fraction of a microsecond.
Absolute path with a trailing slash.
URL base for the Font Awesome CSS and SVGs.
jpkcom_fasvg_url() : string
Same reasoning as jpkcom_fasvg_path().
URL with a trailing slash.
jpkcom_fasvg_register_style() : void
jpkcom_fasvg_enqueue_files() : void
jpkcom_fasvg_enqueue_gutenberg_files() : void
jpkcom_fasvg_navigation_fa(array<string|int, mixed> $menu_items) : array<string|int, mixed>
Render the [jsvg] shortcode as an inline Font Awesome SVG.
jpkcom_fasvg_shortcode(array<string, string>|string $atts) : string
Supported attributes:
The file name is reduced to a flat name with basename() and
sanitize_file_name(), and .svg is always appended, so no path outside
<uploads>/jpkcom_fasvg/svgs/<style>/ can be reached. The style folder is
whitelisted. The raw file contents are returned inline — the trust
boundary is that directory, so only vetted Font Awesome SVGs belong there.
Shortcode attributes ( empty string when none are supplied ).
The inline SVG markup.
Deprecated alias of {@see jpkcom_fasvg_shortcode()}.
Use jpkcom_fasvg_shortcode() instead.
jsvg_code(array<string, string>|string $atts) : string
The original name carried no vendor prefix and no function_exists()
guard, so any theme or plugin declaring jsvg_code produced a fatal
redeclare error on load. Kept as a shim for code calling it directly.
Shortcode attributes.
The inline SVG markup.