├── index.php ├── lang ├── arabic-webfonts.mo ├── arabic-webfonts-ar.mo ├── arabic-webfonts.pot ├── arabic-webfonts-ar.po └── arabic-webfonts-ar.pot ├── vendor ├── autoload.php ├── composer │ ├── autoload_classmap.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_static.php │ ├── LICENSE │ ├── installed.json │ ├── autoload_real.php │ └── ClassLoader.php └── jozoor │ └── wp-plugin-action-links │ ├── composer.json │ ├── .gitignore │ ├── src │ └── Links.php │ └── README.md ├── composer.json ├── assets ├── css │ └── customizer-controls.css └── js │ ├── customizer-controls.js │ └── customizer-preview.js ├── arabic-webfonts.php ├── README.md ├── composer.lock ├── includes ├── class-arabic-webfonts-custom-controls.php ├── class-arabic-webfonts-customizer.php ├── class-arabic-webfonts-post-type.php └── class-arabic-webfonts.php ├── uninstall.php ├── readme.txt └── LICENSE /index.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/jozoor/wp-plugin-action-links/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/jozoor/wp-plugin-action-links/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jozoor/wp-plugin-action-links", 3 | "description": "WordPress module to add the list of links to display on the plugins page beside the activate and deactivate links.", 4 | "version": "1.0.0", 5 | "keywords": ["wordpress", "plugins", "action", "links"], 6 | "homepage": "https://github.com/mohamdio/wp-plugin-action-links", 7 | "license": "GPL-2.0+", 8 | "authors": [ 9 | { 10 | "name": "Mohamed Abd Elhalim", 11 | "homepage": "https://mohamd.io/" 12 | } 13 | ], 14 | "require": { 15 | "php": ">=5.6" 16 | }, 17 | "require-dev": { 18 | "phpunit/phpunit": "5.7", 19 | "phpunit/php-code-coverage": "4.0.8" 20 | }, 21 | "autoload": { 22 | "psr-4": { "JO\\Module\\PluginActionLinks\\": "src/" } 23 | }, 24 | "scripts": { 25 | "test": [ 26 | "./vendor/bin/phpunit" 27 | ] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'JO\\Module\\PluginActionLinks\\' => 28, 13 | ), 14 | ); 15 | 16 | public static $prefixDirsPsr4 = array ( 17 | 'JO\\Module\\PluginActionLinks\\' => 18 | array ( 19 | 0 => __DIR__ . '/..' . '/jozoor/wp-plugin-action-links/src', 20 | ), 21 | ); 22 | 23 | public static function getInitializer(ClassLoader $loader) 24 | { 25 | return \Closure::bind(function () use ($loader) { 26 | $loader->prefixLengthsPsr4 = ComposerStaticInita61f4806cf4ccdb281085d93679c75c8::$prefixLengthsPsr4; 27 | $loader->prefixDirsPsr4 = ComposerStaticInita61f4806cf4ccdb281085d93679c75c8::$prefixDirsPsr4; 28 | 29 | }, null, ClassLoader::class); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/jozoor/wp-plugin-action-links/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/macos,composer 2 | 3 | ### Composer ### 4 | composer.phar 5 | composer.lock 6 | /vendor/ 7 | 8 | # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file 9 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 10 | # composer.lock 11 | 12 | ### macOS ### 13 | *.DS_Store 14 | .AppleDouble 15 | .LSOverride 16 | 17 | # Icon must end with two \r 18 | Icon 19 | 20 | # Thumbnails 21 | ._* 22 | 23 | # Files that might appear in the root of a volume 24 | .DocumentRevisions-V100 25 | .fseventsd 26 | .Spotlight-V100 27 | .TemporaryItems 28 | .Trashes 29 | .VolumeIcon.icns 30 | .com.apple.timemachine.donotpresent 31 | 32 | # Directories potentially created on remote AFP share 33 | .AppleDB 34 | .AppleDesktop 35 | Network Trash Folder 36 | Temporary Items 37 | .apdisk 38 | 39 | # End of https://www.gitignore.io/api/macos,composer 40 | 41 | # ignore this test file which using as a plugin 42 | plugin-action-links.php -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jozoor/arabic-webfonts", 3 | "description": "An easy way to add Arabic fonts to any theme without coding using WordPress Customizer.", 4 | "version": "1.4.5", 5 | "keywords": ["Arabic", "Arabic fonts", "Arabic webfonts", "webfonts", "fonts", "Typography", "WordPress fonts", "WordPress Arabic fonts plugin", "WordPress customizer"], 6 | "type": "wordpress-plugin", 7 | "homepage": "https://plugins.jozoor.com/arabic-webfonts/", 8 | "license": "GPL-2.0+", 9 | "authors": [ 10 | { 11 | "name": "jozoor", 12 | "email": "info@jozoor.com", 13 | "homepage": "https://jozoor.com/", 14 | "role": "Developer" 15 | }, 16 | { 17 | "name": "Mohamed Abd Elhalim", 18 | "email": "mohamdiod@gmail.com", 19 | "homepage": "https://mohamd.io/", 20 | "role": "Developer" 21 | } 22 | ], 23 | "require": { 24 | "php": ">=5.6", 25 | "jozoor/wp-plugin-action-links": "dev-dist" 26 | }, 27 | "repositories": [ 28 | { 29 | "type": "vcs", 30 | "url": "git@github.com:mohamdio/wp-plugin-action-links.git", 31 | "no-api": true 32 | } 33 | ], 34 | "autoload": {}, 35 | "scripts": {} 36 | } -------------------------------------------------------------------------------- /assets/css/customizer-controls.css: -------------------------------------------------------------------------------- 1 | /** 2 | * This file working for customizer controls. 3 | */ 4 | .awf-reset-button { 5 | margin-top: 12px !important; 6 | } 7 | 8 | .awf-fields-group { 9 | border:1px solid #E4E4E4; 10 | padding:6px 10px; 11 | background:#fff; 12 | position: relative; 13 | } 14 | 15 | .awf-fields-group:after { 16 | content: '\f140'; 17 | border: none; 18 | background: 0 0; 19 | font: 400 20px/1 dashicons; 20 | speak: none; 21 | display: block; 22 | padding: 0; 23 | text-indent: 0; 24 | text-align: center; 25 | position: relative; 26 | -webkit-font-smoothing: antialiased; 27 | -moz-osx-font-smoothing: grayscale; 28 | text-decoration: none!important; 29 | position: absolute; 30 | z-index: 1; 31 | float: right; 32 | right: 5px; 33 | top: 8px; 34 | } 35 | 36 | .awf-fields-group.open:after { 37 | content: '\f142'; 38 | } 39 | 40 | .jozoor-plugins-list li { 41 | padding: 10px; 42 | background-color: #fff; 43 | margin-bottom: 10px; 44 | } 45 | 46 | .jozoor-plugins-list a { 47 | text-decoration: none; 48 | } 49 | 50 | .jozoor-plugins-list a.awf-jozoor-plugin-name { 51 | font-size: 16px; 52 | } 53 | 54 | body.rtl .awf-fields-group:after { 55 | right: inherit; 56 | left: 5px; 57 | } 58 | 59 | #accordion-panel-awf_arabic_webfonts .customize-control select { 60 | width: 100%; 61 | } -------------------------------------------------------------------------------- /arabic-webfonts.php: -------------------------------------------------------------------------------- 1 | =5.6" 19 | }, 20 | "require-dev": { 21 | "phpunit/php-code-coverage": "4.0.8", 22 | "phpunit/phpunit": "5.7" 23 | }, 24 | "time": "2018-02-12T16:03:28+00:00", 25 | "type": "library", 26 | "installation-source": "source", 27 | "autoload": { 28 | "psr-4": { 29 | "JO\\Module\\PluginActionLinks\\": "src/" 30 | } 31 | }, 32 | "scripts": { 33 | "test": [ 34 | "./vendor/bin/phpunit" 35 | ] 36 | }, 37 | "license": [ 38 | "GPL-2.0+" 39 | ], 40 | "authors": [ 41 | { 42 | "name": "Mohamed Abd Elhalim", 43 | "homepage": "https://mohamd.io/" 44 | } 45 | ], 46 | "description": "WordPress module to add the list of links to display on the plugins page beside the activate and deactivate links.", 47 | "homepage": "https://github.com/mohamdio/wp-plugin-action-links", 48 | "keywords": [ 49 | "action", 50 | "links", 51 | "plugins", 52 | "wordpress" 53 | ] 54 | } 55 | ] 56 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInita61f4806cf4ccdb281085d93679c75c8::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | return $loader; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arabic-Webfonts 2 | > WordPress plugin which allow you to add Arabic fonts easily to any theme without coding using WordPress Customizer. 3 | 4 | * Requires at least: 4.0 5 | * Tested up to: 4.9.2 6 | * Requires PHP: 5.6 7 | * Stable tag: 1.4.5 8 | * License: GPLv2 or later 9 | 10 | ### Description 11 | 12 | An easy way to add Arabic fonts to any theme without coding using WordPress Customizer. 13 | 14 | [Arabic Webfonts Site](http://plugins.jozoor.com/arabic-webfonts/) | [Jozoor Plugins](https://codecanyon.net/user/jozoor/portfolio?ref=Jozoor) | [Jozoor Themes](https://themeforest.net/user/jozoor/portfolio?ref=Jozoor) 15 | 16 | Follow us: [Twitter](https://twitter.com/jozoor) - [Facebook](https://www.facebook.com/Jozoor) - [Youtube](https://youtube.com/jozoor) - [Dribbble](https://dribbble.com/jozoor) 17 | 18 | [youtube https://www.youtube.com/watch?v=MoAGLEywBgg] 19 | 20 | An easy way to add Arabic fonts to any theme without coding using WordPress Customizer. This plugin integrates with the WordPress Customizer so you can preview all Arabic fonts on your site in realtime. It's compatible with any theme. 21 | 22 | It also allows you to create custom font controls in the plugin admin page area to control particular css selectors. Once created, these custom font controls are instantly available in the customizer no coding required! 23 | 24 | The plugin depend on " Arabic fonts library " from : [fontface.me](http://fontface.me/) 25 | 26 | ### Plugin Features 27 | * An easy way to add Arabic fonts to your site. 28 | * Control in the font type, size and style for any section in real time. 29 | * Adding custom font controls for your theme. 30 | * Reset any section settings or all settings. 31 | 32 | ### Jozoor Plugins List 33 | * [Shortcode Cleaner](https://plugins.jozoor.com/shortcode-cleaner/) : 34 | Clean your WordPress content from unused broken shortcodes. [Watch Demo](https://www.youtube.com/watch?v=dXVZ5bSUduc) 35 | 36 | ### Changelog 37 | 38 | = 1.4.4 = 2016-2-25 39 | * using transient cache instead of text file 40 | 41 | = 1.4.3 = 2015-9-27 42 | * fixed header output when get the fonts list 43 | 44 | = 1.4.2 = 2015-8-23 45 | * fixed styles issues to compatible with WP 4.3 46 | 47 | = 1.4.1 = 2015-6-13 48 | * fixed Apply font to whole website 49 | 50 | = 1.4 = 2015-5-18 51 | * fixed fonts file cache time & tested up to: 4.2.2 52 | 53 | = 1.3 = 2015-5-2 54 | * fixed custom controls number which was show latest 5 enough 55 | 56 | = 1.2 = 2015-4-30 57 | * start using fontface API to get list of all fonts as JSON 58 | 59 | = 1.1 = 2015-4-28 60 | * added 3 new fonts 61 | * fixed font type duplicated 62 | * change menu position for plugin page 63 | 64 | = 1.0 = 2015-4-22 65 | * Initial release 66 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "ff4406b0a99f4a2bf2c74d8cd938acd8", 8 | "packages": [ 9 | { 10 | "name": "jozoor/wp-plugin-action-links", 11 | "version": "dev-dist", 12 | "source": { 13 | "type": "git", 14 | "url": "git@github.com:mohamdio/wp-plugin-action-links.git", 15 | "reference": "9c02c38327d7d8eb0795a20bba5f7653652ba2b1" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/mohamdio/wp-plugin-action-links/zipball/9c02c38327d7d8eb0795a20bba5f7653652ba2b1", 20 | "reference": "9c02c38327d7d8eb0795a20bba5f7653652ba2b1", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=5.6" 25 | }, 26 | "require-dev": { 27 | "phpunit/php-code-coverage": "4.0.8", 28 | "phpunit/phpunit": "5.7" 29 | }, 30 | "type": "library", 31 | "autoload": { 32 | "psr-4": { 33 | "JO\\Module\\PluginActionLinks\\": "src/" 34 | } 35 | }, 36 | "scripts": { 37 | "test": [ 38 | "./vendor/bin/phpunit" 39 | ] 40 | }, 41 | "license": [ 42 | "GPL-2.0+" 43 | ], 44 | "authors": [ 45 | { 46 | "name": "Mohamed Abd Elhalim", 47 | "homepage": "https://mohamd.io/" 48 | } 49 | ], 50 | "description": "WordPress module to add the list of links to display on the plugins page beside the activate and deactivate links.", 51 | "homepage": "https://github.com/mohamdio/wp-plugin-action-links", 52 | "keywords": [ 53 | "action", 54 | "links", 55 | "plugins", 56 | "wordpress" 57 | ], 58 | "time": "2018-02-12T16:03:28+00:00" 59 | } 60 | ], 61 | "packages-dev": [], 62 | "aliases": [], 63 | "minimum-stability": "stable", 64 | "stability-flags": { 65 | "jozoor/wp-plugin-action-links": 20 66 | }, 67 | "prefer-stable": false, 68 | "prefer-lowest": false, 69 | "platform": { 70 | "php": ">=5.6" 71 | }, 72 | "platform-dev": [] 73 | } 74 | -------------------------------------------------------------------------------- /includes/class-arabic-webfonts-custom-controls.php: -------------------------------------------------------------------------------- 1 | 29 | 34 | 52 | 55 | 73 | 76 | 85 |
86 | 87 |
88 | Twitter | 89 | Facebook | 90 | Youtube | 91 | Dribbble 92 | plugin_basename = $plugin_basename; 54 | 55 | // set links position 56 | $this->links_position = $links_position; 57 | 58 | } 59 | 60 | /** 61 | * Add new links. 62 | * 63 | * @since 1.0.0 64 | * @access public 65 | * @param array $links 66 | * @return array 67 | */ 68 | public function add($links) 69 | { 70 | 71 | // if empty or not array 72 | if (empty($links) || !is_array($links)) { 73 | throw new \Exception('New links should be an array and not empty!'); 74 | } 75 | 76 | // set new links 77 | $this->links = $links; 78 | 79 | // now we can display links on the plugin page 80 | add_filter('plugin_action_links', array($this, 'add_links'), 10, 5); 81 | 82 | } 83 | 84 | /** 85 | * Add new links to merge with default plugin links 86 | * 87 | * @since 1.0.0 88 | * @access public 89 | * @param array $actions default actions links 90 | * @param string $plugin_file plugin basename file 91 | */ 92 | public function add_links($actions, $plugin_file) 93 | { 94 | 95 | // store the plugin 96 | static $plugin; 97 | 98 | // get the plugin basename file 99 | $plugin = $this->plugin_basename; 100 | 101 | // now we can add new links 102 | if ($plugin === $plugin_file) { 103 | 104 | // loop in links and add it 105 | foreach ($this->links as $link) { 106 | 107 | // add link before default links 108 | if ($this->links_position === 'before') { 109 | $actions = array_merge($link, $actions); 110 | } else { 111 | // add link after default links 112 | $actions = array_merge($actions, $link); 113 | } 114 | 115 | } // end links loop 116 | 117 | } 118 | 119 | return $actions; 120 | 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /vendor/jozoor/wp-plugin-action-links/README.md: -------------------------------------------------------------------------------- 1 | # :zap: Plugin Action Links 2 | > WordPress module to add the list of links to display on the plugins page beside the activate and deactivate links. 3 | 4 | [![Build Status](https://travis-ci.com/mohamdio/wp-plugin-action-links.svg?token=bRxzrnGmzUbSj8ogmJVZ&branch=dist)](https://travis-ci.com/mohamdio/wp-plugin-action-links) [![License: GPL-2.0+](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) 5 | 6 | ## Installation 7 | 8 | #### :heavy_exclamation_mark: Minimum requirements 9 | 10 | **PHP:** 5.6 11 | 12 | **WordPress:** 4.6 13 | 14 | #### :heavy_minus_sign: Install with composer 15 | 16 | Run the following in your terminal to install **wp-plugin-action-links** with [Composer](https://getcomposer.org/). 17 | 18 | ``` 19 | composer require jozoor/wp-plugin-action-links 20 | ``` 21 | 22 | As **wp-plugin-action-links** uses [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloading you will need to use Composers autoloader. Below is a basic example of getting started with the class, though your setup maybe different depending on how you are using composer, this example below show you simple usage of create new post type: 23 | 24 | ```php 25 | require_once __DIR__ . '/vendor/autoload.php'; 26 | 27 | use JO\Module\PluginActionLinks\Links; 28 | ``` 29 | 30 | See Composers [basic usage](https://getcomposer.org/doc/01-basic-usage.md#autoloading) guide for details on working Composer and autoloading. 31 | 32 | #### :heavy_minus_sign: Download the module and include it manually 33 | 34 | If you don't using composer and want to to include the library manually, you can do that, this example below show you simple usage of create new post type: 35 | 36 | ```php 37 | /** 38 | * load main file 39 | */ 40 | // for add Links 41 | require_once __DIR__ . '/wp-plugin-action-links/src/Links.php'; 42 | 43 | use JO\Module\PluginActionLinks\Links; 44 | ``` 45 | 46 | ## Usage 47 | 48 | You can add list of links to display on the plugins page, beside the activate and deactivate links, for example: 49 | 50 | ```php 51 | 52 | // use the module 53 | use JO\Module\PluginActionLinks\Links; 54 | 55 | // default example for add new links 56 | // new Links($plugin_basename, $links_position) 57 | // $plugin_basename: string 58 | // - plugin_basename(__FILE__) (if you use module in the main plugin file) 59 | // - if you using module inside nested folders, you should define 60 | // plugin_basename correctly to get the correct plugin folder and name, 61 | // or you can add it manually like that: 'my-test-plugin/my-test-plugin.php' 62 | // $links_position: string (optional) 63 | // - 'after': after default plugin links (default option) 64 | // - 'before': before default plugin links 65 | 66 | // define which plugin for add links to it 67 | $my_plugin_links = new Links(plugin_basename(__FILE__)); 68 | 69 | // you can also define new links before default links like that: 70 | $my_plugin_links = new Links(plugin_basename(__FILE__), 'before'); 71 | 72 | // add new links for my plugin 73 | $my_new_links = [ 74 | [ 75 | 'settings' => '' . __('Settings', 'text-domain') . '' 76 | ], 77 | [ 78 | 'support' => '' . __('Support', 'text-domain') . '' 79 | ], 80 | [ 81 | 'more-plugins' => '' . __('More plugins by Jozoor', 'text-domain') . '' 82 | ], 83 | ]; 84 | $my_plugin_links-> add($my_new_links); 85 | 86 | // so now you will get new links for your plugin 87 | 88 | ``` 89 | 90 | ## Author 91 | 92 | **Mohamed Abd Elhalim** 93 | 94 | - [site](https://mohamd.io/) 95 | - [twitter](https://twitter.com/mohamdio) 96 | -------------------------------------------------------------------------------- /assets/js/customizer-controls.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file working for customizer controls. 3 | */ 4 | jQuery(document).ready(function($) { 5 | 6 | /** 7 | ***************************** 8 | * Reset button 9 | ***************************** 10 | */ 11 | $('.awf-reset-button').on('click', function () { 12 | 13 | var section = $(this).attr('id'); 14 | 15 | var msg = confirm(AWF_Customizer_Reset.confirm); 16 | 17 | if (!msg) return; 18 | 19 | var data = { 20 | wp_customize: 'on', 21 | action: 'reset_customizer_settings', 22 | reset_section: section, 23 | }; 24 | 25 | $.post(ajaxurl, data, function () { 26 | wp.customize.state('saved').set(true); 27 | location.reload(); 28 | }); 29 | 30 | }); 31 | 32 | 33 | /** 34 | ***************************** 35 | * Fields group 36 | ***************************** 37 | */ 38 | 39 | // check if group opened 40 | $('*[id*=fields_group].customize-control').click(function() { 41 | 42 | if ( $(this).find('.awf-fields-group').hasClass('open')) { 43 | $(this).find('.awf-fields-group').removeClass('open'); 44 | return false; 45 | } else { 46 | $(this).find('.awf-fields-group').addClass('open'); 47 | return false; 48 | } 49 | 50 | }); 51 | 52 | // get number from id 53 | var getNumericPart = function(id) { 54 | 55 | var $num = id.replace(/\D+/g, ''); 56 | return $num; 57 | 58 | } 59 | 60 | // Heading section 61 | $('[id$=awf_headings_styles] .awf-fields-group').each(function() { 62 | 63 | var num = getNumericPart($(this).attr('id')); 64 | 65 | $('[id$=awf_headings_styles] .accordion-section-title').click(function() { 66 | $('[id$=awf_headings_styles] .customize-control').hide(); 67 | $('[id$=awf_headings_styles] *[id*=fields_group].customize-control').show(); 68 | }); 69 | 70 | $('[id$=awf_headings_styles] *[id*='+num+'_fields_group].customize-control').click(function() { 71 | $('[id$=awf_headings_styles] .customize-control').not($('[id$=awf_headings_styles] *[id*='+num+'].customize-control')).hide().find('.awf-fields-group').removeClass('open'); 72 | $('[id$=awf_headings_styles] *[id*='+num+'].customize-control').toggle(); 73 | $('[id$=awf_headings_styles] *[id*=fields_group].customize-control').show(); 74 | }); 75 | 76 | }); 77 | 78 | // Custom controls section 79 | if ( $('[id$=awf_custom_controls_styles]')[0] ) { 80 | 81 | $('[id$=awf_custom_controls_styles] .awf-fields-group').each(function() { 82 | 83 | var num = getNumericPart($(this).attr('id')); 84 | 85 | $('[id$=awf_custom_controls_styles] .accordion-section-title').click(function() { 86 | $('[id$=awf_custom_controls_styles] .customize-control').hide(); 87 | $('[id$=awf_custom_controls_styles] *[id*=fields_group].customize-control').show(); 88 | }); 89 | 90 | $('[id$=awf_custom_controls_styles] *[id*='+num+'_fields_group].customize-control').click(function() { 91 | $('[id$=awf_custom_controls_styles] .customize-control').not($('[id$=awf_custom_controls_styles] *[id*='+num+'].customize-control')).hide().find('.awf-fields-group').removeClass('open'); 92 | $('[id$=awf_custom_controls_styles] *[id*='+num+'].customize-control').toggle(); 93 | $('[id$=awf_custom_controls_styles] *[id*=fields_group].customize-control').show(); 94 | }); 95 | 96 | }); 97 | 98 | } 99 | 100 | }); -------------------------------------------------------------------------------- /uninstall.php: -------------------------------------------------------------------------------- 1 | 'awf_font_control', 'nopaging' => true ); 78 | 79 | $query = new WP_Query ($args); 80 | while ($query->have_posts ()) { 81 | 82 | $query->the_post (); 83 | $id = get_the_ID (); 84 | wp_delete_post ($id, true); 85 | 86 | } 87 | 88 | wp_reset_postdata (); 89 | 90 | } 91 | 92 | /** 93 | * Remove all theme mods. 94 | * 95 | * @since 1.0 96 | */ 97 | function awf_remove_all_theme_mods() { 98 | 99 | remove_theme_mod('awf_body_font_family'); 100 | remove_theme_mod('awf_body_font_size'); 101 | remove_theme_mod('awf_body_line_height'); 102 | remove_theme_mod('awf_paragraphs_font_family'); 103 | remove_theme_mod('awf_paragraphs_font_size'); 104 | remove_theme_mod('awf_paragraphs_line_height'); 105 | remove_theme_mod('awf_paragraphs_text_decoration'); 106 | remove_theme_mod('awf_h1_font_family'); 107 | remove_theme_mod('awf_h1_font_size'); 108 | remove_theme_mod('awf_h1_line_height'); 109 | remove_theme_mod('awf_h1_text_decoration'); 110 | remove_theme_mod('awf_h2_font_family'); 111 | remove_theme_mod('awf_h2_font_size'); 112 | remove_theme_mod('awf_h2_line_height'); 113 | remove_theme_mod('awf_h2_text_decoration'); 114 | remove_theme_mod('awf_h3_font_family'); 115 | remove_theme_mod('awf_h3_font_size'); 116 | remove_theme_mod('awf_h3_line_height'); 117 | remove_theme_mod('awf_h3_text_decoration'); 118 | remove_theme_mod('awf_h4_font_family'); 119 | remove_theme_mod('awf_h4_font_size'); 120 | remove_theme_mod('awf_h4_line_height'); 121 | remove_theme_mod('awf_h4_text_decoration'); 122 | remove_theme_mod('awf_h5_font_family'); 123 | remove_theme_mod('awf_h5_font_size'); 124 | remove_theme_mod('awf_h5_line_height'); 125 | remove_theme_mod('awf_h5_text_decoration'); 126 | remove_theme_mod('awf_h6_font_family'); 127 | remove_theme_mod('awf_h6_font_size'); 128 | remove_theme_mod('awf_h6_line_height'); 129 | remove_theme_mod('awf_h6_text_decoration'); 130 | 131 | } 132 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Arabic Webfonts === 2 | Contributors: jozoor, mandooox 3 | Tags: Arabic, Arabic fonts, Arabic webfonts, webfonts, fonts, Typography, WordPress fonts, WordPress Arabic fonts plugin, WordPress customizer 4 | Donate link: https://codecanyon.net/user/jozoor/portfolio?ref=Jozoor 5 | Requires at least: 4.0 6 | Tested up to: 4.9.2 7 | Requires PHP: 5.3 8 | Stable tag: 1.4.6 9 | License: GPLv2 or later 10 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 | 12 | An easy way to add Arabic fonts to any theme without coding using WordPress Customizer. 13 | 14 | == Description == 15 | 16 | > An easy way to add Arabic fonts to any theme without coding using WordPress Customizer. 17 | 18 | [youtube https://www.youtube.com/watch?v=MoAGLEywBgg] 19 | 20 | [Arabic Webfonts Site](http://plugins.jozoor.com/arabic-webfonts/) | [Jozoor Plugins](https://codecanyon.net/user/jozoor/portfolio?ref=Jozoor) | [Jozoor Themes](https://themeforest.net/user/jozoor/portfolio?ref=Jozoor) 21 | 22 | An easy way to add Arabic fonts to any theme without coding using WordPress Customizer. This plugin integrates with the WordPress Customizer so you can preview all Arabic fonts on your site in realtime. It's compatible with any theme. 23 | 24 | It also allows you to create custom font controls in the plugin admin page area to control particular css selectors. Once created, these custom font controls are instantly available in the customizer no coding required! 25 | 26 | The plugin depend on " Arabic fonts library " from: [fontface.me](http://fontface.me/) 27 | 28 | Arabic Webfonts Features 29 | 30 | * An easy way to add Arabic fonts to your site. 31 | * Control in the font type, size and style for any section in real time. 32 | * Adding custom font controls for your theme. 33 | * Reset any section settings or all settings. 34 | 35 | Jozoor Plugins List 36 | 37 | * [Shortcode Cleaner](https://wordpress.org/plugins/shortcode-cleaner-lite/) : 38 | Clean your WordPress content from unused broken shortcodes. [Watch Demo](https://www.youtube.com/watch?v=dXVZ5bSUduc) 39 | * [Arabic Webfonts](https://wordpress.org/plugins/arabic-webfonts/) : 40 | An easy way to add Arabic fonts to any theme without coding using WordPress Customizer. [Watch Demo](https://www.youtube.com/watch?v=MoAGLEywBgg) 41 | 42 | Follow us: [Twitter](https://twitter.com/jozoor) - [Facebook](https://www.facebook.com/Jozoor) - [Youtube](https://youtube.com/jozoor) - [Dribbble](https://dribbble.com/jozoor) - [CodeCanyon](https://codecanyon.net/user/jozoor/portfolio?ref=Jozoor) 43 | 44 | == Installation == 45 | Installing "Arabic Webfonts" can be done either by searching for "Arabic Webfonts" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps: 46 | 47 | 1. Download the plugin via WordPress.org 48 | 1. Upload the ZIP file through the 'Plugins > Add New > Upload' screen in your WordPress dashboard 49 | 1. Activate the plugin through the 'Plugins' menu in WordPress 50 | 51 | == Frequently Asked Questions == 52 | 53 | = What is the Arabic Webfonts for? = 54 | This will help you to add Arabic fonts in your site without coding using WordPress customizer. 55 | 56 | = How can I use the plugin? = 57 | just see this video demo : 58 | [youtube https://www.youtube.com/watch?v=MoAGLEywBgg] 59 | 60 | == Screenshots == 61 | 1. Plugin Overview. 62 | 2. Live Customizer Font Control Preview. 63 | 3. Create your own font controls for your theme. 64 | 65 | == Changelog == 66 | = 1.4.6 = 67 | * 2018-2-17 68 | * compatible with Dokan Multivendor Marketplace plugin 69 | * complete plugin translation 70 | * fixed custom styles for rtl sites enough 71 | * fixed custom styles for menu links styles 72 | * update composer modules 73 | 74 | = 1.4.5 = 75 | * 2018-1-29 76 | * fixed styles issues to compatible with WP 4.9.2 77 | 78 | = 1.4.4 = 79 | * 2016-2-25 80 | * using transient cache instead of text file 81 | 82 | = 1.4.3 = 83 | * 2015-9-27 84 | * fixed @header output when get the fonts list 85 | 86 | = 1.4.2 = 87 | * 2015-8-23 88 | * fixed styles issues to compatible with WP 4.3 89 | 90 | = 1.4.1 = 91 | * 2015-6-13 92 | * fixed Apply font to whole website 93 | 94 | = 1.4 = 95 | * 2015-5-18 96 | * fixed fonts file cache time & tested up to: 4.2.2 97 | 98 | = 1.3 = 99 | * 2015-5-2 100 | * fixed custom controls number which was show latest 5 enough 101 | 102 | = 1.2 = 103 | * 2015-4-30 104 | * start using fontface API to get list of all fonts as JSON 105 | 106 | = 1.1 = 107 | * 2015-4-28 108 | * added 3 new fonts 109 | * fixed font type duplicated 110 | * change menu position for plugin page 111 | 112 | = 1.0 = 113 | * 2015-4-22 114 | * Initial release 115 | 116 | == Upgrade Notice == 117 | = 1.0 = 118 | * 2015-4-22 119 | * Initial release 120 | -------------------------------------------------------------------------------- /assets/js/customizer-preview.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file adds some LIVE to the Theme Customizer live preview. 3 | */ 4 | ( function( $ ) { 5 | 6 | /** 7 | ***************************** 8 | * Body Styles section 9 | ***************************** 10 | */ 11 | 12 | // Update body font family in real time... 13 | wp.customize( 'awf_body_font_family', function( value ) { 14 | value.bind( function( newval ) { 15 | $('body.rtl, body.rtl header, body.rtl footer, body.rtl .content, body.rtl .sidebar, body.rtl p, body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6, body.rtl ul, body.rtl li, body.rtl div, body.rtl nav, body.rtl nav a, body.rtl nav ul li, body.rtl input, body.rtl button, body.rtl label, body.rtl textarea, body.rtl input::placeholder').css('font-family', newval ); 16 | } ); 17 | } ); 18 | 19 | // Update body font size in real time... 20 | wp.customize( 'awf_body_font_size', function( value ) { 21 | value.bind( function( newval ) { 22 | $('body.rtl, body.rtl header, body.rtl footer, body.rtl .content, body.rtl .sidebar, body.rtl p, body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6, body.rtl ul, body.rtl li, body.rtl div, body.rtl nav, body.rtl nav a, body.rtl nav ul li, body.rtl input, body.rtl button, body.rtl label, body.rtl textarea, body.rtl input::placeholder').css('font-size', newval+ 'px' ); 23 | } ); 24 | } ); 25 | 26 | // Update body line height in real time... 27 | wp.customize( 'awf_body_line_height', function( value ) { 28 | value.bind( function( newval ) { 29 | $('body.rtl, body.rtl header, body.rtl footer, body.rtl .content, body.rtl .sidebar, body.rtl p, body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6, body.rtl ul, body.rtl li, body.rtl div, body.rtl nav, body.rtl nav a, body.rtl nav ul li, body.rtl input, body.rtl button, body.rtl label, body.rtl textarea, body.rtl input::placeholder').css('line-height', newval ); 30 | } ); 31 | } ); 32 | 33 | 34 | /** 35 | ***************************** 36 | * Paragraphs Styles section 37 | ***************************** 38 | */ 39 | 40 | // Update paragraphs font family in real time... 41 | wp.customize( 'awf_paragraphs_font_family', function( value ) { 42 | value.bind( function( newval ) { 43 | $('body.rtl p').css('font-family', newval ); 44 | } ); 45 | } ); 46 | 47 | // Update paragraphs font size in real time... 48 | wp.customize( 'awf_paragraphs_font_size', function( value ) { 49 | value.bind( function( newval ) { 50 | $('body.rtl p').css('font-size', newval+ 'px' ); 51 | } ); 52 | } ); 53 | 54 | // Update paragraphs line height in real time... 55 | wp.customize( 'awf_paragraphs_line_height', function( value ) { 56 | value.bind( function( newval ) { 57 | $('body.rtl p').css('line-height', newval ); 58 | } ); 59 | } ); 60 | 61 | // Update paragraphs text decoration in real time... 62 | wp.customize( 'awf_paragraphs_text_decoration', function( value ) { 63 | value.bind( function( newval ) { 64 | $('body.rtl p').css('text-decoration', newval ); 65 | } ); 66 | } ); 67 | 68 | /** 69 | ***************************** 70 | * Headings Styles section 71 | ***************************** 72 | */ 73 | 74 | /** 75 | ******** H1 ******** 76 | */ 77 | 78 | // Update font family in real time... 79 | wp.customize( 'awf_h1_font_family', function( value ) { 80 | value.bind( function( newval ) { 81 | $('body.rtl h1').css('font-family', newval ); 82 | } ); 83 | } ); 84 | 85 | // Update font size in real time... 86 | wp.customize( 'awf_h1_font_size', function( value ) { 87 | value.bind( function( newval ) { 88 | $('body.rtl h1').css('font-size', newval+ 'px' ); 89 | } ); 90 | } ); 91 | 92 | // Update line height in real time... 93 | wp.customize( 'awf_h1_line_height', function( value ) { 94 | value.bind( function( newval ) { 95 | $('body.rtl h1').css('line-height', newval ); 96 | } ); 97 | } ); 98 | 99 | // Update text decoration in real time... 100 | wp.customize( 'awf_h1_text_decoration', function( value ) { 101 | value.bind( function( newval ) { 102 | $('body.rtl h1').css('text-decoration', newval ); 103 | } ); 104 | } ); 105 | 106 | /** 107 | ******** H2 ******** 108 | */ 109 | 110 | // Update font family in real time... 111 | wp.customize( 'awf_h2_font_family', function( value ) { 112 | value.bind( function( newval ) { 113 | $('body.rtl h2').css('font-family', newval ); 114 | } ); 115 | } ); 116 | 117 | // Update font size in real time... 118 | wp.customize( 'awf_h2_font_size', function( value ) { 119 | value.bind( function( newval ) { 120 | $('body.rtl h2').css('font-size', newval+ 'px' ); 121 | } ); 122 | } ); 123 | 124 | // Update line height in real time... 125 | wp.customize( 'awf_h2_line_height', function( value ) { 126 | value.bind( function( newval ) { 127 | $('body.rtl h2').css('line-height', newval ); 128 | } ); 129 | } ); 130 | 131 | // Update text decoration in real time... 132 | wp.customize( 'awf_h2_text_decoration', function( value ) { 133 | value.bind( function( newval ) { 134 | $('body.rtl h2').css('text-decoration', newval ); 135 | } ); 136 | } ); 137 | 138 | /** 139 | ******** H3 ******** 140 | */ 141 | 142 | // Update font family in real time... 143 | wp.customize( 'awf_h3_font_family', function( value ) { 144 | value.bind( function( newval ) { 145 | $('body.rtl h3').css('font-family', newval ); 146 | } ); 147 | } ); 148 | 149 | // Update font size in real time... 150 | wp.customize( 'awf_h3_font_size', function( value ) { 151 | value.bind( function( newval ) { 152 | $('body.rtl h3').css('font-size', newval+ 'px' ); 153 | } ); 154 | } ); 155 | 156 | // Update line height in real time... 157 | wp.customize( 'awf_h3_line_height', function( value ) { 158 | value.bind( function( newval ) { 159 | $('body.rtl h3').css('line-height', newval ); 160 | } ); 161 | } ); 162 | 163 | // Update text decoration in real time... 164 | wp.customize( 'awf_h3_text_decoration', function( value ) { 165 | value.bind( function( newval ) { 166 | $('body.rtl h3').css('text-decoration', newval ); 167 | } ); 168 | } ); 169 | 170 | /** 171 | ******** H4 ******** 172 | */ 173 | 174 | // Update font family in real time... 175 | wp.customize( 'awf_h4_font_family', function( value ) { 176 | value.bind( function( newval ) { 177 | $('body.rtl h4').css('font-family', newval ); 178 | } ); 179 | } ); 180 | 181 | // Update font size in real time... 182 | wp.customize( 'awf_h4_font_size', function( value ) { 183 | value.bind( function( newval ) { 184 | $('body.rtl h4').css('font-size', newval+ 'px' ); 185 | } ); 186 | } ); 187 | 188 | // Update line height in real time... 189 | wp.customize( 'awf_h4_line_height', function( value ) { 190 | value.bind( function( newval ) { 191 | $('body.rtl h4').css('line-height', newval ); 192 | } ); 193 | } ); 194 | 195 | // Update text decoration in real time... 196 | wp.customize( 'awf_h4_text_decoration', function( value ) { 197 | value.bind( function( newval ) { 198 | $('body.rtl h4').css('text-decoration', newval ); 199 | } ); 200 | } ); 201 | 202 | /** 203 | ******** H5 ******** 204 | */ 205 | 206 | // Update font family in real time... 207 | wp.customize( 'awf_h5_font_family', function( value ) { 208 | value.bind( function( newval ) { 209 | $('body.rtl h5').css('font-family', newval ); 210 | } ); 211 | } ); 212 | 213 | // Update font size in real time... 214 | wp.customize( 'awf_h5_font_size', function( value ) { 215 | value.bind( function( newval ) { 216 | $('body.rtl h5').css('font-size', newval+ 'px' ); 217 | } ); 218 | } ); 219 | 220 | // Update line height in real time... 221 | wp.customize( 'awf_h5_line_height', function( value ) { 222 | value.bind( function( newval ) { 223 | $('body.rtl h5').css('line-height', newval ); 224 | } ); 225 | } ); 226 | 227 | // Update text decoration in real time... 228 | wp.customize( 'awf_h5_text_decoration', function( value ) { 229 | value.bind( function( newval ) { 230 | $('body.rtl h5').css('text-decoration', newval ); 231 | } ); 232 | } ); 233 | 234 | /** 235 | ******** H6 ******** 236 | */ 237 | 238 | // Update font family in real time... 239 | wp.customize( 'awf_h6_font_family', function( value ) { 240 | value.bind( function( newval ) { 241 | $('body.rtl h6').css('font-family', newval ); 242 | } ); 243 | } ); 244 | 245 | // Update font size in real time... 246 | wp.customize( 'awf_h6_font_size', function( value ) { 247 | value.bind( function( newval ) { 248 | $('body.rtl h6').css('font-size', newval+ 'px' ); 249 | } ); 250 | } ); 251 | 252 | // Update line height in real time... 253 | wp.customize( 'awf_h6_line_height', function( value ) { 254 | value.bind( function( newval ) { 255 | $('body.rtl h6').css('line-height', newval ); 256 | } ); 257 | } ); 258 | 259 | // Update text decoration in real time... 260 | wp.customize( 'awf_h6_text_decoration', function( value ) { 261 | value.bind( function( newval ) { 262 | $('body.rtl h6').css('text-decoration', newval ); 263 | } ); 264 | } ); 265 | 266 | 267 | 268 | } )( jQuery ); -------------------------------------------------------------------------------- /includes/class-arabic-webfonts-customizer.php: -------------------------------------------------------------------------------- 1 | plugin_name = $plugin_name; 67 | $this->fonts = $fonts; 68 | 69 | $this->type = 'theme_mod'; 70 | $this->transport = 'postMessage'; 71 | $this->capability = 'edit_theme_options'; 72 | 73 | add_action( 'customize_register', array( $this, 'register_customizer_settings' ) ); 74 | 75 | } 76 | 77 | /** 78 | * Get the customizer settings. 79 | * 80 | * @since 1.0 81 | * @access private 82 | */ 83 | private function get_customizer_settings() { 84 | 85 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-arabic-webfonts-customizer-settings.php'; 86 | $settings = new AWF_Customizer_Settings( $this->plugin_name, $this->fonts ); 87 | return $settings->settings_fields(); 88 | 89 | } 90 | 91 | /** 92 | * Register the customizer settings. 93 | * 94 | * @since 1.0 95 | * @access public 96 | */ 97 | public function register_customizer_settings( $wp_customize ) { 98 | 99 | // load custom controls 100 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-arabic-webfonts-custom-controls.php'; 101 | 102 | // get all settings 103 | $options = $this->get_customizer_settings(); 104 | 105 | $priority = 0; 106 | 107 | foreach ( $options as $option ) { 108 | 109 | // Add panel 110 | if ( $option['type'] == 'panel' ) { 111 | 112 | $priority += 10; 113 | 114 | $wp_customize->add_panel( esc_attr( $option['id'] ), array( 115 | 'title' => $option['title'], 116 | 'description' => $option['description'], 117 | 'priority' => $priority, 118 | 'theme_supports' => $option['theme_supports'], 119 | 'capability' => $this->capability 120 | ) ); 121 | 122 | } 123 | 124 | // Add section 125 | if ( $option['type'] == 'section' ) { 126 | 127 | $priority += 10; 128 | 129 | $wp_customize->add_section( esc_attr( $option['id'] ), array( 130 | 'title' => $option['title'], 131 | 'description' => $option['description'], 132 | 'priority' => $priority, 133 | 'theme_supports' => $option['theme_supports'], 134 | 'panel' => $option['panel'], 135 | 'capability' => $this->capability 136 | ) ); 137 | 138 | // Add settings & controls 139 | foreach ( $option['fields'] as $field ) { 140 | 141 | $priority += 10; 142 | 143 | // add setting 144 | $wp_customize->add_setting( esc_attr( $field['id'] ), array( 145 | 'default' => $field['default'], 146 | 'type' => $this->type, 147 | 'capability' => $this->capability, 148 | 'transport' => $this->transport, 149 | 'sanitize_callback' => $field['sanitize_callback'] 150 | ) ); 151 | 152 | // Add control fields 153 | switch ( $field['type'] ) { 154 | 155 | // Select field 156 | case 'select': 157 | $choices = ( isset( $field['choices'] ) ) ? $field['choices'] : array(); 158 | 159 | $wp_customize->add_control( esc_attr( $field['id'].'_control' ), array( 160 | 'label' => $field['title'], 161 | 'description' => $field['description'], 162 | 'section' => $option['id'], 163 | 'settings' => $field['id'], 164 | 'priority' => $priority, 165 | 'type' => 'select', 166 | 'choices' => $choices 167 | ) ); 168 | break; 169 | 170 | // Textarea field 171 | case 'textarea': 172 | 173 | $wp_customize->add_control( esc_attr( $field['id'].'_control' ), array( 174 | 'label' => $field['title'], 175 | 'description' => $field['description'], 176 | 'section' => $option['id'], 177 | 'settings' => $field['id'], 178 | 'priority' => $priority, 179 | 'type' => 'textarea' 180 | ) ); 181 | break; 182 | 183 | // Text field 184 | case 'text': 185 | 186 | $wp_customize->add_control( esc_attr( $field['id'].'_control' ), array( 187 | 'label' => $field['title'], 188 | 'description' => $field['description'], 189 | 'section' => $option['id'], 190 | 'settings' => $field['id'], 191 | 'priority' => $priority, 192 | 'type' => 'text' 193 | ) ); 194 | break; 195 | 196 | // Range Field 197 | case 'range': 198 | $input_attrs = ( isset( $field['input_attrs'] ) ) ? $field['input_attrs'] : array(); 199 | 200 | $wp_customize->add_control( esc_attr( $field['id'].'_control' ) , array( 201 | 'label' => $field['title'], 202 | 'description' => $field['description'], 203 | 'section' => $option['id'], 204 | 'settings' => $field['id'], 205 | 'priority' => $priority, 206 | 'type' => 'range', 207 | 'input_attrs' => $input_attrs 208 | ) ); 209 | break; 210 | 211 | // reset button Field 212 | case 'reset_button': 213 | 214 | $wp_customize->add_control( new AWF_Customize_Reset_Button_Control( $wp_customize, esc_attr( $field['id'].'_control' ) , array( 215 | 'label' => $field['title'], 216 | 'description' => $field['description'], 217 | 'section' => $option['id'], 218 | 'settings' => $field['id'], 219 | 'priority' => $priority, 220 | 'type' => 'reset_button', 221 | ) ) 222 | ); 223 | 224 | break; 225 | 226 | // fields group Field 227 | case 'fields_group': 228 | 229 | $wp_customize->add_control( new AWF_Customize_Fields_Group_Control( $wp_customize, esc_attr( $field['id'].'_control' ) , array( 230 | 'label' => $field['title'], 231 | 'description' => $field['description'], 232 | 'section' => $option['id'], 233 | 'settings' => $field['id'], 234 | 'priority' => $priority, 235 | 'type' => 'fields_group', 236 | ) ) 237 | ); 238 | 239 | break; 240 | 241 | // jozoor plugins Field 242 | case 'jozoor_plugins': 243 | 244 | $wp_customize->add_control( new AWF_Customize_Jozoor_Plugins_Control( $wp_customize, esc_attr( $field['id'].'_control' ) , array( 245 | 'label' => $field['title'], 246 | 'description' => $field['description'], 247 | 'section' => $option['id'], 248 | 'settings' => $field['id'], 249 | 'priority' => $priority, 250 | 'type' => 'jozoor_plugins', 251 | ) ) 252 | ); 253 | 254 | break; 255 | 256 | } // end switch field type 257 | 258 | } // end sub foreach for settings & controls 259 | 260 | } 261 | 262 | 263 | } // end main foreach for panels & sections 264 | 265 | } 266 | 267 | 268 | } 269 | 270 | endif; // End Check Class Exists -------------------------------------------------------------------------------- /lang/arabic-webfonts.pot: -------------------------------------------------------------------------------- 1 | # WordPress Blank Pot 2 | # Copyright (C) 2014 ... 3 | # This file is distributed under the GNU General Public License v2 or later. 4 | #, fuzzy 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: Arabic Webfonts v1.0\n" 8 | "Report-Msgid-Bugs-To: Translator Name \n" 9 | "POT-Creation-Date: 2018-02-17 13:43+0000\n" 10 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 11 | "Last-Translator: Jozoor Team \n" 12 | "Language-Team: Jozoor Team \n" 13 | "Language: \n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 18 | "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n" 19 | "X-Poedit-SourceCharset: UTF-8\n" 20 | "X-Poedit-KeywordsList: __;_e;_n;_n:1,2\n" 21 | "X-Poedit-Basepath: ../\n" 22 | "X-Generator: Loco https://localise.biz/\n" 23 | "X-Poedit-SearchPath-0: ." 24 | 25 | #: includes/class-arabic-webfonts-custom-controls.php:31 26 | msgid "Reset settings" 27 | msgstr "" 28 | 29 | #: includes/class-arabic-webfonts-custom-controls.php:80 30 | msgid "Clean WordPress Content from Broken Shortcodes." 31 | msgstr "" 32 | 33 | #: includes/class-arabic-webfonts-custom-controls.php:82 34 | msgid "View Demo" 35 | msgstr "" 36 | 37 | #: includes/class-arabic-webfonts-custom-controls.php:82 38 | msgid "Download Free" 39 | msgstr "" 40 | 41 | #: includes/class-arabic-webfonts-custom-controls.php:86 42 | msgid "Follow Us" 43 | msgstr "" 44 | 45 | #: includes/class-arabic-webfonts-customizer-settings.php:80 46 | msgid "Select Font" 47 | msgstr "" 48 | 49 | #: includes/class-arabic-webfonts-customizer-settings.php:103 50 | #: includes/class-arabic-webfonts-post-type.php:77 51 | msgid "Arabic Webfonts" 52 | msgstr "" 53 | 54 | #: includes/class-arabic-webfonts-customizer-settings.php:104 55 | msgid "" 56 | "An easy way to add Arabic fonts to any theme without coding using WordPress " 57 | "Customizer." 58 | msgstr "" 59 | 60 | #: includes/class-arabic-webfonts-customizer-settings.php:118 61 | msgid "Body" 62 | msgstr "" 63 | 64 | #: includes/class-arabic-webfonts-customizer-settings.php:119 65 | msgid "Control in body content typography" 66 | msgstr "" 67 | 68 | #: includes/class-arabic-webfonts-customizer-settings.php:126 69 | #: includes/class-arabic-webfonts-customizer-settings.php:183 70 | #: includes/class-arabic-webfonts-customizer-settings.php:265 71 | #: includes/class-arabic-webfonts-customizer-settings.php:335 72 | #: includes/class-arabic-webfonts-customizer-settings.php:405 73 | #: includes/class-arabic-webfonts-customizer-settings.php:475 74 | #: includes/class-arabic-webfonts-customizer-settings.php:545 75 | #: includes/class-arabic-webfonts-customizer-settings.php:615 76 | #: includes/class-arabic-webfonts-customizer-settings.php:702 77 | msgid "Font Family" 78 | msgstr "" 79 | 80 | #: includes/class-arabic-webfonts-customizer-settings.php:135 81 | #: includes/class-arabic-webfonts-customizer-settings.php:192 82 | #: includes/class-arabic-webfonts-customizer-settings.php:274 83 | #: includes/class-arabic-webfonts-customizer-settings.php:344 84 | #: includes/class-arabic-webfonts-customizer-settings.php:414 85 | #: includes/class-arabic-webfonts-customizer-settings.php:484 86 | #: includes/class-arabic-webfonts-customizer-settings.php:554 87 | #: includes/class-arabic-webfonts-customizer-settings.php:624 88 | #: includes/class-arabic-webfonts-customizer-settings.php:711 89 | msgid "Font Size" 90 | msgstr "" 91 | 92 | #: includes/class-arabic-webfonts-customizer-settings.php:136 93 | #: includes/class-arabic-webfonts-customizer-settings.php:193 94 | #: includes/class-arabic-webfonts-customizer-settings.php:625 95 | #: includes/class-arabic-webfonts-customizer-settings.php:712 96 | msgid "from 10 to 100 px, default = 14px" 97 | msgstr "" 98 | 99 | #: includes/class-arabic-webfonts-customizer-settings.php:149 100 | #: includes/class-arabic-webfonts-customizer-settings.php:206 101 | #: includes/class-arabic-webfonts-customizer-settings.php:288 102 | #: includes/class-arabic-webfonts-customizer-settings.php:358 103 | #: includes/class-arabic-webfonts-customizer-settings.php:428 104 | #: includes/class-arabic-webfonts-customizer-settings.php:498 105 | #: includes/class-arabic-webfonts-customizer-settings.php:568 106 | #: includes/class-arabic-webfonts-customizer-settings.php:638 107 | #: includes/class-arabic-webfonts-customizer-settings.php:725 108 | msgid "Line Height" 109 | msgstr "" 110 | 111 | #: includes/class-arabic-webfonts-customizer-settings.php:150 112 | #: includes/class-arabic-webfonts-customizer-settings.php:207 113 | #: includes/class-arabic-webfonts-customizer-settings.php:289 114 | #: includes/class-arabic-webfonts-customizer-settings.php:359 115 | #: includes/class-arabic-webfonts-customizer-settings.php:429 116 | #: includes/class-arabic-webfonts-customizer-settings.php:499 117 | #: includes/class-arabic-webfonts-customizer-settings.php:569 118 | #: includes/class-arabic-webfonts-customizer-settings.php:639 119 | #: includes/class-arabic-webfonts-customizer-settings.php:726 120 | msgid "from 0.5 to 5, default = 1.2" 121 | msgstr "" 122 | 123 | #: includes/class-arabic-webfonts-customizer-settings.php:175 124 | msgid "Paragraphs" 125 | msgstr "" 126 | 127 | #: includes/class-arabic-webfonts-customizer-settings.php:176 128 | msgid "Control in Paragraphs typography" 129 | msgstr "" 130 | 131 | #: includes/class-arabic-webfonts-customizer-settings.php:220 132 | #: includes/class-arabic-webfonts-customizer-settings.php:302 133 | #: includes/class-arabic-webfonts-customizer-settings.php:372 134 | #: includes/class-arabic-webfonts-customizer-settings.php:442 135 | #: includes/class-arabic-webfonts-customizer-settings.php:512 136 | #: includes/class-arabic-webfonts-customizer-settings.php:582 137 | #: includes/class-arabic-webfonts-customizer-settings.php:652 138 | #: includes/class-arabic-webfonts-customizer-settings.php:739 139 | msgid "Text Decoration" 140 | msgstr "" 141 | 142 | #: includes/class-arabic-webfonts-customizer-settings.php:226 143 | #: includes/class-arabic-webfonts-customizer-settings.php:308 144 | #: includes/class-arabic-webfonts-customizer-settings.php:378 145 | #: includes/class-arabic-webfonts-customizer-settings.php:448 146 | #: includes/class-arabic-webfonts-customizer-settings.php:518 147 | #: includes/class-arabic-webfonts-customizer-settings.php:588 148 | #: includes/class-arabic-webfonts-customizer-settings.php:658 149 | #: includes/class-arabic-webfonts-customizer-settings.php:745 150 | msgid "Select Decoration" 151 | msgstr "" 152 | 153 | #: includes/class-arabic-webfonts-customizer-settings.php:247 154 | msgid "Headings" 155 | msgstr "" 156 | 157 | #: includes/class-arabic-webfonts-customizer-settings.php:248 158 | msgid "Control in Headings typography" 159 | msgstr "" 160 | 161 | #: includes/class-arabic-webfonts-customizer-settings.php:257 162 | msgid "Heading - H1" 163 | msgstr "" 164 | 165 | #: includes/class-arabic-webfonts-customizer-settings.php:275 166 | msgid "from 10 to 100 px, default = 24px" 167 | msgstr "" 168 | 169 | #: includes/class-arabic-webfonts-customizer-settings.php:327 170 | msgid "Heading - H2" 171 | msgstr "" 172 | 173 | #: includes/class-arabic-webfonts-customizer-settings.php:345 174 | msgid "from 10 to 100 px, default = 22px" 175 | msgstr "" 176 | 177 | #: includes/class-arabic-webfonts-customizer-settings.php:397 178 | msgid "Heading - H3" 179 | msgstr "" 180 | 181 | #: includes/class-arabic-webfonts-customizer-settings.php:415 182 | msgid "from 10 to 100 px, default = 20px" 183 | msgstr "" 184 | 185 | #: includes/class-arabic-webfonts-customizer-settings.php:467 186 | msgid "Heading - H4" 187 | msgstr "" 188 | 189 | #: includes/class-arabic-webfonts-customizer-settings.php:485 190 | msgid "from 10 to 100 px, default = 18px" 191 | msgstr "" 192 | 193 | #: includes/class-arabic-webfonts-customizer-settings.php:537 194 | msgid "Heading - H5" 195 | msgstr "" 196 | 197 | #: includes/class-arabic-webfonts-customizer-settings.php:555 198 | msgid "from 10 to 100 px, default = 16px" 199 | msgstr "" 200 | 201 | #: includes/class-arabic-webfonts-customizer-settings.php:607 202 | msgid "Heading - H6" 203 | msgstr "" 204 | 205 | #: includes/class-arabic-webfonts-customizer-settings.php:766 206 | msgid "Custom controls" 207 | msgstr "" 208 | 209 | #: includes/class-arabic-webfonts-customizer-settings.php:767 210 | msgid "Control in Custom Controls typography" 211 | msgstr "" 212 | 213 | #: includes/class-arabic-webfonts-customizer-settings.php:779 214 | msgid "Reset All Settings" 215 | msgstr "" 216 | 217 | #: includes/class-arabic-webfonts-customizer-settings.php:780 218 | msgid "" 219 | "When click to reset, All settings will be lost and replaced with default " 220 | "settings!" 221 | msgstr "" 222 | 223 | #: includes/class-arabic-webfonts-customizer-settings.php:799 224 | msgid "More Plugins By Jozoor" 225 | msgstr "" 226 | 227 | #: includes/class-arabic-webfonts-customizer-settings.php:800 228 | msgid "Latest Plugins By Jozoor" 229 | msgstr "" 230 | 231 | #: includes/class-arabic-webfonts-post-type.php:69 232 | msgid "Arabic Webfonts Controls" 233 | msgstr "" 234 | 235 | #: includes/class-arabic-webfonts-post-type.php:70 236 | msgid "Arabic Webfonts Control" 237 | msgstr "" 238 | 239 | #: includes/class-arabic-webfonts-post-type.php:71 240 | #: includes/class-arabic-webfonts-post-type.php:72 241 | msgid "Add New Control" 242 | msgstr "" 243 | 244 | #: includes/class-arabic-webfonts-post-type.php:73 245 | msgid "Edit Control" 246 | msgstr "" 247 | 248 | #: includes/class-arabic-webfonts-post-type.php:74 249 | msgid "New Control" 250 | msgstr "" 251 | 252 | #: includes/class-arabic-webfonts-post-type.php:75 253 | #: includes/class-arabic-webfonts.php:64 254 | msgid "All Controls" 255 | msgstr "" 256 | 257 | #: includes/class-arabic-webfonts-post-type.php:76 258 | msgid "No Controls found" 259 | msgstr "" 260 | 261 | #: includes/class-arabic-webfonts-post-type.php:114 262 | #: includes/class-arabic-webfonts-post-type.php:117 263 | msgid "Control updated. Please visit the Customizer to manage this control." 264 | msgstr "" 265 | 266 | #: includes/class-arabic-webfonts-post-type.php:115 267 | msgid "Control updated." 268 | msgstr "" 269 | 270 | #: includes/class-arabic-webfonts-post-type.php:116 271 | msgid "Control deleted." 272 | msgstr "" 273 | 274 | #: includes/class-arabic-webfonts-post-type.php:120 275 | msgid "Control published. Please visit the Customizer to manage this control." 276 | msgstr "" 277 | 278 | #: includes/class-arabic-webfonts-post-type.php:121 279 | msgid "Control saved. Please visit the Customizer to manage this control." 280 | msgstr "" 281 | 282 | #: includes/class-arabic-webfonts-post-type.php:122 283 | msgid "Control submitted. Please visit the Customizer to manage this control." 284 | msgstr "" 285 | 286 | #: includes/class-arabic-webfonts-post-type.php:165 287 | msgid "Delete this control permanently" 288 | msgstr "" 289 | 290 | #: includes/class-arabic-webfonts-post-type.php:165 291 | msgid "Delete Permanently" 292 | msgstr "" 293 | 294 | #: includes/class-arabic-webfonts-post-type.php:261 295 | #, php-format 296 | msgid "Control permanently deleted." 297 | msgid_plural "%s Controls permanently deleted." 298 | msgstr[0] "" 299 | msgstr[1] "" 300 | 301 | #: includes/class-arabic-webfonts-post-type.php:292 302 | msgid "CSS Selectors" 303 | msgstr "" 304 | 305 | #: includes/class-arabic-webfonts-post-type.php:349 306 | msgid "" 307 | "Type each CSS selector that you would like this font control to manage in " 308 | "the box below.
Example : .some-class, #some-id" 309 | msgstr "" 310 | 311 | #: includes/class-arabic-webfonts.php:67 312 | msgid "More Plugins" 313 | msgstr "" 314 | 315 | #: includes/class-arabic-webfonts.php:108 316 | #, php-format 317 | msgid "" 318 | "This plugin can not be activated because it requires a WordPress version at " 319 | "least %1$s (or later). Please go to Dashboard ▸ Updates to get the " 320 | "latest version of WordPress." 321 | msgstr "" 322 | 323 | #: includes/class-arabic-webfonts.php:111 324 | msgid "go back" 325 | msgstr "" 326 | 327 | #: includes/class-arabic-webfonts.php:444 328 | msgid "" 329 | "Click OK to reset. All settings will be lost and replaced with default " 330 | "settings!" 331 | msgstr "" 332 | 333 | #. URI of the plugin 334 | msgid "http://plugins.jozoor.com/arabic-webfonts/" 335 | msgstr "" 336 | 337 | #. Author of the plugin 338 | msgid "Jozoor" 339 | msgstr "" 340 | 341 | #. Author URI of the plugin 342 | msgid "https://codecanyon.net/user/jozoor/portfolio?ref=Jozoor" 343 | msgstr "" 344 | -------------------------------------------------------------------------------- /includes/class-arabic-webfonts-post-type.php: -------------------------------------------------------------------------------- 1 | plugin_name = $plugin_name; 38 | 39 | add_action('init', array($this, 'register_post_type')); 40 | add_filter('post_updated_messages', array($this, 'updated_messages')); 41 | add_filter('manage_edit-awf_font_control_columns', array($this, 'columns_filter'), 10, 2); 42 | add_filter('post_row_actions', array($this, 'remove_action'), 10, 2); 43 | if (is_admin()) { 44 | add_filter('months_dropdown_results', array($this, 'remove_month_filters'), 10, 2); 45 | 46 | add_filter('bulk_actions-edit-awf_font_control', array($this, 'remove_bulk_actions'), 10, 2); 47 | } 48 | add_action('admin_head-post.php', array($this, 'hide_publishing_actions')); 49 | add_action('admin_head-post-new.php', array($this, 'hide_publishing_actions')); 50 | add_action('admin_head-edit.php', array($this, 'hide_publishing_actions')); 51 | add_action('admin_init', array($this, 'disable_autosave')); 52 | add_filter('bulk_post_updated_messages', array($this, 'bulk_post_updated_messages_filter'), 10, 2); 53 | add_action('add_meta_boxes', array($this, 'remove_slugdiv_metabox')); 54 | add_action('add_meta_boxes', array($this, 'add_meta_box')); 55 | add_action('save_post', array($this, 'save_meta_box')); 56 | 57 | } 58 | 59 | /** 60 | * Register custom post type for controls. 61 | * 62 | * @since 1.0 63 | * @access public 64 | */ 65 | public function register_post_type() 66 | { 67 | 68 | $labels = array( 69 | 'name' => __('Arabic Webfonts Controls', 'arabic-webfonts'), 70 | 'singular_name' => __('Arabic Webfonts Control', 'arabic-webfonts'), 71 | 'add_new' => __('Add New Control', 'arabic-webfonts'), 72 | 'add_new_item' => __('Add New Control', 'arabic-webfonts'), 73 | 'edit_item' => __('Edit Control', 'arabic-webfonts'), 74 | 'new_item' => __('New Control', 'arabic-webfonts'), 75 | 'all_items' => __('All Controls', 'arabic-webfonts'), 76 | 'not_found' => __('No Controls found', 'arabic-webfonts'), 77 | 'menu_name' => __('Arabic Webfonts', 'arabic-webfonts'), 78 | ); 79 | 80 | $args = array( 81 | 'labels' => $labels, 82 | 'hierarchical' => false, 83 | 'public' => false, 84 | 'show_ui' => true, 85 | 'show_in_menu' => true, 86 | 'menu_position' => 80, 87 | 'menu_icon' => 'dashicons-menu', 88 | 'show_in_nav_menus' => false, 89 | 'publicly_queryable' => false, 90 | 'exclude_from_search' => true, 91 | 'query_var' => false, 92 | 'rewrite' => false, 93 | 'supports' => array('title'), 94 | ); 95 | 96 | register_post_type('awf_font_control', $args); 97 | 98 | } 99 | 100 | /** 101 | * Customizing the messages for control post type. 102 | * 103 | * @since 1.0 104 | * @access public 105 | */ 106 | public function updated_messages($messages) 107 | { 108 | 109 | $post = get_post(); 110 | $post_type = get_post_type($post); 111 | 112 | $messages['awf_font_control'] = array( 113 | 0 => '', 114 | 1 => __('Control updated. Please visit the Customizer to manage this control.', 'arabic-webfonts'), 115 | 2 => __('Control updated.', 'arabic-webfonts'), 116 | 3 => __('Control deleted.', 'arabic-webfonts'), 117 | 4 => __('Control updated. Please visit the Customizer to manage this control.', 'arabic-webfonts'), 118 | 5 => isset($_GET['revision']) ? sprintf('Control restored to revision from %s', 119 | wp_post_revision_title((int) $_GET['revision'], false)) : false, 120 | 6 => __('Control published. Please visit the Customizer to manage this control.', 'arabic-webfonts'), 121 | 7 => __('Control saved. Please visit the Customizer to manage this control.', 'arabic-webfonts'), 122 | 8 => __('Control submitted. Please visit the Customizer to manage this control.', 'arabic-webfonts'), 123 | 9 => sprintf('Control scheduled for: %1$s.', 124 | date_i18n('M j, Y @ G:i', strtotime($post->post_date)) 125 | ), 126 | 10 => 'Control draft updated.', 127 | ); 128 | 129 | return $messages; 130 | 131 | } 132 | 133 | /** 134 | * Remove date & cb columns. 135 | * 136 | * @since 1.0 137 | * @access public 138 | */ 139 | public function columns_filter($columns) 140 | { 141 | 142 | unset($columns['date']); 143 | unset($columns['cb']); 144 | return $columns; 145 | 146 | } 147 | 148 | /** 149 | * Remove actions and add new delete link. 150 | * 151 | * @since 1.0 152 | * @access public 153 | */ 154 | public function remove_action($actions) 155 | { 156 | 157 | $post = get_post(); 158 | $post_type = get_post_type($post); 159 | 160 | if ($post_type == 'awf_font_control') { 161 | 162 | unset($actions['inline hide-if-no-js']); 163 | unset($actions['trash']); 164 | 165 | $actions['trash'] = "" . __('Delete Permanently', 'arabic-webfonts') . ""; 166 | 167 | } 168 | 169 | return $actions; 170 | 171 | } 172 | 173 | /** 174 | * Remove month filter. 175 | * 176 | * @since 1.0 177 | * @access public 178 | */ 179 | public function remove_month_filters($months, $post_type) 180 | { 181 | 182 | return in_array($post_type, array('awf_font_control')) ? array() : $months; 183 | 184 | } 185 | 186 | /** 187 | * Remove bulk actions. 188 | * 189 | * @since 1.0 190 | * @access public 191 | */ 192 | public function remove_bulk_actions($actions) 193 | { 194 | 195 | unset($actions['trash']); 196 | unset($actions['edit']); 197 | return $actions; 198 | 199 | } 200 | 201 | /** 202 | * Hide publishing actions. 203 | * 204 | * @since 1.0 205 | * @access public 206 | */ 207 | public function hide_publishing_actions() 208 | { 209 | 210 | global $post_type; 211 | 212 | if ($post_type == 'awf_font_control') { 213 | echo ' 214 | 225 | '; 226 | } 227 | } 228 | 229 | /** 230 | * Disable AutoSave for post type. 231 | * 232 | * will do that because after uninstalling the plugin 233 | * all autosave drafts still in database and should 234 | * cleanup all plugin data after the uninstalling 235 | * 236 | * @since 1.0 237 | * @access public 238 | */ 239 | public function disable_autosave() 240 | { 241 | 242 | global $post_type; 243 | 244 | if ($post_type == 'awf_font_control') { 245 | 246 | wp_deregister_script('autosave'); 247 | 248 | } 249 | } 250 | 251 | /** 252 | * Customizing the bulk messages for control post type. 253 | * 254 | * @since 1.0 255 | * @access public 256 | */ 257 | public function bulk_post_updated_messages_filter($bulk_messages, $bulk_counts) 258 | { 259 | 260 | $bulk_messages['awf_font_control'] = array( 261 | 'deleted' => _n('Control permanently deleted.', '%s Controls permanently deleted.', $bulk_counts['deleted'], 'arabic-webfonts'), 262 | ); 263 | 264 | return $bulk_messages; 265 | 266 | } 267 | 268 | /** 269 | * Remove slugdiv metabox. 270 | * 271 | * @since 1.0 272 | * @access public 273 | */ 274 | public function remove_slugdiv_metabox() 275 | { 276 | 277 | remove_meta_box('slugdiv', 'awf_font_control', 'normal'); 278 | 279 | } 280 | 281 | /** 282 | * Add the metabox [ CSS Selectors ]. 283 | * 284 | * @since 1.0 285 | * @access public 286 | */ 287 | public function add_meta_box() 288 | { 289 | 290 | add_meta_box( 291 | 'awf_css_selectors_meta_box', 292 | __('CSS Selectors', 'arabic-webfonts'), 293 | array($this, 'render_meta_box_content'), 294 | 'awf_font_control', 295 | 'normal', 296 | 'high' 297 | ); 298 | 299 | } 300 | 301 | /** 302 | * Save the metabox when the post is saved. 303 | * 304 | * @since 1.0 305 | * @access public 306 | */ 307 | public function save_meta_box($post_id) 308 | { 309 | 310 | if (!isset($_POST['awf_inner_css_selectors_nonce'])) { 311 | return $post_id; 312 | } 313 | 314 | $nonce = $_POST['awf_inner_css_selectors_nonce']; 315 | 316 | if (!wp_verify_nonce($nonce, 'awf_inner_css_selectors')) { 317 | return $post_id; 318 | } 319 | 320 | if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 321 | return $post_id; 322 | } 323 | 324 | if (!current_user_can('edit_post', $post_id)) { 325 | return $post_id; 326 | } 327 | 328 | $mydata = sanitize_text_field($_POST['awf_css_selectors']); 329 | 330 | update_post_meta($post_id, '_awf_css_selectors', $mydata); 331 | } 332 | 333 | /** 334 | * Render the metabox content. 335 | * 336 | * @since 1.0 337 | * @access public 338 | */ 339 | public function render_meta_box_content($post) 340 | { 341 | 342 | wp_nonce_field('awf_inner_css_selectors', 'awf_inner_css_selectors_nonce'); 343 | 344 | $value = get_post_meta($post->ID, '_awf_css_selectors', true); 345 | 346 | echo ' 347 | 348 | 352 |
349 | ' . _e('Type each CSS selector that you would like this font control to manage in the box below.
Example : .some-class, #some-id', 'arabic-webfonts') . '
350 | 351 |
'; 353 | 354 | } 355 | 356 | } 357 | 358 | endif; // End Check Class Exists 359 | -------------------------------------------------------------------------------- /lang/arabic-webfonts-ar.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Arabic Webfonts v1.0\n" 4 | "Report-Msgid-Bugs-To: Translator Name \n" 5 | "POT-Creation-Date: 2018-02-17 13:43+0000\n" 6 | "PO-Revision-Date: 2018-02-17 13:59+0000\n" 7 | "Last-Translator: admin \n" 8 | "Language-Team: Arabic\n" 9 | "Language: ar\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " 14 | "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" 15 | "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-KeywordsList: __;_e;_n;_n:1,2\n" 18 | "X-Poedit-Basepath: ../\n" 19 | "X-Generator: Loco https://localise.biz/\n" 20 | "X-Poedit-SearchPath-0: ." 21 | 22 | #: includes/class-arabic-webfonts-custom-controls.php:31 23 | msgid "Reset settings" 24 | msgstr "إعادة تعيين الإعدادات" 25 | 26 | #: includes/class-arabic-webfonts-custom-controls.php:80 27 | msgid "Clean WordPress Content from Broken Shortcodes." 28 | msgstr "" 29 | "تنظيف محتوى موقعك من أى shortocdes ( أكواد مختصرة ) معطلة او غير مستخدمة " 30 | "بشكل تلقائى." 31 | 32 | #: includes/class-arabic-webfonts-custom-controls.php:82 33 | msgid "View Demo" 34 | msgstr "مشاهدة الإضافة" 35 | 36 | #: includes/class-arabic-webfonts-custom-controls.php:82 37 | msgid "Download Free" 38 | msgstr "تحميل مجانا" 39 | 40 | #: includes/class-arabic-webfonts-custom-controls.php:86 41 | msgid "Follow Us" 42 | msgstr "تابعنا على" 43 | 44 | #: includes/class-arabic-webfonts-customizer-settings.php:80 45 | msgid "Select Font" 46 | msgstr "إختر نوع الخط" 47 | 48 | #: includes/class-arabic-webfonts-customizer-settings.php:103 49 | #: includes/class-arabic-webfonts-post-type.php:77 50 | msgid "Arabic Webfonts" 51 | msgstr "خطوط عربية" 52 | 53 | #: includes/class-arabic-webfonts-customizer-settings.php:104 54 | msgid "" 55 | "An easy way to add Arabic fonts to any theme without coding using WordPress " 56 | "Customizer." 57 | msgstr "" 58 | "إضافة الخطوط العربية بكل سهولة لأى قالب بدون أكواد باستخدام خيار تخصيص فى " 59 | "الووردبريس" 60 | 61 | #: includes/class-arabic-webfonts-customizer-settings.php:118 62 | msgid "Body" 63 | msgstr "جسم الصفحة" 64 | 65 | #: includes/class-arabic-webfonts-customizer-settings.php:119 66 | msgid "Control in body content typography" 67 | msgstr "التحكم فى عناصر جسم الصفحة بشكل عام" 68 | 69 | #: includes/class-arabic-webfonts-customizer-settings.php:126 70 | #: includes/class-arabic-webfonts-customizer-settings.php:183 71 | #: includes/class-arabic-webfonts-customizer-settings.php:265 72 | #: includes/class-arabic-webfonts-customizer-settings.php:335 73 | #: includes/class-arabic-webfonts-customizer-settings.php:405 74 | #: includes/class-arabic-webfonts-customizer-settings.php:475 75 | #: includes/class-arabic-webfonts-customizer-settings.php:545 76 | #: includes/class-arabic-webfonts-customizer-settings.php:615 77 | #: includes/class-arabic-webfonts-customizer-settings.php:702 78 | msgid "Font Family" 79 | msgstr "نوع الخط" 80 | 81 | #: includes/class-arabic-webfonts-customizer-settings.php:135 82 | #: includes/class-arabic-webfonts-customizer-settings.php:192 83 | #: includes/class-arabic-webfonts-customizer-settings.php:274 84 | #: includes/class-arabic-webfonts-customizer-settings.php:344 85 | #: includes/class-arabic-webfonts-customizer-settings.php:414 86 | #: includes/class-arabic-webfonts-customizer-settings.php:484 87 | #: includes/class-arabic-webfonts-customizer-settings.php:554 88 | #: includes/class-arabic-webfonts-customizer-settings.php:624 89 | #: includes/class-arabic-webfonts-customizer-settings.php:711 90 | msgid "Font Size" 91 | msgstr "حجم الخط" 92 | 93 | #: includes/class-arabic-webfonts-customizer-settings.php:136 94 | #: includes/class-arabic-webfonts-customizer-settings.php:193 95 | #: includes/class-arabic-webfonts-customizer-settings.php:625 96 | #: includes/class-arabic-webfonts-customizer-settings.php:712 97 | msgid "from 10 to 100 px, default = 14px" 98 | msgstr "من 10 الى 100 px, الافتراضى = 14px" 99 | 100 | #: includes/class-arabic-webfonts-customizer-settings.php:149 101 | #: includes/class-arabic-webfonts-customizer-settings.php:206 102 | #: includes/class-arabic-webfonts-customizer-settings.php:288 103 | #: includes/class-arabic-webfonts-customizer-settings.php:358 104 | #: includes/class-arabic-webfonts-customizer-settings.php:428 105 | #: includes/class-arabic-webfonts-customizer-settings.php:498 106 | #: includes/class-arabic-webfonts-customizer-settings.php:568 107 | #: includes/class-arabic-webfonts-customizer-settings.php:638 108 | #: includes/class-arabic-webfonts-customizer-settings.php:725 109 | msgid "Line Height" 110 | msgstr "المسافة بين السطور" 111 | 112 | #: includes/class-arabic-webfonts-customizer-settings.php:150 113 | #: includes/class-arabic-webfonts-customizer-settings.php:207 114 | #: includes/class-arabic-webfonts-customizer-settings.php:289 115 | #: includes/class-arabic-webfonts-customizer-settings.php:359 116 | #: includes/class-arabic-webfonts-customizer-settings.php:429 117 | #: includes/class-arabic-webfonts-customizer-settings.php:499 118 | #: includes/class-arabic-webfonts-customizer-settings.php:569 119 | #: includes/class-arabic-webfonts-customizer-settings.php:639 120 | #: includes/class-arabic-webfonts-customizer-settings.php:726 121 | msgid "from 0.5 to 5, default = 1.2" 122 | msgstr "من 0.5 الى 5, الافتراضى = 1.2" 123 | 124 | #: includes/class-arabic-webfonts-customizer-settings.php:175 125 | msgid "Paragraphs" 126 | msgstr "النصوص" 127 | 128 | #: includes/class-arabic-webfonts-customizer-settings.php:176 129 | msgid "Control in Paragraphs typography" 130 | msgstr "التحكم فى النصوص بشكل عام" 131 | 132 | #: includes/class-arabic-webfonts-customizer-settings.php:220 133 | #: includes/class-arabic-webfonts-customizer-settings.php:302 134 | #: includes/class-arabic-webfonts-customizer-settings.php:372 135 | #: includes/class-arabic-webfonts-customizer-settings.php:442 136 | #: includes/class-arabic-webfonts-customizer-settings.php:512 137 | #: includes/class-arabic-webfonts-customizer-settings.php:582 138 | #: includes/class-arabic-webfonts-customizer-settings.php:652 139 | #: includes/class-arabic-webfonts-customizer-settings.php:739 140 | msgid "Text Decoration" 141 | msgstr "تنسيق النص" 142 | 143 | #: includes/class-arabic-webfonts-customizer-settings.php:226 144 | #: includes/class-arabic-webfonts-customizer-settings.php:308 145 | #: includes/class-arabic-webfonts-customizer-settings.php:378 146 | #: includes/class-arabic-webfonts-customizer-settings.php:448 147 | #: includes/class-arabic-webfonts-customizer-settings.php:518 148 | #: includes/class-arabic-webfonts-customizer-settings.php:588 149 | #: includes/class-arabic-webfonts-customizer-settings.php:658 150 | #: includes/class-arabic-webfonts-customizer-settings.php:745 151 | msgid "Select Decoration" 152 | msgstr "إختر التنسيق" 153 | 154 | #: includes/class-arabic-webfonts-customizer-settings.php:247 155 | msgid "Headings" 156 | msgstr "العناوين" 157 | 158 | #: includes/class-arabic-webfonts-customizer-settings.php:248 159 | msgid "Control in Headings typography" 160 | msgstr "التحكم فى العناوين بشكل عام" 161 | 162 | #: includes/class-arabic-webfonts-customizer-settings.php:257 163 | msgid "Heading - H1" 164 | msgstr "عنوان - H1" 165 | 166 | #: includes/class-arabic-webfonts-customizer-settings.php:275 167 | msgid "from 10 to 100 px, default = 24px" 168 | msgstr "من 10 الى 100 px, الافتراضى = 24px" 169 | 170 | #: includes/class-arabic-webfonts-customizer-settings.php:327 171 | msgid "Heading - H2" 172 | msgstr "عنوان - H2" 173 | 174 | #: includes/class-arabic-webfonts-customizer-settings.php:345 175 | msgid "from 10 to 100 px, default = 22px" 176 | msgstr "من 10 الى 100 px, الافتراضى = 22px" 177 | 178 | #: includes/class-arabic-webfonts-customizer-settings.php:397 179 | msgid "Heading - H3" 180 | msgstr "عنوان - H3" 181 | 182 | #: includes/class-arabic-webfonts-customizer-settings.php:415 183 | msgid "from 10 to 100 px, default = 20px" 184 | msgstr "من 10 الى 100 px, الافتراضى = 20px" 185 | 186 | #: includes/class-arabic-webfonts-customizer-settings.php:467 187 | msgid "Heading - H4" 188 | msgstr "عنوان - H4" 189 | 190 | #: includes/class-arabic-webfonts-customizer-settings.php:485 191 | msgid "from 10 to 100 px, default = 18px" 192 | msgstr "من 10 الى 100 px, الافتراضى = 18px" 193 | 194 | #: includes/class-arabic-webfonts-customizer-settings.php:537 195 | msgid "Heading - H5" 196 | msgstr "عنوان - H5" 197 | 198 | #: includes/class-arabic-webfonts-customizer-settings.php:555 199 | msgid "from 10 to 100 px, default = 16px" 200 | msgstr "من 10 الى 100 px, الافتراضى = 16px" 201 | 202 | #: includes/class-arabic-webfonts-customizer-settings.php:607 203 | msgid "Heading - H6" 204 | msgstr "عنوان - H6" 205 | 206 | #: includes/class-arabic-webfonts-customizer-settings.php:766 207 | msgid "Custom controls" 208 | msgstr "عناصر التحكم الخاصة" 209 | 210 | #: includes/class-arabic-webfonts-customizer-settings.php:767 211 | msgid "Control in Custom Controls typography" 212 | msgstr "التحكم فى كل العناصر الخاصة المضافة" 213 | 214 | #: includes/class-arabic-webfonts-customizer-settings.php:779 215 | msgid "Reset All Settings" 216 | msgstr "إعادة تعيين كل الاعدادات" 217 | 218 | #: includes/class-arabic-webfonts-customizer-settings.php:780 219 | msgid "" 220 | "When click to reset, All settings will be lost and replaced with default " 221 | "settings!" 222 | msgstr "" 223 | "عند الضغط على إعادة تعيين. ستفقد كل الاعدادات وسيتم الرجوع الى الاعدادات " 224 | "الافتراضية!" 225 | 226 | #: includes/class-arabic-webfonts-customizer-settings.php:799 227 | msgid "More Plugins By Jozoor" 228 | msgstr "المزيد من الإضافات بواسطة Jozoor" 229 | 230 | #: includes/class-arabic-webfonts-customizer-settings.php:800 231 | msgid "Latest Plugins By Jozoor" 232 | msgstr "أحدث الإضافات بواسطة Jozoor" 233 | 234 | #: includes/class-arabic-webfonts-post-type.php:69 235 | msgid "Arabic Webfonts Controls" 236 | msgstr "عناصر التحكم" 237 | 238 | #: includes/class-arabic-webfonts-post-type.php:70 239 | msgid "Arabic Webfonts Control" 240 | msgstr "عناصر التحكم" 241 | 242 | #: includes/class-arabic-webfonts-post-type.php:71 243 | #: includes/class-arabic-webfonts-post-type.php:72 244 | msgid "Add New Control" 245 | msgstr "أضف عنصر جديد" 246 | 247 | #: includes/class-arabic-webfonts-post-type.php:73 248 | msgid "Edit Control" 249 | msgstr "تعديل عنصر التحكم" 250 | 251 | #: includes/class-arabic-webfonts-post-type.php:74 252 | msgid "New Control" 253 | msgstr "عنصر تحكم جديد" 254 | 255 | #: includes/class-arabic-webfonts-post-type.php:75 256 | #: includes/class-arabic-webfonts.php:64 257 | msgid "All Controls" 258 | msgstr "عناصر التحكم" 259 | 260 | #: includes/class-arabic-webfonts-post-type.php:76 261 | msgid "No Controls found" 262 | msgstr "لا يوجد عناصر تحكم مضافة" 263 | 264 | #: includes/class-arabic-webfonts-post-type.php:114 265 | #: includes/class-arabic-webfonts-post-type.php:117 266 | msgid "Control updated. Please visit the Customizer to manage this control." 267 | msgstr "" 268 | "تم تحديث عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 269 | 270 | #: includes/class-arabic-webfonts-post-type.php:115 271 | msgid "Control updated." 272 | msgstr "تم تحديث عنصر التحكم." 273 | 274 | #: includes/class-arabic-webfonts-post-type.php:116 275 | msgid "Control deleted." 276 | msgstr "تم حذف عنصر التحكم." 277 | 278 | #: includes/class-arabic-webfonts-post-type.php:120 279 | msgid "Control published. Please visit the Customizer to manage this control." 280 | msgstr "" 281 | "تم اضافة عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 282 | 283 | #: includes/class-arabic-webfonts-post-type.php:121 284 | msgid "Control saved. Please visit the Customizer to manage this control." 285 | msgstr "تم حفظ عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 286 | 287 | #: includes/class-arabic-webfonts-post-type.php:122 288 | msgid "Control submitted. Please visit the Customizer to manage this control." 289 | msgstr "" 290 | "تم اضافة عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 291 | 292 | #: includes/class-arabic-webfonts-post-type.php:165 293 | msgid "Delete this control permanently" 294 | msgstr "حذف هذا العنصر بشكل دائم" 295 | 296 | #: includes/class-arabic-webfonts-post-type.php:165 297 | msgid "Delete Permanently" 298 | msgstr "حذف بشكل دائم" 299 | 300 | #: includes/class-arabic-webfonts-post-type.php:261 301 | #, php-format 302 | msgid "Control permanently deleted." 303 | msgid_plural "%s Controls permanently deleted." 304 | msgstr[0] "تم حذف %s عنصر تحكم بشكل دائم." 305 | msgstr[1] "" 306 | msgstr[2] "" 307 | msgstr[3] "" 308 | msgstr[4] "" 309 | msgstr[5] "" 310 | 311 | #: includes/class-arabic-webfonts-post-type.php:292 312 | msgid "CSS Selectors" 313 | msgstr "عناصر الـ CSS الخاصة" 314 | 315 | #: includes/class-arabic-webfonts-post-type.php:349 316 | msgid "" 317 | "Type each CSS selector that you would like this font control to manage in " 318 | "the box below.
Example : .some-class, #some-id" 319 | msgstr "" 320 | "قم باضافة عناصر الـ CSS الخاصة التى تريد ان تتحكم فيها, يمكنك الحصول على تلك " 321 | "العناصر من ملف style‪.‬css فى القالب المستخدم.
مثال : .some-class, " 322 | "#some-id" 323 | 324 | #: includes/class-arabic-webfonts.php:67 325 | msgid "More Plugins" 326 | msgstr "المزيد من الإضافات" 327 | 328 | #: includes/class-arabic-webfonts.php:108 329 | #, php-format 330 | msgid "" 331 | "This plugin can not be activated because it requires a WordPress version at " 332 | "least %1$s (or later). Please go to Dashboard ▸ Updates to get the " 333 | "latest version of WordPress." 334 | msgstr "" 335 | "لا يمكن تفعيل الاضافة لأنها تتطلب اصدار ووردبريس على الأقل %1$s او أعلى. " 336 | "برجاء الذهاب الى الرئيسية ◂ تحديثات للحصول على أخر اصدار من الووردبريس." 337 | 338 | #: includes/class-arabic-webfonts.php:111 339 | msgid "go back" 340 | msgstr "عودة للخلف" 341 | 342 | #: includes/class-arabic-webfonts.php:444 343 | msgid "" 344 | "Click OK to reset. All settings will be lost and replaced with default " 345 | "settings!" 346 | msgstr "" 347 | "اضغط OK لإعادة التعيين. ستفقد كل الاعدادات وسيتم الرجوع الى الاعدادات " 348 | "الافتراضية!" 349 | 350 | #. URI of the plugin 351 | msgid "http://plugins.jozoor.com/arabic-webfonts/" 352 | msgstr "" 353 | 354 | #. Author of the plugin 355 | msgid "Jozoor" 356 | msgstr "" 357 | 358 | #. Author URI of the plugin 359 | msgid "https://codecanyon.net/user/jozoor/portfolio?ref=Jozoor" 360 | msgstr "" 361 | -------------------------------------------------------------------------------- /lang/arabic-webfonts-ar.pot: -------------------------------------------------------------------------------- 1 | # WordPress Blank Pot 2 | # Copyright (C) 2014 ... 3 | # This file is distributed under the GNU General Public License v2 or later. 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: Arabic Webfonts v1.0\n" 7 | "Report-Msgid-Bugs-To: Translator Name \n" 8 | "POT-Creation-Date: 2018-01-29 18:19+0200\n" 9 | "PO-Revision-Date: \n" 10 | "Last-Translator: Jozoor Team \n" 11 | "Language-Team: Jozoor Team \n" 12 | "Language: ar\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " 17 | "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" 18 | "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n" 19 | "X-Poedit-SourceCharset: UTF-8\n" 20 | "X-Poedit-KeywordsList: __;_e;_n;_n:1,2\n" 21 | "X-Poedit-Basepath: ../\n" 22 | "X-Generator: Poedit 1.7.5\n" 23 | "X-Poedit-SearchPath-0: .\n" 24 | 25 | #: includes/class-arabic-webfonts-custom-controls.php:31 26 | msgid "Reset settings" 27 | msgstr "إعادة تعيين الإعدادات" 28 | 29 | #: includes/class-arabic-webfonts-custom-controls.php:80 30 | msgid "Clean WordPress Content from Broken Shortcodes." 31 | msgstr "" 32 | "تنظيف محتوى موقعك من أى shortocdes ( أكواد مختصرة ) معطلة او غير مستخدمة " 33 | "بشكل تلقائى." 34 | 35 | #: includes/class-arabic-webfonts-custom-controls.php:82 36 | msgid "View Demo" 37 | msgstr "مشاهدة الإضافة" 38 | 39 | #: includes/class-arabic-webfonts-custom-controls.php:82 40 | msgid "Get it Now" 41 | msgstr "الحصول على الإضافة" 42 | 43 | #: includes/class-arabic-webfonts-custom-controls.php:86 44 | msgid "Follow Us" 45 | msgstr "تابعنا على" 46 | 47 | #: includes/class-arabic-webfonts-customizer-settings.php:80 48 | msgid "Select Font" 49 | msgstr "إختر نوع الخط" 50 | 51 | #: includes/class-arabic-webfonts-customizer-settings.php:103 52 | #: includes/class-arabic-webfonts-post-type.php:69 53 | msgid "Arabic Webfonts" 54 | msgstr "خطوط عربية" 55 | 56 | #: includes/class-arabic-webfonts-customizer-settings.php:104 57 | msgid "" 58 | "An easy way to add Arabic fonts to any theme without coding using WordPress " 59 | "Customizer." 60 | msgstr "" 61 | "إضافة الخطوط العربية بكل سهولة لأى قالب بدون أكواد باستخدام خيار تخصيص فى " 62 | "الووردبريس" 63 | 64 | #: includes/class-arabic-webfonts-customizer-settings.php:118 65 | msgid "Body" 66 | msgstr "جسم الصفحة" 67 | 68 | #: includes/class-arabic-webfonts-customizer-settings.php:119 69 | msgid "Control in body content typography" 70 | msgstr "التحكم فى عناصر جسم الصفحة بشكل عام" 71 | 72 | #: includes/class-arabic-webfonts-customizer-settings.php:126 73 | #: includes/class-arabic-webfonts-customizer-settings.php:183 74 | #: includes/class-arabic-webfonts-customizer-settings.php:265 75 | #: includes/class-arabic-webfonts-customizer-settings.php:335 76 | #: includes/class-arabic-webfonts-customizer-settings.php:405 77 | #: includes/class-arabic-webfonts-customizer-settings.php:475 78 | #: includes/class-arabic-webfonts-customizer-settings.php:545 79 | #: includes/class-arabic-webfonts-customizer-settings.php:615 80 | #: includes/class-arabic-webfonts-customizer-settings.php:702 81 | msgid "Font Family" 82 | msgstr "نوع الخط" 83 | 84 | #: includes/class-arabic-webfonts-customizer-settings.php:135 85 | #: includes/class-arabic-webfonts-customizer-settings.php:192 86 | #: includes/class-arabic-webfonts-customizer-settings.php:274 87 | #: includes/class-arabic-webfonts-customizer-settings.php:344 88 | #: includes/class-arabic-webfonts-customizer-settings.php:414 89 | #: includes/class-arabic-webfonts-customizer-settings.php:484 90 | #: includes/class-arabic-webfonts-customizer-settings.php:554 91 | #: includes/class-arabic-webfonts-customizer-settings.php:624 92 | #: includes/class-arabic-webfonts-customizer-settings.php:711 93 | msgid "Font Size" 94 | msgstr "حجم الخط" 95 | 96 | #: includes/class-arabic-webfonts-customizer-settings.php:136 97 | #: includes/class-arabic-webfonts-customizer-settings.php:193 98 | #: includes/class-arabic-webfonts-customizer-settings.php:625 99 | #: includes/class-arabic-webfonts-customizer-settings.php:712 100 | msgid "from 10 to 100 px, default = 14px" 101 | msgstr "من 10 الى 100 px, الافتراضى = 14px" 102 | 103 | #: includes/class-arabic-webfonts-customizer-settings.php:149 104 | #: includes/class-arabic-webfonts-customizer-settings.php:206 105 | #: includes/class-arabic-webfonts-customizer-settings.php:288 106 | #: includes/class-arabic-webfonts-customizer-settings.php:358 107 | #: includes/class-arabic-webfonts-customizer-settings.php:428 108 | #: includes/class-arabic-webfonts-customizer-settings.php:498 109 | #: includes/class-arabic-webfonts-customizer-settings.php:568 110 | #: includes/class-arabic-webfonts-customizer-settings.php:638 111 | #: includes/class-arabic-webfonts-customizer-settings.php:725 112 | msgid "Line Height" 113 | msgstr "المسافة بين السطور" 114 | 115 | #: includes/class-arabic-webfonts-customizer-settings.php:150 116 | #: includes/class-arabic-webfonts-customizer-settings.php:207 117 | #: includes/class-arabic-webfonts-customizer-settings.php:289 118 | #: includes/class-arabic-webfonts-customizer-settings.php:359 119 | #: includes/class-arabic-webfonts-customizer-settings.php:429 120 | #: includes/class-arabic-webfonts-customizer-settings.php:499 121 | #: includes/class-arabic-webfonts-customizer-settings.php:569 122 | #: includes/class-arabic-webfonts-customizer-settings.php:639 123 | #: includes/class-arabic-webfonts-customizer-settings.php:726 124 | msgid "from 0.5 to 5, default = 1.2" 125 | msgstr "من 0.5 الى 5, الافتراضى = 1.2" 126 | 127 | #: includes/class-arabic-webfonts-customizer-settings.php:175 128 | msgid "Paragraphs" 129 | msgstr "النصوص" 130 | 131 | #: includes/class-arabic-webfonts-customizer-settings.php:176 132 | msgid "Control in Paragraphs typography" 133 | msgstr "التحكم فى النصوص بشكل عام" 134 | 135 | #: includes/class-arabic-webfonts-customizer-settings.php:220 136 | #: includes/class-arabic-webfonts-customizer-settings.php:302 137 | #: includes/class-arabic-webfonts-customizer-settings.php:372 138 | #: includes/class-arabic-webfonts-customizer-settings.php:442 139 | #: includes/class-arabic-webfonts-customizer-settings.php:512 140 | #: includes/class-arabic-webfonts-customizer-settings.php:582 141 | #: includes/class-arabic-webfonts-customizer-settings.php:652 142 | #: includes/class-arabic-webfonts-customizer-settings.php:739 143 | msgid "Text Decoration" 144 | msgstr "تنسيق النص" 145 | 146 | #: includes/class-arabic-webfonts-customizer-settings.php:226 147 | #: includes/class-arabic-webfonts-customizer-settings.php:308 148 | #: includes/class-arabic-webfonts-customizer-settings.php:378 149 | #: includes/class-arabic-webfonts-customizer-settings.php:448 150 | #: includes/class-arabic-webfonts-customizer-settings.php:518 151 | #: includes/class-arabic-webfonts-customizer-settings.php:588 152 | #: includes/class-arabic-webfonts-customizer-settings.php:658 153 | #: includes/class-arabic-webfonts-customizer-settings.php:745 154 | msgid "Select Decoration" 155 | msgstr "إختر التنسيق" 156 | 157 | #: includes/class-arabic-webfonts-customizer-settings.php:247 158 | msgid "Headings" 159 | msgstr "العناوين" 160 | 161 | #: includes/class-arabic-webfonts-customizer-settings.php:248 162 | msgid "Control in Headings typography" 163 | msgstr "التحكم فى العناوين بشكل عام" 164 | 165 | #: includes/class-arabic-webfonts-customizer-settings.php:257 166 | msgid "Heading - H1" 167 | msgstr "عنوان - H1" 168 | 169 | #: includes/class-arabic-webfonts-customizer-settings.php:275 170 | msgid "from 10 to 100 px, default = 24px" 171 | msgstr "من 10 الى 100 px, الافتراضى = 24px" 172 | 173 | #: includes/class-arabic-webfonts-customizer-settings.php:327 174 | msgid "Heading - H2" 175 | msgstr "عنوان - H2" 176 | 177 | #: includes/class-arabic-webfonts-customizer-settings.php:345 178 | msgid "from 10 to 100 px, default = 22px" 179 | msgstr "من 10 الى 100 px, الافتراضى = 22px" 180 | 181 | #: includes/class-arabic-webfonts-customizer-settings.php:397 182 | msgid "Heading - H3" 183 | msgstr "عنوان - H3" 184 | 185 | #: includes/class-arabic-webfonts-customizer-settings.php:415 186 | msgid "from 10 to 100 px, default = 20px" 187 | msgstr "من 10 الى 100 px, الافتراضى = 20px" 188 | 189 | #: includes/class-arabic-webfonts-customizer-settings.php:467 190 | msgid "Heading - H4" 191 | msgstr "عنوان - H4" 192 | 193 | #: includes/class-arabic-webfonts-customizer-settings.php:485 194 | msgid "from 10 to 100 px, default = 18px" 195 | msgstr "من 10 الى 100 px, الافتراضى = 18px" 196 | 197 | #: includes/class-arabic-webfonts-customizer-settings.php:537 198 | msgid "Heading - H5" 199 | msgstr "عنوان - H5" 200 | 201 | #: includes/class-arabic-webfonts-customizer-settings.php:555 202 | msgid "from 10 to 100 px, default = 16px" 203 | msgstr "من 10 الى 100 px, الافتراضى = 16px" 204 | 205 | #: includes/class-arabic-webfonts-customizer-settings.php:607 206 | msgid "Heading - H6" 207 | msgstr "عنوان - H6" 208 | 209 | #: includes/class-arabic-webfonts-customizer-settings.php:766 210 | msgid "Custom controls" 211 | msgstr "عناصر التحكم الخاصة" 212 | 213 | #: includes/class-arabic-webfonts-customizer-settings.php:767 214 | msgid "Control in Custom Controls typography" 215 | msgstr "التحكم فى كل العناصر الخاصة المضافة" 216 | 217 | #: includes/class-arabic-webfonts-customizer-settings.php:779 218 | msgid "Reset All Settings" 219 | msgstr "إعادة تعيين كل الاعدادات" 220 | 221 | #: includes/class-arabic-webfonts-customizer-settings.php:780 222 | msgid "" 223 | "When click to reset, All settings will be lost and replaced with default " 224 | "settings!" 225 | msgstr "" 226 | "عند الضغط على إعادة تعيين. ستفقد كل الاعدادات وسيتم الرجوع الى الاعدادات " 227 | "الافتراضية!" 228 | 229 | #: includes/class-arabic-webfonts-customizer-settings.php:799 230 | msgid "More Plugins By Jozoor" 231 | msgstr "المزيد من الإضافات بواسطة Jozoor" 232 | 233 | #: includes/class-arabic-webfonts-customizer-settings.php:800 234 | msgid "Latest Plugins By Jozoor Team" 235 | msgstr "أحدث الإضافات بواسطة Jozoor" 236 | 237 | #: includes/class-arabic-webfonts-post-type.php:61 238 | msgid "Arabic Webfonts Controls" 239 | msgstr "عناصر التحكم" 240 | 241 | #: includes/class-arabic-webfonts-post-type.php:62 242 | msgid "Arabic Webfonts Control" 243 | msgstr "عناصر التحكم" 244 | 245 | #: includes/class-arabic-webfonts-post-type.php:63 246 | #: includes/class-arabic-webfonts-post-type.php:64 247 | msgid "Add New Control" 248 | msgstr "أضف عنصر جديد" 249 | 250 | #: includes/class-arabic-webfonts-post-type.php:65 251 | msgid "Edit Control" 252 | msgstr "تعديل عنصر التحكم" 253 | 254 | #: includes/class-arabic-webfonts-post-type.php:66 255 | msgid "New Control" 256 | msgstr "عنصر تحكم جديد" 257 | 258 | #: includes/class-arabic-webfonts-post-type.php:67 259 | msgid "All Controls" 260 | msgstr "عناصر التحكم" 261 | 262 | #: includes/class-arabic-webfonts-post-type.php:68 263 | msgid "No Controls found" 264 | msgstr "لا يوجد عناصر تحكم مضافة" 265 | 266 | #: includes/class-arabic-webfonts-post-type.php:105 267 | #: includes/class-arabic-webfonts-post-type.php:108 268 | msgid "Control updated. Please visit the Customizer to manage this control." 269 | msgstr "" 270 | "تم تحديث عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 271 | 272 | #: includes/class-arabic-webfonts-post-type.php:106 273 | msgid "Control updated." 274 | msgstr "تم تحديث عنصر التحكم." 275 | 276 | #: includes/class-arabic-webfonts-post-type.php:107 277 | msgid "Control deleted." 278 | msgstr "تم حذف عنصر التحكم." 279 | 280 | #: includes/class-arabic-webfonts-post-type.php:111 281 | msgid "Control published. Please visit the Customizer to manage this control." 282 | msgstr "" 283 | "تم اضافة عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 284 | 285 | #: includes/class-arabic-webfonts-post-type.php:112 286 | msgid "Control saved. Please visit the Customizer to manage this control." 287 | msgstr "تم حفظ عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 288 | 289 | #: includes/class-arabic-webfonts-post-type.php:113 290 | msgid "Control submitted. Please visit the Customizer to manage this control." 291 | msgstr "" 292 | "تم اضافة عنصر التحكم. قم بالذهاب الى رابط تخصيص لبدء تغيير خصائص العنصر." 293 | 294 | #: includes/class-arabic-webfonts-post-type.php:155 295 | msgid "Delete this control permanently" 296 | msgstr "حذف هذا العنصر بشكل دائم" 297 | 298 | #: includes/class-arabic-webfonts-post-type.php:155 299 | msgid "Delete Permanently" 300 | msgstr "حذف بشكل دائم" 301 | 302 | #: includes/class-arabic-webfonts-post-type.php:246 303 | #, php-format 304 | msgid "Control permanently deleted." 305 | msgid_plural "%s Controls permanently deleted." 306 | msgstr[0] "تم حذف %s عنصر تحكم بشكل دائم." 307 | msgstr[1] "تم حذف %s عنصر تحكم بشكل دائم." 308 | msgstr[2] "تم حذف %s عنصر تحكم بشكل دائم." 309 | msgstr[3] "تم حذف %s عنصر تحكم بشكل دائم." 310 | msgstr[4] "تم حذف %s عنصر تحكم بشكل دائم." 311 | msgstr[5] "تم حذف %s عنصر تحكم بشكل دائم." 312 | 313 | #: includes/class-arabic-webfonts-post-type.php:275 314 | msgid "CSS Selectors" 315 | msgstr "عناصر الـ CSS الخاصة" 316 | 317 | #: includes/class-arabic-webfonts-post-type.php:326 318 | msgid "" 319 | "Type each CSS selector that you would like this font control to manage in " 320 | "the box below.
Example : .some-class, #some-id" 321 | msgstr "" 322 | "قم باضافة عناصر الـ CSS الخاصة التى تريد ان تتحكم فيها, يمكنك الحصول على تلك " 323 | "العناصر من ملف style‪.‬css فى القالب المستخدم.
مثال : .some-class, " 324 | "#some-id" 325 | 326 | #: includes/class-arabic-webfonts.php:64 327 | msgid "المزيد من الإضافات بواسطة Jozoor" 328 | msgstr "" 329 | 330 | #: includes/class-arabic-webfonts.php:105 331 | #, php-format 332 | msgid "" 333 | "This plugin can not be activated because it requires a WordPress version at " 334 | "least %1$s (or later). Please go to Dashboard ▸ Updates to get the " 335 | "latest version of WordPress." 336 | msgstr "" 337 | "لا يمكن تفعيل الاضافة لأنها تتطلب اصدار ووردبريس على الأقل %1$s او أعلى. " 338 | "برجاء الذهاب الى الرئيسية ◂ تحديثات للحصول على أخر اصدار من الووردبريس." 339 | 340 | #: includes/class-arabic-webfonts.php:108 341 | msgid "go back" 342 | msgstr "عودة للخلف" 343 | 344 | #: includes/class-arabic-webfonts.php:441 345 | msgid "" 346 | "Click OK to reset. All settings will be lost and replaced with default " 347 | "settings!" 348 | msgstr "" 349 | "اضغط OK لإعادة التعيين. ستفقد كل الاعدادات وسيتم الرجوع الى الاعدادات " 350 | "الافتراضية!" 351 | 352 | #~ msgid "More plugins by Jozoor" 353 | #~ msgstr "المزيد من الإضافات" 354 | -------------------------------------------------------------------------------- /vendor/composer/ClassLoader.php: -------------------------------------------------------------------------------- 1 | 7 | * Jordi Boggiano 8 | * 9 | * For the full copyright and license information, please view the LICENSE 10 | * file that was distributed with this source code. 11 | */ 12 | 13 | namespace Composer\Autoload; 14 | 15 | /** 16 | * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. 17 | * 18 | * $loader = new \Composer\Autoload\ClassLoader(); 19 | * 20 | * // register classes with namespaces 21 | * $loader->add('Symfony\Component', __DIR__.'/component'); 22 | * $loader->add('Symfony', __DIR__.'/framework'); 23 | * 24 | * // activate the autoloader 25 | * $loader->register(); 26 | * 27 | * // to enable searching the include path (eg. for PEAR packages) 28 | * $loader->setUseIncludePath(true); 29 | * 30 | * In this example, if you try to use a class in the Symfony\Component 31 | * namespace or one of its children (Symfony\Component\Console for instance), 32 | * the autoloader will first look for the class under the component/ 33 | * directory, and it will then fallback to the framework/ directory if not 34 | * found before giving up. 35 | * 36 | * This class is loosely based on the Symfony UniversalClassLoader. 37 | * 38 | * @author Fabien Potencier 39 | * @author Jordi Boggiano 40 | * @see http://www.php-fig.org/psr/psr-0/ 41 | * @see http://www.php-fig.org/psr/psr-4/ 42 | */ 43 | class ClassLoader 44 | { 45 | // PSR-4 46 | private $prefixLengthsPsr4 = array(); 47 | private $prefixDirsPsr4 = array(); 48 | private $fallbackDirsPsr4 = array(); 49 | 50 | // PSR-0 51 | private $prefixesPsr0 = array(); 52 | private $fallbackDirsPsr0 = array(); 53 | 54 | private $useIncludePath = false; 55 | private $classMap = array(); 56 | private $classMapAuthoritative = false; 57 | private $missingClasses = array(); 58 | private $apcuPrefix; 59 | 60 | public function getPrefixes() 61 | { 62 | if (!empty($this->prefixesPsr0)) { 63 | return call_user_func_array('array_merge', $this->prefixesPsr0); 64 | } 65 | 66 | return array(); 67 | } 68 | 69 | public function getPrefixesPsr4() 70 | { 71 | return $this->prefixDirsPsr4; 72 | } 73 | 74 | public function getFallbackDirs() 75 | { 76 | return $this->fallbackDirsPsr0; 77 | } 78 | 79 | public function getFallbackDirsPsr4() 80 | { 81 | return $this->fallbackDirsPsr4; 82 | } 83 | 84 | public function getClassMap() 85 | { 86 | return $this->classMap; 87 | } 88 | 89 | /** 90 | * @param array $classMap Class to filename map 91 | */ 92 | public function addClassMap(array $classMap) 93 | { 94 | if ($this->classMap) { 95 | $this->classMap = array_merge($this->classMap, $classMap); 96 | } else { 97 | $this->classMap = $classMap; 98 | } 99 | } 100 | 101 | /** 102 | * Registers a set of PSR-0 directories for a given prefix, either 103 | * appending or prepending to the ones previously set for this prefix. 104 | * 105 | * @param string $prefix The prefix 106 | * @param array|string $paths The PSR-0 root directories 107 | * @param bool $prepend Whether to prepend the directories 108 | */ 109 | public function add($prefix, $paths, $prepend = false) 110 | { 111 | if (!$prefix) { 112 | if ($prepend) { 113 | $this->fallbackDirsPsr0 = array_merge( 114 | (array) $paths, 115 | $this->fallbackDirsPsr0 116 | ); 117 | } else { 118 | $this->fallbackDirsPsr0 = array_merge( 119 | $this->fallbackDirsPsr0, 120 | (array) $paths 121 | ); 122 | } 123 | 124 | return; 125 | } 126 | 127 | $first = $prefix[0]; 128 | if (!isset($this->prefixesPsr0[$first][$prefix])) { 129 | $this->prefixesPsr0[$first][$prefix] = (array) $paths; 130 | 131 | return; 132 | } 133 | if ($prepend) { 134 | $this->prefixesPsr0[$first][$prefix] = array_merge( 135 | (array) $paths, 136 | $this->prefixesPsr0[$first][$prefix] 137 | ); 138 | } else { 139 | $this->prefixesPsr0[$first][$prefix] = array_merge( 140 | $this->prefixesPsr0[$first][$prefix], 141 | (array) $paths 142 | ); 143 | } 144 | } 145 | 146 | /** 147 | * Registers a set of PSR-4 directories for a given namespace, either 148 | * appending or prepending to the ones previously set for this namespace. 149 | * 150 | * @param string $prefix The prefix/namespace, with trailing '\\' 151 | * @param array|string $paths The PSR-4 base directories 152 | * @param bool $prepend Whether to prepend the directories 153 | * 154 | * @throws \InvalidArgumentException 155 | */ 156 | public function addPsr4($prefix, $paths, $prepend = false) 157 | { 158 | if (!$prefix) { 159 | // Register directories for the root namespace. 160 | if ($prepend) { 161 | $this->fallbackDirsPsr4 = array_merge( 162 | (array) $paths, 163 | $this->fallbackDirsPsr4 164 | ); 165 | } else { 166 | $this->fallbackDirsPsr4 = array_merge( 167 | $this->fallbackDirsPsr4, 168 | (array) $paths 169 | ); 170 | } 171 | } elseif (!isset($this->prefixDirsPsr4[$prefix])) { 172 | // Register directories for a new namespace. 173 | $length = strlen($prefix); 174 | if ('\\' !== $prefix[$length - 1]) { 175 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); 176 | } 177 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 178 | $this->prefixDirsPsr4[$prefix] = (array) $paths; 179 | } elseif ($prepend) { 180 | // Prepend directories for an already registered namespace. 181 | $this->prefixDirsPsr4[$prefix] = array_merge( 182 | (array) $paths, 183 | $this->prefixDirsPsr4[$prefix] 184 | ); 185 | } else { 186 | // Append directories for an already registered namespace. 187 | $this->prefixDirsPsr4[$prefix] = array_merge( 188 | $this->prefixDirsPsr4[$prefix], 189 | (array) $paths 190 | ); 191 | } 192 | } 193 | 194 | /** 195 | * Registers a set of PSR-0 directories for a given prefix, 196 | * replacing any others previously set for this prefix. 197 | * 198 | * @param string $prefix The prefix 199 | * @param array|string $paths The PSR-0 base directories 200 | */ 201 | public function set($prefix, $paths) 202 | { 203 | if (!$prefix) { 204 | $this->fallbackDirsPsr0 = (array) $paths; 205 | } else { 206 | $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; 207 | } 208 | } 209 | 210 | /** 211 | * Registers a set of PSR-4 directories for a given namespace, 212 | * replacing any others previously set for this namespace. 213 | * 214 | * @param string $prefix The prefix/namespace, with trailing '\\' 215 | * @param array|string $paths The PSR-4 base directories 216 | * 217 | * @throws \InvalidArgumentException 218 | */ 219 | public function setPsr4($prefix, $paths) 220 | { 221 | if (!$prefix) { 222 | $this->fallbackDirsPsr4 = (array) $paths; 223 | } else { 224 | $length = strlen($prefix); 225 | if ('\\' !== $prefix[$length - 1]) { 226 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); 227 | } 228 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 229 | $this->prefixDirsPsr4[$prefix] = (array) $paths; 230 | } 231 | } 232 | 233 | /** 234 | * Turns on searching the include path for class files. 235 | * 236 | * @param bool $useIncludePath 237 | */ 238 | public function setUseIncludePath($useIncludePath) 239 | { 240 | $this->useIncludePath = $useIncludePath; 241 | } 242 | 243 | /** 244 | * Can be used to check if the autoloader uses the include path to check 245 | * for classes. 246 | * 247 | * @return bool 248 | */ 249 | public function getUseIncludePath() 250 | { 251 | return $this->useIncludePath; 252 | } 253 | 254 | /** 255 | * Turns off searching the prefix and fallback directories for classes 256 | * that have not been registered with the class map. 257 | * 258 | * @param bool $classMapAuthoritative 259 | */ 260 | public function setClassMapAuthoritative($classMapAuthoritative) 261 | { 262 | $this->classMapAuthoritative = $classMapAuthoritative; 263 | } 264 | 265 | /** 266 | * Should class lookup fail if not found in the current class map? 267 | * 268 | * @return bool 269 | */ 270 | public function isClassMapAuthoritative() 271 | { 272 | return $this->classMapAuthoritative; 273 | } 274 | 275 | /** 276 | * APCu prefix to use to cache found/not-found classes, if the extension is enabled. 277 | * 278 | * @param string|null $apcuPrefix 279 | */ 280 | public function setApcuPrefix($apcuPrefix) 281 | { 282 | $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; 283 | } 284 | 285 | /** 286 | * The APCu prefix in use, or null if APCu caching is not enabled. 287 | * 288 | * @return string|null 289 | */ 290 | public function getApcuPrefix() 291 | { 292 | return $this->apcuPrefix; 293 | } 294 | 295 | /** 296 | * Registers this instance as an autoloader. 297 | * 298 | * @param bool $prepend Whether to prepend the autoloader or not 299 | */ 300 | public function register($prepend = false) 301 | { 302 | spl_autoload_register(array($this, 'loadClass'), true, $prepend); 303 | } 304 | 305 | /** 306 | * Unregisters this instance as an autoloader. 307 | */ 308 | public function unregister() 309 | { 310 | spl_autoload_unregister(array($this, 'loadClass')); 311 | } 312 | 313 | /** 314 | * Loads the given class or interface. 315 | * 316 | * @param string $class The name of the class 317 | * @return bool|null True if loaded, null otherwise 318 | */ 319 | public function loadClass($class) 320 | { 321 | if ($file = $this->findFile($class)) { 322 | includeFile($file); 323 | 324 | return true; 325 | } 326 | } 327 | 328 | /** 329 | * Finds the path to the file where the class is defined. 330 | * 331 | * @param string $class The name of the class 332 | * 333 | * @return string|false The path if found, false otherwise 334 | */ 335 | public function findFile($class) 336 | { 337 | // class map lookup 338 | if (isset($this->classMap[$class])) { 339 | return $this->classMap[$class]; 340 | } 341 | if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { 342 | return false; 343 | } 344 | if (null !== $this->apcuPrefix) { 345 | $file = apcu_fetch($this->apcuPrefix.$class, $hit); 346 | if ($hit) { 347 | return $file; 348 | } 349 | } 350 | 351 | $file = $this->findFileWithExtension($class, '.php'); 352 | 353 | // Search for Hack files if we are running on HHVM 354 | if (false === $file && defined('HHVM_VERSION')) { 355 | $file = $this->findFileWithExtension($class, '.hh'); 356 | } 357 | 358 | if (null !== $this->apcuPrefix) { 359 | apcu_add($this->apcuPrefix.$class, $file); 360 | } 361 | 362 | if (false === $file) { 363 | // Remember that this class does not exist. 364 | $this->missingClasses[$class] = true; 365 | } 366 | 367 | return $file; 368 | } 369 | 370 | private function findFileWithExtension($class, $ext) 371 | { 372 | // PSR-4 lookup 373 | $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; 374 | 375 | $first = $class[0]; 376 | if (isset($this->prefixLengthsPsr4[$first])) { 377 | $subPath = $class; 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { 379 | $subPath = substr($subPath, 0, $lastPos); 380 | $search = $subPath.'\\'; 381 | if (isset($this->prefixDirsPsr4[$search])) { 382 | foreach ($this->prefixDirsPsr4[$search] as $dir) { 383 | $length = $this->prefixLengthsPsr4[$first][$search]; 384 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { 385 | return $file; 386 | } 387 | } 388 | } 389 | } 390 | } 391 | 392 | // PSR-4 fallback dirs 393 | foreach ($this->fallbackDirsPsr4 as $dir) { 394 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { 395 | return $file; 396 | } 397 | } 398 | 399 | // PSR-0 lookup 400 | if (false !== $pos = strrpos($class, '\\')) { 401 | // namespaced class name 402 | $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); 404 | } else { 405 | // PEAR-like class name 406 | $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; 407 | } 408 | 409 | if (isset($this->prefixesPsr0[$first])) { 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { 411 | if (0 === strpos($class, $prefix)) { 412 | foreach ($dirs as $dir) { 413 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { 414 | return $file; 415 | } 416 | } 417 | } 418 | } 419 | } 420 | 421 | // PSR-0 fallback dirs 422 | foreach ($this->fallbackDirsPsr0 as $dir) { 423 | if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { 424 | return $file; 425 | } 426 | } 427 | 428 | // PSR-0 include paths. 429 | if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { 430 | return $file; 431 | } 432 | 433 | return false; 434 | } 435 | } 436 | 437 | /** 438 | * Scope isolated include. 439 | * 440 | * Prevents access to $this/self from included files. 441 | */ 442 | function includeFile($file) 443 | { 444 | include $file; 445 | } 446 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /includes/class-arabic-webfonts.php: -------------------------------------------------------------------------------- 1 | add(array( 63 | array( 64 | 'awf-controls' => '' . __('All Controls', 'arabic-webfonts') . '', 65 | ), 66 | array( 67 | 'more-plugins' => '' . __('More Plugins', 'arabic-webfonts') . '', 68 | ), 69 | )); 70 | 71 | $this->plugin_name = 'arabic-webfonts'; 72 | $this->version = '1.4.6'; 73 | $this->fonts = $this->get_fonts(); 74 | 75 | $this->load_customizer(); 76 | $this->get_post_type(); 77 | 78 | add_action( 'wp_head' , array( $this, 'header_output' ) ); 79 | add_action( 'wp_enqueue_scripts' , array( $this, 'enqueue_style' ) ); 80 | add_action( 'customize_controls_enqueue_scripts' , array( $this, 'customize_controls_script' ) ); 81 | add_action( 'customize_preview_init' , array( $this, 'live_preview' ) ); 82 | add_action( 'wp_ajax_reset_customizer_settings', array( $this, 'ajax_reset_customizer_settings' ) ); 83 | add_action( 'wp_footer', array( $this, 'custom_footer_actions' ), 9999, 0 ); 84 | add_action( 'wp_footer_preview', array( $this, 'custom_css_selectors_live_preview' ), 9999, 0 ); 85 | 86 | } 87 | 88 | /** 89 | * The code that runs during plugin activation. 90 | * 91 | * @since 1.0 92 | * @access public static 93 | */ 94 | public static function activate() { 95 | 96 | // get wp version 97 | global $wp_version; 98 | 99 | // compatible version (or later) 100 | $wp_compatible_version = '4.0'; 101 | 102 | if ( version_compare( $wp_version, $wp_compatible_version, '<' ) ) { 103 | 104 | deactivate_plugins( basename( __FILE__ ) ); 105 | wp_die( 106 | '

' . 107 | sprintf( 108 | __( 'This plugin can not be activated because it requires a WordPress version at least %1$s (or later). Please go to Dashboard ▸ Updates to get the latest version of WordPress.', 'arabic-webfonts' ), 109 | $wp_compatible_version 110 | ) 111 | . '

' . __( 'go back', 'arabic-webfonts' ) . '' 112 | ); 113 | 114 | } 115 | 116 | } 117 | 118 | /** 119 | * The code that runs during plugin deactivation. 120 | * 121 | * @since 1.0 122 | * @access public static 123 | */ 124 | public static function deactivate() { 125 | 126 | // delete transients 127 | delete_transient( 'awf-get-fonts' ); 128 | 129 | } 130 | 131 | /** 132 | * Get all fonts from fontface.me API. 133 | * 134 | * @since 1.2 135 | * @access public 136 | */ 137 | public function get_fonts() { 138 | 139 | // name of transient in database 140 | $transName = 'awf-get-fonts'; 141 | 142 | // time in days between updates, set to 2 days 143 | $cacheTime = 2 * DAY_IN_SECONDS; 144 | 145 | // get cached fonts 146 | $content = get_transient( $transName ); 147 | 148 | // check for transient. If none, then get all fonts from API 149 | if( $content === false ) { 150 | 151 | // get all fonts from API json content 152 | $fontfaceApi = 'http://fontface.me/font/all'; 153 | $fontsContent = wp_remote_get( $fontfaceApi, array('sslverify' => false) ); 154 | 155 | // check if it is not a valid request 156 | if( is_wp_error( $fontsContent ) ) { 157 | 158 | return; 159 | 160 | } else { 161 | 162 | $content = json_decode($fontsContent['body'], true); 163 | set_transient($transName, $content, $cacheTime); 164 | 165 | } 166 | 167 | } 168 | 169 | return $content; 170 | 171 | } 172 | 173 | /** 174 | * Load the customizer api. 175 | * 176 | * @since 1.0 177 | * @access private 178 | */ 179 | private function load_customizer() { 180 | 181 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-arabic-webfonts-customizer.php'; 182 | new AWF_Customizer( $this->plugin_name, $this->fonts ); 183 | 184 | } 185 | 186 | /** 187 | * Get the custom post type [ awf_font_control ]. 188 | * 189 | * @since 1.0 190 | * @access private 191 | */ 192 | private function get_post_type() { 193 | 194 | require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-arabic-webfonts-post-type.php'; 195 | new AWF_Post_Type( $this->plugin_name ); 196 | 197 | } 198 | 199 | /** 200 | * Get all font controls ids from custom post type [ awf_font_control ]. 201 | * 202 | * @since 1.0 203 | * @access private 204 | */ 205 | private function get_custom_controls_ids() { 206 | 207 | // check if any controls exists 208 | $custom_controls = get_posts( array('post_type' => 'awf_font_control', 'posts_per_page' => -1) ); 209 | 210 | if($custom_controls) { 211 | 212 | // get all controls ids 213 | $custom_controls_ids = array(); 214 | foreach ( $custom_controls as $post ) { 215 | 216 | $custom_controls_ids[] = $post->ID; 217 | 218 | } 219 | 220 | return $custom_controls_ids; 221 | 222 | } 223 | 224 | } 225 | 226 | /** 227 | * Enqueue style for for live customize preview and the normal site. 228 | * 229 | * @since 1.0 230 | * @access public 231 | */ 232 | public function enqueue_style() { 233 | 234 | // check if customize preview is active 235 | if ( is_customize_preview() ) { 236 | 237 | /** 238 | * Get all fonts 239 | * this updated to use fonts API 240 | * 241 | * @since 1.2 242 | */ 243 | $all_fonts = array(); 244 | foreach ($this->get_fonts() as $font) { 245 | $all_fonts[] = $font['permalink'] . ','; 246 | } 247 | $all_fonts_display = implode('',$all_fonts); 248 | 249 | wp_enqueue_style( 250 | $this->plugin_name .'-live', 251 | '//www.fontstatic.com/f='.$all_fonts_display, 252 | array(), 253 | null, 254 | 'all' 255 | ); 256 | 257 | } else { 258 | 259 | // get body font 260 | if ( get_theme_mod('awf_body_font_family') != '' ) { $body_font = get_theme_mod('awf_body_font_family'). ','; } else { $body_font = ''; } 261 | // get paragraphs font 262 | if ( get_theme_mod('awf_paragraphs_font_family') != '' ) { $paragraphs_font = get_theme_mod('awf_paragraphs_font_family'). ','; } else { $paragraphs_font = ''; } 263 | // get h1 font 264 | if ( get_theme_mod('awf_h1_font_family') != '' ) { $h1_font = get_theme_mod('awf_h1_font_family'). ','; } else { $h1_font = ''; } 265 | // get h2 font 266 | if ( get_theme_mod('awf_h2_font_family') != '' ) { $h2_font = get_theme_mod('awf_h2_font_family'). ','; } else { $h2_font = ''; } 267 | // get h3 font 268 | if ( get_theme_mod('awf_h3_font_family') != '' ) { $h3_font = get_theme_mod('awf_h3_font_family'). ','; } else { $h3_font = ''; } 269 | // get h4 font 270 | if ( get_theme_mod('awf_h4_font_family') != '' ) { $h4_font = get_theme_mod('awf_h4_font_family'). ','; } else { $h4_font = ''; } 271 | // get h5 font 272 | if ( get_theme_mod('awf_h5_font_family') != '' ) { $h5_font = get_theme_mod('awf_h5_font_family'). ','; } else { $h5_font = ''; } 273 | // get h6 font 274 | if ( get_theme_mod('awf_h6_font_family') != '' ) { $h6_font = get_theme_mod('awf_h6_font_family'). ','; } else { $h6_font = ''; } 275 | 276 | // get custom controls fonts 277 | if( $this->get_custom_controls_ids() ) { 278 | 279 | $custom_controls_fonts = array(); 280 | foreach ( $this->get_custom_controls_ids() as $id ) { 281 | 282 | if ( get_theme_mod('awf_'. $id .'_font_family') != '' ) { 283 | $custom_controls_fonts[] = get_theme_mod('awf_'. $id .'_font_family'). ','; 284 | } else { $custom_controls_fonts[] = ''; } 285 | 286 | } 287 | 288 | $custom_controls_fonts_display = implode('',$custom_controls_fonts); 289 | 290 | } else { 291 | $custom_controls_fonts_display = ''; 292 | } 293 | 294 | 295 | if( empty($body_font) && empty($paragraphs_font) && empty($h1_font) && empty($h2_font) && empty($h3_font) 296 | && empty($h4_font) && empty($h5_font) && empty($h6_font) && empty($custom_controls_fonts_display) ) { 297 | 298 | } else { 299 | 300 | // check if font type is duplicated 301 | $default_settings_fonts_types = array ( $body_font, $paragraphs_font, $h1_font, $h2_font, $h3_font, $h4_font, $h5_font, $h6_font ); 302 | if( $this->get_custom_controls_ids() ) { 303 | $all_fonts_types = array_merge($default_settings_fonts_types, $custom_controls_fonts); 304 | $final_fonts_types = implode('',array_unique($all_fonts_types)); 305 | } else { 306 | $final_fonts_types = implode('',array_unique($default_settings_fonts_types)); 307 | } 308 | 309 | wp_enqueue_style( 310 | $this->plugin_name, 311 | '//www.fontstatic.com/f='.$final_fonts_types, 312 | array(), 313 | null, 314 | 'all' 315 | ); 316 | 317 | } 318 | } 319 | 320 | } 321 | 322 | /** 323 | * Do action footer custom action working like [ customize_preview_init ]. 324 | * 325 | * @since 1.0 326 | * @access public 327 | */ 328 | public function custom_footer_actions() { 329 | 330 | // check if customize preview is active 331 | if ( is_customize_preview() ) { 332 | 333 | // this action used to load wp.customize in live preview for custom controls 334 | do_action('wp_footer_preview'); 335 | 336 | } 337 | 338 | } 339 | 340 | /** 341 | * Enqueue script for customize live preview. 342 | * 343 | * @since 1.0 344 | * @access public 345 | */ 346 | public function live_preview() { 347 | 348 | wp_enqueue_script( $this->plugin_name .'-customizer-preview', plugins_url( '/assets/js/customizer-preview.js', dirname(__FILE__) ), array( 'jquery', 'customize-preview' ), $this->version, true ); 349 | 350 | } 351 | 352 | /** 353 | * Enqueue custom script for cunstom controls in customize live preview. 354 | * 355 | * @since 1.0 356 | * @access public 357 | */ 358 | public function custom_css_selectors_live_preview() { 359 | 360 | // get custom controls styles 361 | if( $this->get_custom_controls_ids() ) { 362 | 363 | ?> 364 | 414 | plugin_name .'-customizer-controls', 429 | plugins_url( '/assets/css/customizer-controls.css', dirname(__FILE__) ), 430 | array(), 431 | $this->version 432 | ); 433 | 434 | wp_enqueue_script( 435 | $this->plugin_name .'-customizer-controls', 436 | plugins_url( '/assets/js/customizer-controls.js', dirname(__FILE__) ), 437 | array( 'jquery', 'customize-controls' ), 438 | $this->version, true 439 | ); 440 | 441 | wp_localize_script( 442 | $this->plugin_name .'-customizer-controls', 443 | 'AWF_Customizer_Reset', 444 | array( 'confirm' => __( "Click OK to reset. All settings will be lost and replaced with default settings!", 'arabic-webfonts' ), ) 445 | ); 446 | 447 | } 448 | 449 | /** 450 | * Ajax method for reset customizer settings button. 451 | * 452 | * @since 1.0 453 | * @access public 454 | */ 455 | public function ajax_reset_customizer_settings() { 456 | 457 | // get section id 458 | $reset_section = esc_attr($_POST['reset_section']); 459 | 460 | switch ( $reset_section ) { 461 | 462 | // body section 463 | case 'awf_body_settings_reset_control': 464 | 465 | remove_theme_mod('awf_body_font_family'); 466 | remove_theme_mod('awf_body_font_size'); 467 | remove_theme_mod('awf_body_line_height'); 468 | 469 | break; 470 | 471 | // paragraphs section 472 | case 'awf_paragraphs_settings_reset_control': 473 | 474 | remove_theme_mod('awf_paragraphs_font_family'); 475 | remove_theme_mod('awf_paragraphs_font_size'); 476 | remove_theme_mod('awf_paragraphs_line_height'); 477 | remove_theme_mod('awf_paragraphs_text_decoration'); 478 | 479 | break; 480 | 481 | // headings section - h1 group 482 | case 'awf_h1_settings_reset_control': 483 | 484 | remove_theme_mod('awf_h1_font_family'); 485 | remove_theme_mod('awf_h1_font_size'); 486 | remove_theme_mod('awf_h1_line_height'); 487 | remove_theme_mod('awf_h1_text_decoration'); 488 | 489 | break; 490 | 491 | // headings section - h2 group 492 | case 'awf_h2_settings_reset_control': 493 | 494 | remove_theme_mod('awf_h2_font_family'); 495 | remove_theme_mod('awf_h2_font_size'); 496 | remove_theme_mod('awf_h2_line_height'); 497 | remove_theme_mod('awf_h2_text_decoration'); 498 | 499 | break; 500 | 501 | // headings section - h3 group 502 | case 'awf_h3_settings_reset_control': 503 | 504 | remove_theme_mod('awf_h3_font_family'); 505 | remove_theme_mod('awf_h3_font_size'); 506 | remove_theme_mod('awf_h3_line_height'); 507 | remove_theme_mod('awf_h3_text_decoration'); 508 | 509 | break; 510 | 511 | // headings section - h4 group 512 | case 'awf_h4_settings_reset_control': 513 | 514 | remove_theme_mod('awf_h4_font_family'); 515 | remove_theme_mod('awf_h4_font_size'); 516 | remove_theme_mod('awf_h4_line_height'); 517 | remove_theme_mod('awf_h4_text_decoration'); 518 | 519 | break; 520 | 521 | // headings section - h5 group 522 | case 'awf_h5_settings_reset_control': 523 | 524 | remove_theme_mod('awf_h5_font_family'); 525 | remove_theme_mod('awf_h5_font_size'); 526 | remove_theme_mod('awf_h5_line_height'); 527 | remove_theme_mod('awf_h5_text_decoration'); 528 | 529 | break; 530 | 531 | // headings section - h6 group 532 | case 'awf_h6_settings_reset_control': 533 | 534 | remove_theme_mod('awf_h6_font_family'); 535 | remove_theme_mod('awf_h6_font_size'); 536 | remove_theme_mod('awf_h6_line_height'); 537 | remove_theme_mod('awf_h6_text_decoration'); 538 | 539 | break; 540 | 541 | // reset all settings 542 | case 'awf_all_settings_reset_control': 543 | 544 | remove_theme_mod('awf_body_font_family'); 545 | remove_theme_mod('awf_body_font_size'); 546 | remove_theme_mod('awf_body_line_height'); 547 | remove_theme_mod('awf_paragraphs_font_family'); 548 | remove_theme_mod('awf_paragraphs_font_size'); 549 | remove_theme_mod('awf_paragraphs_line_height'); 550 | remove_theme_mod('awf_paragraphs_text_decoration'); 551 | remove_theme_mod('awf_h1_font_family'); 552 | remove_theme_mod('awf_h1_font_size'); 553 | remove_theme_mod('awf_h1_line_height'); 554 | remove_theme_mod('awf_h1_text_decoration'); 555 | remove_theme_mod('awf_h2_font_family'); 556 | remove_theme_mod('awf_h2_font_size'); 557 | remove_theme_mod('awf_h2_line_height'); 558 | remove_theme_mod('awf_h2_text_decoration'); 559 | remove_theme_mod('awf_h3_font_family'); 560 | remove_theme_mod('awf_h3_font_size'); 561 | remove_theme_mod('awf_h3_line_height'); 562 | remove_theme_mod('awf_h3_text_decoration'); 563 | remove_theme_mod('awf_h4_font_family'); 564 | remove_theme_mod('awf_h4_font_size'); 565 | remove_theme_mod('awf_h4_line_height'); 566 | remove_theme_mod('awf_h4_text_decoration'); 567 | remove_theme_mod('awf_h5_font_family'); 568 | remove_theme_mod('awf_h5_font_size'); 569 | remove_theme_mod('awf_h5_line_height'); 570 | remove_theme_mod('awf_h5_text_decoration'); 571 | remove_theme_mod('awf_h6_font_family'); 572 | remove_theme_mod('awf_h6_font_size'); 573 | remove_theme_mod('awf_h6_line_height'); 574 | remove_theme_mod('awf_h6_text_decoration'); 575 | // custom controls section 576 | if( $this->get_custom_controls_ids() ) { 577 | 578 | foreach ( $this->get_custom_controls_ids() as $id ) { 579 | 580 | remove_theme_mod('awf_'. $id .'_font_family'); 581 | remove_theme_mod('awf_'. $id .'_font_size'); 582 | remove_theme_mod('awf_'. $id .'_line_height'); 583 | remove_theme_mod('awf_'. $id .'_text_decoration'); 584 | 585 | } 586 | 587 | } 588 | 589 | break; 590 | 591 | // custom controls section 592 | default: 593 | 594 | if( $this->get_custom_controls_ids() ) { 595 | 596 | foreach ( $this->get_custom_controls_ids() as $id ) { 597 | 598 | if( $reset_section == 'awf_'. $id .'_settings_reset_control' ) { 599 | remove_theme_mod('awf_'. $id .'_font_family'); 600 | remove_theme_mod('awf_'. $id .'_font_size'); 601 | remove_theme_mod('awf_'. $id .'_line_height'); 602 | remove_theme_mod('awf_'. $id .'_text_decoration'); 603 | } 604 | 605 | } 606 | 607 | } 608 | 609 | break; 610 | 611 | 612 | } // end switch section settings 613 | 614 | } 615 | 616 | /** 617 | * Output css styles in header to activate customizer settings. 618 | * 619 | * @since 1.0 620 | * @access public 621 | */ 622 | public function header_output() { 623 | 624 | echo ''; 625 | ?> 626 | 879 | plugin_name. ' styles -->'; 881 | 882 | } 883 | 884 | 885 | 886 | } 887 | 888 | endif; // End Check Class Exists 889 | --------------------------------------------------------------------------------