WPTT / webfont-loader

Download webfonts and host them locally on a WordPress site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow a custom fonts directory via a filter on the directory in use.

pattonwebz opened this issue · comments

if ( ! file_exists( WP_CONTENT_DIR . '/fonts' ) ) {
$this->get_filesystem()->mkdir( WP_CONTENT_DIR . '/fonts', FS_CHMOD_DIR );
}

The linked code as well as a number of other places in the script assume a specific directory for the fonts to exist. I would like this directory to be a filtered location because in some hosting plans the filesystem is locked down. In one of my test sites creation of files/folders directly inside the wp-content directory is forbidden so I only have 2 options:

  1. Create the /wp-content/fonts directory manually - in advance of it being used.
  2. Use a different directory to store the files.