public static function update_file_paths() { global $wp_filesystem; /* * Assume FTP is rooted to the Wordpress install */ self::$directory = self::get_base_directory(FP_PDF_PLUGIN_DIR); self::$template_directory = self::get_base_directory(FP_PDF_TEMPLATE_LOCATION); self::$template_save_directory = self::get_base_directory(FP_PDF_SAVE_LOCATION); self::$template_font_directory = self::get_base_directory(FP_PDF_FONT_LOCATION); }
public static function fully_loaded_admin() { /* * Check if the user has switched themes and they haven't yet prompt user to copy over directory structure * If the plugin has just initialised we won't check for a theme swap as initialisation will reset this value */ if (!rgpost('upgrade')) { FPPDF_InstallUpdater::check_theme_switch(); } }
public static function initialise_fonts() { /* check nonce and permission */ if (!wp_verify_nonce($_POST['nonce'], 'fppdfe_nonce') || !current_user_can('frm_edit_forms')) { print json_encode(array('error' => 'Access denied. Failed to initialise fonts.')); } /* * We only want to reinitialise the font files and configuration */ FPPDF_InstallUpdater::initialise_fonts(); /* * Output the message back to the user */ ob_start(); do_action('fppdfe_notices'); $message = ob_get_contents(); ob_end_clean(); print json_encode(array('message' => $message)); exit; }