paths = wp_upload_dir(); $this->paths['fonts'] = 'borderless_icon_fonts'; $this->paths['temp'] = trailingslashit( $this->paths['fonts'] ) . 'borderless_temp'; $this->paths['fontdir'] = trailingslashit( $this->paths['basedir'] ) . $this->paths['fonts']; $this->paths['tempdir'] = trailingslashit( $this->paths['basedir'] ) . $this->paths['temp']; $this->paths['fonturl'] = set_url_scheme( trailingslashit( $this->paths['baseurl'] ) . $this->paths['fonts'] ); $this->paths['tempurl'] = trailingslashit( $this->paths['baseurl'] ) . trailingslashit( $this->paths['temp'] ); $this->paths['config'] = 'charmap.php'; add_action( 'wp_ajax_borderless_ajax_add_zipped_font', array( $this, 'add_zipped_font' ) ); add_action( 'wp_ajax_borderless_ajax_remove_zipped_font', array( $this, 'remove_zipped_font' ) ); } function admin_scripts() { $upload_paths = wp_upload_dir(); wp_enqueue_script( 'borderless-admin-media', plugin_dir_url( __FILE__ ) . 'assets/js/icon-manager.min.js', array( 'jquery' ) ); wp_enqueue_script( 'media-upload' ); wp_enqueue_media(); wp_enqueue_style( 'borderless-wpbakery-icon-manager-admin', plugin_dir_url( __FILE__ ) . 'assets/css/icon-manager.css' ); $custom_fonts = get_option( 'borderless_icon_fonts' ); if ( is_array( $custom_fonts ) ) { foreach ( $custom_fonts as $font => $info ) { if ( strpos( $info['style'], 'http://' ) !== false ) { wp_enqueue_style( 'borderless-' . $font, $info['style'], null, '1.0', 'all' ); } else { wp_enqueue_style( 'borderless-' . $font, trailingslashit( $upload_paths['baseurl'] . '/borderless_icon_fonts/' ) . $info['style'], null, '1.0', 'all' ); } } } } /*-----------------------------------------------------------------------------------*/ /* *. Icon Pack Manager On Page Edit /*-----------------------------------------------------------------------------------*/ public function get_icon_manager( $input_name, $icon ) { $font_manager = self::get_font_manager( $id ); $output = '
' . $set_name . '
'; $output .= ''; foreach ( $icon_set as $icons ) { foreach ( $icons as $icon ) { $output .= '