Download the PHP package mickey-kay/better-font-awesome-library without Composer

On this page you can find all versions of the php package mickey-kay/better-font-awesome-library. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package better-font-awesome-library

Better Font Awesome Library

The easiest way to integrate Font Awesome into your WordPress project.

Table of contents

  1. Introduction
  2. Features
  3. Installation
  4. Usage
  5. Initialization Parameters
  6. Shortcode
  7. The Better Font Awesome Library Object
  8. Filters
  9. To Do
  10. Credits

Introduction

The Better Font Awesome Library allows you to automatically integrate the latest available version of Font Awesome into your WordPress project, along with accompanying CSS, shortcode, and TinyMCE icon shortcode generator. Furthermore, it generates all the data you need to create new functionality of your own.

Features

Installation

The Better Font Awesome Library should ideally be installed via Composer:

Alternately, you can install the library manually, which can be useful for development and/or custom builds:

Usage

  1. Copy the /better-font-awesome-library folder into your project.

  2. Add the following code to your main plugin file or your theme's functions.php file.

  3. If desired, use the Better Font Awesome Library object to manually include Font Awesome CSS, output lists of available icons, create your own shortcodes, and much more.

Usage Notes

The Better Font Awesome Library is designed to work in conjunction with the Better Font Awesome WordPress plugin. The plugin initializes this library (with its own initialization args) on the init hook, priority 5. When using the Better Font Awesome Library in your project, you have two options:

  1. Initialize later, to ensure that any Better Font Awesome plugin settings override yours (this is the default behavior, shown above by initializing the library on the init hook with default priority 10.
  2. Initialize earlier, to "take over" and prevent Better Font Awesome settings from having an effect.

Initialization Parameters ($args)

The following arguments can be used to initialize the library using Better_Font_Awesome_Library::get_instance( $args ):

$args['include_v4_shim']

(boolean) Include the Font Awesome v4 shim CSS stylesheet to support legacy icon.

$args['remove_existing_fa']

(boolean) Attempts to remove existing Font Awesome styles and shortcodes. This can be useful to prevent conflicts with other themes/plugins, but is no guarantee.

$args['load_styles']

(boolean) Automatically loads Font Awesome CSS on the front-end of your site using wp_enqueue_scripts().

$args['load_admin_styles']

(boolean) Automatically loads Font Awesome CSS on the admin of your site using admin_enqueue_scripts().

$args['load_shortcode']

(boolean) Loads the included [icon] shortcode.

load_tinymce_plugin

(boolean) Loads a TinyMCE drop-down list of available icons (based on the active Font Awesome version), which generates an [icon] shortcode.

Deprecated

$args['version'] (2.0.0)

The library now always defaults to the latest available version of Font Awesome.

(string) Which version of Font Awesome you want to use.

$args['minified'] (2.0.0)

The library now always defaults to minified CSS.

(boolean) Use minified Font Awesome CSS.

Shortcode

If either the $args['load_shortcode'] or $args['load_tinymce_plugin'] initialization arg is set to true, then the Better Font Awesome Library will include an [icon] shortcode that can be used as follows:

name

The unprefixed icon name (e.g. star). The version-specific prefix will be automatically prepended.

class

Unprefixed Font Awesome icon classes. The version-specific prefix will be automatically prepended to each class.

unprefixed_class

Any additional classes that you wish to remain unprefixed (e.g. my-custom-class).

style

The specific icon style (e.g. brand vs. solid) to use.

Shortcode Output

The following shortcode:

. . . will produce the following HTML:

The Better Font Awesome Library Object

The Better Font Awesome Library object can be accessed with the following code: Better_Font_Awesome_Library::get_instance();

The object has the following public methods:

get_version()

(string) Returns the active version of Font Awesome being used.

get_stylesheet_url()

(string) Returns the Font Awesome stylesheet URL.

get_stylesheet_url_v4_shim()

(string) Returns the Font Awesome v4 shim stylesheet URL.

get_icons()

(array) Returns an associative array of icon hex values (index, e.g. \f000) and unprefixed icon names (values, e.g. rocket) for all available icons in the active Font Awesome version.

get_release_icons()

(array) Returns icon data in the exact format provided by the Font Awesome GraphQL API.

get_release_assets()

(array) Returns icon asset (CSS/JS) data for the latest Font Awesome version.

get_prefix()

(string) Returns the version-dependent prefix ('fa' or 'icon') that is used in the icons' CSS classes.

get_errors()

(array) Returns all library errors, including API and CDN fetch failures.

Deprecated

get_api_data() (2.0.0)

The library no longe relies on the jsDelivr CDN.

(object) Returns version data for the remote jsDelivr CDN (uses jsDelivr API). Includes all available versions and latest version.

Example:

Filters

The Better Font Awesome Library applies the following filters:

bfa_init_args

Applied to the initialization arguments after they have been parsed with default args, but before they are used to fetch any Font Awesome data.

Parameters

bfa_wp_remote_get_args

Applied to arguments passed to all wp_remote_get() calls (useful for adjusting the timeout if needed).

Parameters

bfa_fallback_release_data_path

Applied to the path for the fallback release data JSON file. Can be used to specify an alternate fallback data file.

Parameters

bfa_release_data_transient_expiration

This value controls how often the plugin will check for the latest updated version of Font Awesome. Can be used to increase/decrease the frequency of this check as desired.

Parameters

bfa_icon_list

Applied to the icon array after it has been generated from the Font Awesome stylesheet, and before it is assigned to the Better Font Awesome Library object's $icons property.

Parameters

bfa_icon_class

Applied to the classes that are output on each icon's <i> element.

Parameters

bfa_icon_tag

Applied to the tag that is output for each icon. Defaults is 'i', which outputs <i>.

Parameters

bfa_icon

Applied to the entire <i> element that is output for each icon.

Parameters

bfa_show_errors

Applied to the boolean that determines whether or not to suppress all Font Awesome warnings that normally display in the admin.

Parameters

Deprecated

bfa_fallback_directory_path

_This is now replaced by the similar bfa_fallback_release_data_path filter._ Applied to the fallback directory path before setting up any fallback CSS info. Can be used to specify an alternate fallback directory to replace the default fallback directory.

The path must be to a local, non-remote, directory.

Parameters

bfa_api_transient_expiration (2.0.0)

_This data now comes from the GraphQL API. The new bfa_release_data_transient_expiration replaces this legacy filter._

Applied to the API (version information) transient expiration. Can be used to increase/decrease the expiration as desired.

Parameters

bfa_css_transient_expiration (2.0.0)

This data is now no longer necessary.

Applied to the CSS stylesheet data transient expiration. Can be used to increase/decrease the expiration as desired.

Parameters

bfa_force_fallback (2.0.0)

There should no longer be a need to force a fallback.

Applied to the boolean that determines whether or not to force the included fallback version of Font Awesome to load. This can be useful if you're having trouble with delays or timeouts.

Parameters

bfa_prefix (2.0.0)

Given the update to v5+ always, there should be no need to modify the icon prefix.

Applied to the Font Awesome prefix ('fa' or 'icon') before it is assigned to the Better Font Awesome Library object's $prefix property.

Parameters

To Do

Ideas? File an issue or add a pull request!

Credits

Special thanks to the following folks and their plugins for inspiration and support:

And many thanks to the following folks who helped with testing and QA:


All versions of better-font-awesome-library with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mickey-kay/better-font-awesome-library contains the following files

Loading the files please wait ....