Maple Local Fonts has been deactivated. It requires WordPress 6.5 or higher.
No fonts installed yet.
' + ); + } + }); + } else { + alert(response.data.message || mapleLocalFontsData.strings.error); + $button.prop('disabled', false).text('Delete'); + $fontItem.removeClass('mlf-loading'); + } + }, + error: function() { + alert(mapleLocalFontsData.strings.error); + $button.prop('disabled', false).text('Delete'); + $fontItem.removeClass('mlf-loading'); + } + }); + }, + + /** + * Show a message to the user. + * + * @param {jQuery} $element Message element. + * @param {string} message Message text. + * @param {string} type Message type (success or error). + */ + showMessage: function($element, message, type) { + $element + .removeClass('mlf-message-success mlf-message-error') + .addClass('mlf-message-' + type) + .text(message) + .show(); + } + }; + + // Initialize on document ready + $(document).ready(function() { + MLF.init(); + }); + +})(jQuery); diff --git a/native/wordpress/maple-fonts-wp/assets/index.php b/native/wordpress/maple-fonts-wp/assets/index.php new file mode 100644 index 0000000..90593cd --- /dev/null +++ b/native/wordpress/maple-fonts-wp/assets/index.php @@ -0,0 +1,5 @@ +=7.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6", + "wp-coding-standards/wpcs": "^3.0", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "yoast/phpunit-polyfills": "^2.0" + }, + "scripts": { + "test": "phpunit", + "phpcs": "phpcs", + "phpcbf": "phpcbf", + "compat": "phpcs -p --standard=PHPCompatibilityWP --runtime-set testVersion 7.4- --extensions=php --ignore=vendor,tests ." + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "sort-packages": true + }, + "autoload-dev": { + "psr-4": { + "MapleLocalFonts\\Tests\\": "tests/" + } + } +} diff --git a/native/wordpress/maple-fonts-wp/includes/class-mlf-admin-page.php b/native/wordpress/maple-fonts-wp/includes/class-mlf-admin-page.php new file mode 100644 index 0000000..a1eb373 --- /dev/null +++ b/native/wordpress/maple-fonts-wp/includes/class-mlf-admin-page.php @@ -0,0 +1,210 @@ + 'Thin', + 200 => 'Extra Light', + 300 => 'Light', + 400 => 'Regular', + 500 => 'Medium', + 600 => 'Semi Bold', + 700 => 'Bold', + 800 => 'Extra Bold', + 900 => 'Black', + ]; + + /** + * Constructor. + */ + public function __construct() { + // Empty constructor - class is instantiated for rendering + } + + /** + * Render the admin page. + */ + public function render() { + $capability = function_exists('mlf_get_capability') ? mlf_get_capability() : 'edit_theme_options'; + if (!current_user_can($capability)) { + wp_die(esc_html__('You do not have sufficient permissions to access this page.', 'maple-local-fonts')); + } + + $registry = new MLF_Font_Registry(); + $installed_fonts = $registry->get_imported_fonts(); + ?> ++ +
++ ' . esc_html__('Appearance → Editor → Styles → Typography', 'maple-local-fonts') . '' + ); + ?> +
++ +
body {
+ font-family: "Open Sans", sans-serif;
+}
+h1, h2, h3, h4, h5, h6 {
+ font-family: "Open Sans", sans-serif;
+}
+ + ' . esc_html__('Appearance → Customize → Additional CSS', 'maple-local-fonts') . '' + ); + ?> +
+'; + esc_html_e('Maple Local Fonts has been deactivated. It requires WordPress 6.5 or higher.', 'maple-local-fonts'); + echo '