Menu Image - Version 3.0

Version Description

Download this release

Release Info

Developer takanakui
Plugin Icon 128x128 Menu Image
Version 3.0
Comparing to
See all releases

Code changes from version 2.9.7 to 3.0

Files changed (78) hide show
  1. freemius/LICENSE.txt +0 -0
  2. freemius/README.md +0 -282
  3. freemius/assets/css/admin/account.css +1 -1
  4. freemius/assets/css/admin/connect.css +0 -0
  5. freemius/assets/js/nojquery.ba-postmessage.js +0 -0
  6. freemius/assets/js/nojquery.ba-postmessage.min.js +0 -0
  7. freemius/assets/js/postmessage.js +0 -0
  8. freemius/config.php +4 -1
  9. freemius/includes/class-freemius-abstract.php +0 -0
  10. freemius/includes/class-freemius.php +107 -6
  11. freemius/includes/class-fs-api.php +0 -0
  12. freemius/includes/class-fs-plugin-updater.php +49 -6
  13. freemius/includes/class-fs-security.php +0 -0
  14. freemius/includes/entities/class-fs-entity.php +0 -0
  15. freemius/includes/entities/class-fs-payment.php +0 -0
  16. freemius/includes/entities/class-fs-plugin-info.php +0 -0
  17. freemius/includes/entities/class-fs-plugin-license.php +0 -0
  18. freemius/includes/entities/class-fs-plugin-plan.php +0 -0
  19. freemius/includes/entities/class-fs-plugin-tag.php +0 -0
  20. freemius/includes/entities/class-fs-plugin.php +0 -0
  21. freemius/includes/entities/class-fs-pricing.php +0 -0
  22. freemius/includes/entities/class-fs-scope-entity.php +0 -0
  23. freemius/includes/entities/class-fs-site.php +0 -0
  24. freemius/includes/entities/class-fs-subscription.php +0 -0
  25. freemius/includes/entities/class-fs-user.php +0 -0
  26. freemius/includes/fs-core-functions.php +0 -0
  27. freemius/includes/fs-plugin-info-dialog.php +16 -10
  28. freemius/includes/i18n.php +2 -0
  29. freemius/includes/managers/class-fs-cache-manager.php +0 -0
  30. freemius/includes/managers/class-fs-key-value-storage.php +0 -0
  31. freemius/includes/managers/class-fs-license-manager.php +0 -0
  32. freemius/includes/managers/class-fs-option-manager.php +0 -0
  33. freemius/includes/managers/class-fs-plan-manager.php +0 -0
  34. freemius/includes/managers/class-fs-plugin-manager.php +0 -0
  35. freemius/includes/sdk/Exceptions/ArgumentNotExistException.php +0 -0
  36. freemius/includes/sdk/Exceptions/EmptyArgumentException.php +0 -0
  37. freemius/includes/sdk/Exceptions/Exception.php +0 -0
  38. freemius/includes/sdk/Exceptions/InvalidArgumentException.php +0 -0
  39. freemius/includes/sdk/Exceptions/OAuthException.php +0 -0
  40. freemius/includes/sdk/FreemiusBase.php +0 -0
  41. freemius/includes/sdk/FreemiusWordPress.php +5 -1
  42. freemius/includes/sdk/LICENSE.txt +0 -0
  43. freemius/languages/freemius-cs_CZ.mo +0 -0
  44. freemius/languages/freemius-da_DK.mo +0 -0
  45. freemius/languages/freemius-en.mo +0 -0
  46. freemius/languages/freemius-es_ES.mo +0 -0
  47. freemius/languages/freemius-fr_FR.mo +0 -0
  48. freemius/languages/freemius-he_IL.mo +0 -0
  49. freemius/languages/freemius-hu_HU.mo +0 -0
  50. freemius/languages/freemius-it_IT.mo +0 -0
  51. freemius/languages/freemius-ja.mo +0 -0
  52. freemius/languages/freemius-nl_NL.mo +0 -0
  53. freemius/languages/freemius-ru_RU.mo +0 -0
  54. freemius/languages/freemius-ta.mo +0 -0
  55. freemius/languages/freemius-zh_CN.mo +0 -0
  56. freemius/languages/freemius.pot +304 -272
  57. freemius/start.php +1 -1
  58. freemius/templates/account.php +23 -0
  59. freemius/templates/add-ons.php +0 -0
  60. freemius/templates/checkout.php +0 -0
  61. freemius/templates/connect.php +0 -0
  62. freemius/templates/contact.php +0 -0
  63. freemius/templates/firewall-issues-js.php +0 -0
  64. freemius/templates/forms/affiliation.php +2 -0
  65. freemius/templates/forms/deactivation/form.php +0 -0
  66. freemius/templates/powered-by.php +0 -0
  67. freemius/templates/sticky-admin-notice-js.php +0 -0
  68. includes/assets/img/menu-image-60.png +0 -0
  69. includes/assets/img/pro-badge-1.png +0 -0
  70. includes/assets/img/pro-badge-2.png +0 -0
  71. includes/assets/img/pro-badge-3.png +0 -0
  72. includes/assets/img/pro-button-1.png +0 -0
  73. includes/assets/img/pro-button-2.png +0 -0
  74. includes/css/menu-image-admin.css +423 -0
  75. includes/css/menu-image.css +54 -1
  76. includes/js/menu-image-admin.js +442 -25
  77. menu-image.php +1976 -1126
  78. readme.txt +43 -146
freemius/LICENSE.txt CHANGED
File without changes
freemius/README.md DELETED
@@ -1,282 +0,0 @@
1
- Freemius WordPress SDK
2
- ======================
3
-
4
- Welcome to the official repository for the Freemius SDK! Adding the SDK to your WordPress plugin, theme, or add-ons, enables all the benefits that come with using the [Freemius platform](https://freemius.com) such as:
5
-
6
- * [Software Licensing](https://freemius.com/wordpress/software-licensing/)
7
- * [Secure Checkout](https://freemius.com/wordpress/checkout/)
8
- * [Subscriptions](https://freemius.com/wordpress/recurring-payments-subscriptions/)
9
- * [Automatic Updates](https://freemius.com/wordpress/automatic-software-updates/)
10
- * [Seamless EU VAT](https://freemius.com/wordpress/collecting-eu-vat-europe/)
11
- * [Cart Abandonment Recovery](https://freemius.com/wordpress/cart-abandonment-recovery/)
12
- * [Affiliate Platform](https://freemius.com/wordpress/affiliate-platform/)
13
- * [Analytics & Usage Tracking](https://freemius.com/wordpress/insights/)
14
- * [User Dashboard](https://freemius.com/wordpress/user-dashboard/)
15
-
16
- * [Monetization](https://freemius.com/wordpress/)
17
- * [Analytics](https://freemius.com/wordpress/insights/)
18
- * [More...](https://freemius.com/wordpress/features-comparison/)
19
-
20
- Freemius truly empowers developers to create prosperous subscription-based businesses.
21
-
22
- If you're new to Freemius then we recommend taking a look at our [Getting Started](https://freemius.com/help/documentation/getting-started/) guide first.
23
-
24
- If you're a WordPress plugin or theme developer and are interested in monetizing with Freemius then you can [sign-up for a FREE account](https://dashboard.freemius.com/register/):
25
-
26
- https://dashboard.freemius.com/register/
27
-
28
- Once you have your account setup and are familiar with how it all works you're ready to begin [integrating Freemius](https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/) into your WordPress product
29
-
30
- You can see some of the existing WordPress.org plugins & themes that are already utilizing the power of Freemius here:
31
-
32
- * https://profiles.wordpress.org/freemius/#content-plugins
33
- * https://includewp.com/freemius/#focus
34
-
35
- ## Code Documentation
36
-
37
- You can find the SDK's documentation here:
38
- https://freemius.com/help/documentation/wordpress-sdk/
39
-
40
- ## Integrating & Initializing the SDK
41
-
42
- As part of the integration process, you'll need to [add the latest version](https://freemius.com/help/documentation/getting-started/#add_the_latest_wordpress_sdk_into_your_product) of the Freemius SDK into your WordPress project.
43
-
44
- Then, when you've completed the [SDK integration form](https://freemius.com/help/documentation/getting-started/#fill_out_the_sdk_integration_form) a snippet of code is generated which you'll need to copy and paste into the top of your main plugin's PHP file, right after the plugin's header comment.
45
-
46
- Note: For themes, this will be in the root `functions.php` file instead.
47
-
48
- A typical SDK snippet will look similar to the following (your particular snippet may differ slightly depending on your integration):
49
-
50
- ```php
51
- if ( ! function_exists( 'my_prefix_fs' ) ) {
52
- // Create a helper function for easy SDK access.
53
- function my_prefix_fs() {
54
- global $my_prefix_fs;
55
-
56
- if ( ! isset( $my_prefix_fs ) ) {
57
- // Include Freemius SDK.
58
- require_once dirname(__FILE__) . '/freemius/start.php';
59
-
60
- $my_prefix_fs = fs_dynamic_init( array(
61
- 'id' => '1234',
62
- 'slug' => 'my-new-plugin',
63
- 'premium_slug' => 'my-new-plugin-premium',
64
- 'type' => 'plugin',
65
- 'public_key' => 'pk_bAEfta69seKymZzmf2xtqq8QXHz9y',
66
- 'is_premium' => true,
67
- // If your plugin is a serviceware, set this option to false.
68
- 'has_premium_version' => true,
69
- 'has_paid_plans' => true,
70
- 'is_org_compliant' => true,
71
- 'menu' => array(
72
- 'slug' => 'my-new-plugin',
73
- 'parent' => array(
74
- 'slug' => 'options-general.php',
75
- ),
76
- ),
77
- // Set the SDK to work in a sandbox mode (for development & testing).
78
- // IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
79
- 'secret_key' => 'sk_ubb4yN3mzqGR2x8#P7r5&@*xC$utE',
80
- ) );
81
- }
82
-
83
- return $my_prefix_fs;
84
- }
85
-
86
- // Init Freemius.
87
- my_prefix_fs();
88
- // Signal that SDK was initiated.
89
- do_action( 'my_prefix_fs_loaded' );
90
- }
91
-
92
- ```
93
-
94
- ## Usage example
95
-
96
- You can call anySDK methods by prefixing them with the shortcode function for your particular plugin/theme (specified when completing the SDK integration form in the Developer Dashboard):
97
-
98
- ```php
99
- <?php my_prefix_fs()->get_upgrade_url(); ?>
100
- ```
101
-
102
- Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
103
-
104
- ```php
105
- <?php
106
- global $my_prefix_fs;
107
- $my_prefix_fs->get_account_url();
108
- ?>
109
- ```
110
-
111
- There are many other SDK methods available that you can use to enhance the functionality of your WordPress product. Some of the more common use-cases are covered in the [Freemius SDK Gists](https://freemius.com/help/documentation/wordpress-sdk/gists/) documentation.
112
-
113
- ## Adding license based logic examples
114
-
115
- Add marketing content to encourage your users to upgrade for your paid version:
116
-
117
- ```php
118
- <?php
119
- if ( my_prefix_fs()->is_not_paying() ) {
120
- echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
121
- echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
122
- esc_html__('Upgrade Now!', 'my-plugin-slug') .
123
- '</a>';
124
- echo '</section>';
125
- }
126
- ?>
127
- ```
128
-
129
- Add logic which will only be available in your premium plugin version:
130
-
131
- ```php
132
- <?php
133
- // This "if" block will be auto removed from the Free version.
134
- if ( my_prefix_fs()->is__premium_only() ) {
135
-
136
- // ... premium only logic ...
137
-
138
- }
139
- ?>
140
- ```
141
-
142
- To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
143
-
144
- ```php
145
- <?php
146
- class My_Plugin {
147
- function init() {
148
- ...
149
-
150
- // This "if" block will be auto removed from the free version.
151
- if ( my_prefix_fs()->is__premium_only() ) {
152
- // Init premium version.
153
- $this->admin_init__premium_only();
154
-
155
- add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
156
- }
157
-
158
- ...
159
- }
160
-
161
- // This method will be only included in the premium version.
162
- function admin_init__premium_only() {
163
- ...
164
- }
165
-
166
- // This method will be only included in the premium version.
167
- function admin_init_hook__premium_only() {
168
- ...
169
- }
170
- }
171
- ?>
172
- ```
173
-
174
- Add logic which will only be executed for customers in your 'professional' plan:
175
-
176
- ```php
177
- <?php
178
- if ( my_prefix_fs()->is_plan('professional', true) ) {
179
- // .. logic related to Professional plan only ...
180
- }
181
- ?>
182
- ```
183
-
184
- Add logic which will only be executed for customers in your 'professional' plan or higher plans:
185
-
186
- ```php
187
- <?php
188
- if ( my_prefix_fs()->is_plan('professional') ) {
189
- // ... logic related to Professional plan and higher plans ...
190
- }
191
- ?>
192
- ```
193
-
194
- Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
195
-
196
- ```php
197
- <?php
198
- // This "if" block will be auto removed from the Free version.
199
- if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
200
- // ... logic related to Professional plan and higher plans ...
201
- }
202
- ?>
203
- ```
204
-
205
- Add logic only for users in trial:
206
-
207
- ```php
208
- <?php
209
- if ( my_prefix_fs()->is_trial() ) {
210
- // ... logic for users in trial ...
211
- }
212
- ?>
213
- ```
214
-
215
- Add logic for specified paid plan:
216
-
217
- ```php
218
- <?php
219
- // This "if" block will be auto removed from the Free version.
220
- if ( my_prefix_fs()->is__premium_only() ) {
221
- if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
222
-
223
- // ... logic related to Professional plan only ...
224
-
225
- } else if ( my_prefix_fs()->is_plan( 'business' ) ) {
226
-
227
- // ... logic related to Business plan and higher plans ...
228
-
229
- }
230
- }
231
- ?>
232
- ```
233
-
234
- ## Excluding files and folders from the free plugin version
235
- There are [two ways](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/#excluding_files_and_folders_from_the_free_plugin_version) to exclude files from your free version.
236
-
237
- 1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all types of files, not only PHP.
238
- 2. Add `@fs_premium_only` a special meta tag to the plugin's main PHP file header. Example:
239
- ```php
240
- <?php
241
- /**
242
- * Plugin Name: My Very Awesome Plugin
243
- * Plugin URI: http://my-awesome-plugin.com
244
- * Description: Create and manage Awesomeness right in WordPress.
245
- * Version: 1.0.0
246
- * Author: Awesomattic
247
- * Author URI: http://my-awesome-plugin.com/me/
248
- * License: GPLv2
249
- * Text Domain: myplugin
250
- * Domain Path: /langs
251
- *
252
- * @fs_premium_only /lib/functions.php, /premium-files/
253
- */
254
-
255
- if ( ! defined( 'ABSPATH' ) ) {
256
- exit;
257
- }
258
-
259
- // ... my code ...
260
- ?>
261
- ```
262
- In the example plugin header above, the file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
263
-
264
- # WordPress.org Compliance
265
- Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
266
- > All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
267
-
268
- Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or use [some of the other methods](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/) provided by the SDK to exclude premium features & files from the free version.
269
-
270
- ## Deployment
271
- Zip your Freemius product’s root folder and [upload it in the Deployment section](https://freemius.com/help/documentation/selling-with-freemius/deployment/) in the *Freemius Developer's Dashboard*.
272
- The plugin/theme will automatically be scanned and processed by a custom-developed *PHP Processor* which will auto-generate two versions of your plugin:
273
-
274
- 1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
275
- 2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
276
-
277
- The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org compliant and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
278
-
279
- ## License
280
- Copyright (c) Freemius®, Inc.
281
-
282
- Licensed under the GNU general public license (version 3).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/css/admin/account.css CHANGED
@@ -1 +1 @@
1
- label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
1
+ label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.fs-notice[data-id="license_not_whitelabeled"].success,.fs-notice[data-id="license_whitelabeled"].success{color:inherit;border-left-color:#00a0d2}.fs-notice[data-id="license_not_whitelabeled"].success label.fs-plugin-title,.fs-notice[data-id="license_whitelabeled"].success label.fs-plugin-title{display:none}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
freemius/assets/css/admin/connect.css CHANGED
File without changes
freemius/assets/js/nojquery.ba-postmessage.js CHANGED
File without changes
freemius/assets/js/nojquery.ba-postmessage.min.js CHANGED
File without changes
freemius/assets/js/postmessage.js CHANGED
File without changes
freemius/config.php CHANGED
@@ -385,4 +385,7 @@
385
 
386
  if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
  define( 'WP_FS__DEMO_MODE', false );
388
- }
 
 
 
385
 
386
  if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
  define( 'WP_FS__DEMO_MODE', false );
388
+ }
389
+ if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
390
+ define( 'FS_SDK__SSLVERIFY', false );
391
+ }
freemius/includes/class-freemius-abstract.php CHANGED
File without changes
freemius/includes/class-freemius.php CHANGED
@@ -1674,6 +1674,7 @@
1674
  $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1675
  $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1676
  $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
 
1677
 
1678
  if ( $this->_is_network_active && fs_is_network_admin() ) {
1679
  $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
@@ -7736,7 +7737,10 @@
7736
  * @author Leo Fajardo (@leorw)
7737
  * @since 1.2.2
7738
  */
7739
- if ( is_plugin_active( $other_version_basename ) ) {
 
 
 
7740
  deactivate_plugins( $other_version_basename );
7741
  }
7742
  }
@@ -9021,12 +9025,25 @@
9021
  'is_uninstalled' => false,
9022
  );
9023
 
9024
- $plugins_update_data[] = $new_plugin;
9025
  $network_plugins_cache->plugins[ $basename ] = $new_plugin;
9026
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9027
  if ( isset( $site_active_plugins[ $basename ] ) ) {
9028
  $site_active_plugins_cache->plugins[ $basename ] = $new_plugin;
9029
- $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
9030
  }
9031
  }
9032
  }
@@ -13130,6 +13147,61 @@
13130
  }
13131
  }
13132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13133
  /**
13134
  * @author Leo Fajardo (@leorw)
13135
  * @since 2.3.0
@@ -20679,6 +20751,13 @@
20679
  }
20680
 
20681
  if ( 'none' !== $plan_change ) {
 
 
 
 
 
 
 
20682
  $this->do_action( 'after_license_change', $plan_change, $this->get_plan() );
20683
  }
20684
  }
@@ -22293,6 +22372,26 @@
22293
 
22294
  $this->_handle_account_edits();
22295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22296
  $this->do_action( 'account_page_load_before_departure' );
22297
  }
22298
 
@@ -23453,10 +23552,12 @@
23453
  * @since 1.0.3
23454
  */
23455
  function _redirect_on_activation_hook() {
23456
- $url = $this->get_after_plugin_activation_redirect_url();
 
23457
 
23458
- if ( is_string( $url ) ) {
23459
- fs_redirect( $url );
 
23460
  }
23461
  }
23462
 
1674
  $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1675
  $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1676
  $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
1677
+ $this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) );
1678
 
1679
  if ( $this->_is_network_active && fs_is_network_admin() ) {
1680
  $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
7737
  * @author Leo Fajardo (@leorw)
7738
  * @since 1.2.2
7739
  */
7740
+ if (
7741
+ is_plugin_active( $other_version_basename ) &&
7742
+ $this->apply_filters( 'deactivate_on_activation', true )
7743
+ ) {
7744
  deactivate_plugins( $other_version_basename );
7745
  }
7746
  }
9025
  'is_uninstalled' => false,
9026
  );
9027
 
 
9028
  $network_plugins_cache->plugins[ $basename ] = $new_plugin;
9029
 
9030
+ $is_site_level_active = (
9031
+ isset( $site_active_plugins[ $basename ] ) &&
9032
+ $site_active_plugins[ $basename ]['is_active']
9033
+ );
9034
+
9035
+ /**
9036
+ * If not network active, set the activity status based on the site-level plugin status.
9037
+ */
9038
+ if ( ! $new_plugin['is_active'] ) {
9039
+ $new_plugin['is_active'] = $is_site_level_active;
9040
+ }
9041
+
9042
+ $plugins_update_data[] = $new_plugin;
9043
+
9044
  if ( isset( $site_active_plugins[ $basename ] ) ) {
9045
  $site_active_plugins_cache->plugins[ $basename ] = $new_plugin;
9046
+ $site_active_plugins_cache->plugins[ $basename ]['is_active'] = $is_site_level_active;
9047
  }
9048
  }
9049
  }
13147
  }
13148
  }
13149
 
13150
+ /**
13151
+ * @author Edgar Melkonyan
13152
+ * @since 2.4.1
13153
+ *
13154
+ * @throws Freemius_Exception
13155
+ */
13156
+ function _toggle_whitelabel_mode_ajax_handler() {
13157
+ $this->_logger->entrance();
13158
+
13159
+ $this->check_ajax_referer( 'toggle_whitelabel_mode' );
13160
+
13161
+ if ( ! $this->is_user_admin() ) {
13162
+ // Only for admins.
13163
+ self::shoot_ajax_failure();
13164
+ }
13165
+
13166
+ $license = $this->get_api_user_scope()->call(
13167
+ "/licenses/{$this->_site->license_id}.json",
13168
+ 'put',
13169
+ array( 'is_whitelabeled' => ! $this->_license->is_whitelabeled )
13170
+ );
13171
+
13172
+ if ( ! $this->is_api_result_entity( $license ) ) {
13173
+ self::shoot_ajax_failure(
13174
+ FS_Api::is_api_error_object( $license ) ?
13175
+ $license->error->message :
13176
+ fs_text_inline( "An unknown error has occurred while trying to toggle the license's white-label mode.", 'unknown-error-occurred', $this->get_slug() )
13177
+ );
13178
+ }
13179
+
13180
+ $this->_license->is_whitelabeled = $license->is_whitelabeled;
13181
+ $this->_store_licenses();
13182
+
13183
+ $this->_sync_license();
13184
+
13185
+ if ( ! $license->is_whitelabeled ) {
13186
+ $this->_admin_notices->remove_sticky( 'license_whitelabeled' );
13187
+ } else {
13188
+ $this->_admin_notices->add_sticky(
13189
+ sprintf(
13190
+ $this->get_text_inline(
13191
+ 'Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s.',
13192
+ 'license_whitelabeled'
13193
+ ),
13194
+ "<strong>{$this->get_plugin_title()}</strong>",
13195
+ sprintf( '<a href="https://users.freemius.com" target="_blank">%s</a>', $this->get_text_inline( 'User Dashboard', 'user-dashboard' ) ),
13196
+ sprintf( '<a href="#" class="fs-toggle-whitelabel-mode">%s</a>', $this->get_text_inline( 'revert it now', 'revert-it-now' ) )
13197
+ ),
13198
+ 'license_whitelabeled'
13199
+ );
13200
+ }
13201
+
13202
+ self::shoot_ajax_response( array( 'success' => true ) );
13203
+ }
13204
+
13205
  /**
13206
  * @author Leo Fajardo (@leorw)
13207
  * @since 2.3.0
20751
  }
20752
 
20753
  if ( 'none' !== $plan_change ) {
20754
+ if (
20755
+ ! is_object( $this->_license ) ||
20756
+ ! $this->_license->is_whitelabeled
20757
+ ) {
20758
+ $this->_admin_notices->remove_sticky( 'license_whitelabeled' );
20759
+ }
20760
+
20761
  $this->do_action( 'after_license_change', $plan_change, $this->get_plan() );
20762
  }
20763
  }
22372
 
22373
  $this->_handle_account_edits();
22374
 
22375
+ if (
22376
+ is_object( $this->_license ) &&
22377
+ $this->_license->user_id == $this->_user->id &&
22378
+ ! $this->is_whitelabeled( true )
22379
+ ) {
22380
+ $this->_admin_notices->add(
22381
+ sprintf(
22382
+ $this->get_text_inline( "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin.", 'license_not_whitelabeled' ),
22383
+ sprintf(
22384
+ '<a href="#" class="fs-toggle-whitelabel-mode">%s</a>',
22385
+ $this->get_text_inline( 'Click here', 'click-here' )
22386
+ )
22387
+ ),
22388
+ '',
22389
+ 'success',
22390
+ false,
22391
+ 'license_not_whitelabeled'
22392
+ );
22393
+ }
22394
+
22395
  $this->do_action( 'account_page_load_before_departure' );
22396
  }
22397
 
23552
  * @since 1.0.3
23553
  */
23554
  function _redirect_on_activation_hook() {
23555
+ if ( $this->apply_filters( 'redirect_on_activation', true ) ) {
23556
+ $url = $this->get_after_plugin_activation_redirect_url();
23557
 
23558
+ if ( is_string( $url ) ) {
23559
+ fs_redirect( $url );
23560
+ }
23561
  }
23562
  }
23563
 
freemius/includes/class-fs-api.php CHANGED
File without changes
freemius/includes/class-fs-plugin-updater.php CHANGED
@@ -542,23 +542,66 @@
542
  }
543
  }
544
 
 
 
 
545
  if ( is_object( $this->_update_details ) ) {
 
 
 
 
546
  if ( ! isset( $transient_data->response ) ) {
547
  $transient_data->response = array();
548
  }
549
 
550
  // Add plugin to transient data.
551
- $transient_data->response[ $this->_fs->premium_plugin_basename() ] = $this->_fs->is_plugin() ?
552
  $this->_update_details :
553
  (array) $this->_update_details;
554
- } else if ( isset( $transient_data->response ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  /**
556
- * Ensure that there's no update data for the plugin to prevent upgrading the premium version to the latest free version.
557
  *
558
- * @author Leo Fajardo (@leorw)
559
- * @since 2.3.0
560
  */
561
- unset( $transient_data->response[ $this->_fs->premium_plugin_basename() ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  }
563
 
564
  $slug = $this->_fs->get_slug();
542
  }
543
  }
544
 
545
+ // Alias.
546
+ $basename = $this->_fs->premium_plugin_basename();
547
+
548
  if ( is_object( $this->_update_details ) ) {
549
+ if ( isset( $transient_data->no_update ) ) {
550
+ unset( $transient_data->no_update[ $basename ] );
551
+ }
552
+
553
  if ( ! isset( $transient_data->response ) ) {
554
  $transient_data->response = array();
555
  }
556
 
557
  // Add plugin to transient data.
558
+ $transient_data->response[ $basename ] = $this->_fs->is_plugin() ?
559
  $this->_update_details :
560
  (array) $this->_update_details;
561
+ } else {
562
+ if ( isset( $transient_data->response ) ) {
563
+ /**
564
+ * Ensure that there's no update data for the plugin to prevent upgrading the premium version to the latest free version.
565
+ *
566
+ * @author Leo Fajardo (@leorw)
567
+ * @since 2.3.0
568
+ */
569
+ unset( $transient_data->response[ $basename ] );
570
+ }
571
+
572
+ if ( ! isset( $transient_data->no_update ) ) {
573
+ $transient_data->no_update = array();
574
+ }
575
+
576
  /**
577
+ * Add product to no_update transient data to properly integrate with WP 5.5 auto-updates UI.
578
  *
579
+ * @since 2.4.1
580
+ * @link https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/
581
  */
582
+ $transient_data->no_update[ $basename ] = $this->_fs->is_plugin() ?
583
+ (object) array(
584
+ 'id' => $basename,
585
+ 'slug' => $this->_fs->get_slug(),
586
+ 'plugin' => $basename,
587
+ 'new_version' => $this->_fs->get_plugin_version(),
588
+ 'url' => '',
589
+ 'package' => '',
590
+ 'icons' => array(),
591
+ 'banners' => array(),
592
+ 'banners_rtl' => array(),
593
+ 'tested' => '',
594
+ 'requires_php' => '',
595
+ 'compatibility' => new stdClass(),
596
+ ) :
597
+ array(
598
+ 'theme' => $basename,
599
+ 'new_version' => $this->_fs->get_plugin_version(),
600
+ 'url' => '',
601
+ 'package' => '',
602
+ 'requires' => '',
603
+ 'requires_php' => '',
604
+ );
605
  }
606
 
607
  $slug = $this->_fs->get_slug();
freemius/includes/class-fs-security.php CHANGED
File without changes
freemius/includes/entities/class-fs-entity.php CHANGED
File without changes
freemius/includes/entities/class-fs-payment.php CHANGED
File without changes
freemius/includes/entities/class-fs-plugin-info.php CHANGED
File without changes
freemius/includes/entities/class-fs-plugin-license.php CHANGED
File without changes
freemius/includes/entities/class-fs-plugin-plan.php CHANGED
File without changes
freemius/includes/entities/class-fs-plugin-tag.php CHANGED
File without changes
freemius/includes/entities/class-fs-plugin.php CHANGED
File without changes
freemius/includes/entities/class-fs-pricing.php CHANGED
File without changes
freemius/includes/entities/class-fs-scope-entity.php CHANGED
File without changes
freemius/includes/entities/class-fs-site.php CHANGED
File without changes
freemius/includes/entities/class-fs-subscription.php CHANGED
File without changes
freemius/includes/entities/class-fs-user.php CHANGED
File without changes
freemius/includes/fs-core-functions.php CHANGED
File without changes
freemius/includes/fs-plugin-info-dialog.php CHANGED
@@ -260,14 +260,20 @@
260
  if ( $has_valid_blog_id ) {
261
  restore_current_blog();
262
  }
 
263
 
264
- if ( is_object( $fs_addon ) ) {
265
- $data->has_purchased_license = $fs_addon->has_active_valid_license();
266
- } else {
267
- $account_addons = $this->_fs->get_account_addons();
268
- if ( ! empty( $account_addons ) && in_array( $selected_addon->id, $account_addons ) ) {
269
- $data->has_purchased_license = true;
270
- }
 
 
 
 
 
271
  }
272
  }
273
 
@@ -577,7 +583,7 @@
577
 
578
  $has_installed_version = ( 'install' !== $this->status['status'] );
579
 
580
- if ( ! $api->has_paid_plan ) {
581
  /**
582
  * Free-only add-on.
583
  *
@@ -1203,7 +1209,7 @@
1203
 
1204
  $(document).ready(function () {
1205
  var $plan = $('.plugin-information-pricing .fs-plan[data-plan-id=<?php echo $plan->id ?>]');
1206
- $plan.find('input[type=radio]').live('click', function () {
1207
  _updateCtaUrl(
1208
  $plan.attr('data-plan-id'),
1209
  $(this).val(),
@@ -1635,4 +1641,4 @@
1635
  iframe_footer();
1636
  exit;
1637
  }
1638
- }
260
  if ( $has_valid_blog_id ) {
261
  restore_current_blog();
262
  }
263
+ }
264
 
265
+ /**
266
+ * Check if there's a purchased license in case the add-on can only be installed/downloaded as part of a purchased bundle.
267
+ *
268
+ * @author Leo Fajardo (@leorw)
269
+ * @since 2.4.1
270
+ */
271
+ if ( is_object( $fs_addon ) ) {
272
+ $data->has_purchased_license = $fs_addon->has_active_valid_license();
273
+ } else {
274
+ $account_addons = $this->_fs->get_account_addons();
275
+ if ( ! empty( $account_addons ) && in_array( $selected_addon->id, $account_addons ) ) {
276
+ $data->has_purchased_license = true;
277
  }
278
  }
279
 
583
 
584
  $has_installed_version = ( 'install' !== $this->status['status'] );
585
 
586
+ if ( ! $api->has_paid_plan && ! $api->has_purchased_license ) {
587
  /**
588
  * Free-only add-on.
589
  *
1209
 
1210
  $(document).ready(function () {
1211
  var $plan = $('.plugin-information-pricing .fs-plan[data-plan-id=<?php echo $plan->id ?>]');
1212
+ $plan.find('input[type=radio]').on('click', function () {
1213
  _updateCtaUrl(
1214
  $plan.attr('data-plan-id'),
1215
  $(this).val(),
1641
  iframe_footer();
1642
  exit;
1643
  }
1644
+ }
freemius/includes/i18n.php CHANGED
@@ -98,6 +98,8 @@
98
  'error' => _fs_text( 'Error' ),
99
  'failed-finding-main-path' => _fs_text( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.' ),
100
  'learn-more' => _fs_text( 'Learn more' ),
 
 
101
 
102
  #region Affiliation
103
  'affiliation' => _fs_text( 'Affiliation' ),
98
  'error' => _fs_text( 'Error' ),
99
  'failed-finding-main-path' => _fs_text( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.' ),
100
  'learn-more' => _fs_text( 'Learn more' ),
101
+ 'license_not_whitelabeled' => _fs_text( "Is this your client's site? %s if you wish to hide sensitive info like your billing address and invoices from the WP Admin."),
102
+ 'license_whitelabeled' => _fs_text( 'Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your billing address and invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s.'),
103
 
104
  #region Affiliation
105
  'affiliation' => _fs_text( 'Affiliation' ),
freemius/includes/managers/class-fs-cache-manager.php CHANGED
File without changes
freemius/includes/managers/class-fs-key-value-storage.php CHANGED
File without changes
freemius/includes/managers/class-fs-license-manager.php CHANGED
File without changes
freemius/includes/managers/class-fs-option-manager.php CHANGED
File without changes
freemius/includes/managers/class-fs-plan-manager.php CHANGED
File without changes
freemius/includes/managers/class-fs-plugin-manager.php CHANGED
File without changes
freemius/includes/sdk/Exceptions/ArgumentNotExistException.php CHANGED
File without changes
freemius/includes/sdk/Exceptions/EmptyArgumentException.php CHANGED
File without changes
freemius/includes/sdk/Exceptions/Exception.php CHANGED
File without changes
freemius/includes/sdk/Exceptions/InvalidArgumentException.php CHANGED
File without changes
freemius/includes/sdk/Exceptions/OAuthException.php CHANGED
File without changes
freemius/includes/sdk/FreemiusBase.php CHANGED
File without changes
freemius/includes/sdk/FreemiusWordPress.php CHANGED
@@ -59,6 +59,10 @@
59
  }
60
  }
61
 
 
 
 
 
62
  $curl_version = FS_SDK__HAS_CURL ?
63
  curl_version() :
64
  array( 'version' => '7.37' );
@@ -401,7 +405,7 @@
401
  }
402
 
403
  if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
404
- $pWPRemoteArgs['sslverify'] = false;
405
  }
406
 
407
  if ( false !== $pBeforeExecutionFunction &&
59
  }
60
  }
61
 
62
+ if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
63
+ define( 'FS_SDK__SSLVERIFY', false );
64
+ }
65
+
66
  $curl_version = FS_SDK__HAS_CURL ?
67
  curl_version() :
68
  array( 'version' => '7.37' );
405
  }
406
 
407
  if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
408
+ $pWPRemoteArgs['sslverify'] = FS_SDK__SSLVERIFY;
409
  }
410
 
411
  if ( false !== $pBeforeExecutionFunction &&
freemius/includes/sdk/LICENSE.txt CHANGED
File without changes
freemius/languages/freemius-cs_CZ.mo CHANGED
Binary file
freemius/languages/freemius-da_DK.mo CHANGED
Binary file
freemius/languages/freemius-en.mo CHANGED
Binary file
freemius/languages/freemius-es_ES.mo CHANGED
Binary file
freemius/languages/freemius-fr_FR.mo CHANGED
Binary file
freemius/languages/freemius-he_IL.mo CHANGED
Binary file
freemius/languages/freemius-hu_HU.mo CHANGED
Binary file
freemius/languages/freemius-it_IT.mo CHANGED
Binary file
freemius/languages/freemius-ja.mo CHANGED
Binary file
freemius/languages/freemius-nl_NL.mo CHANGED
Binary file
freemius/languages/freemius-ru_RU.mo CHANGED
Binary file
freemius/languages/freemius-ta.mo CHANGED
Binary file
freemius/languages/freemius-zh_CN.mo CHANGED
Binary file
freemius/languages/freemius.pot CHANGED
@@ -16,771 +16,795 @@ msgstr ""
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
- #: includes/class-freemius.php:1911, templates/account.php:910
20
  msgid "An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned."
21
  msgstr ""
22
 
23
- #: includes/class-freemius.php:1918
24
  msgid "Would you like to proceed with the update?"
25
  msgstr ""
26
 
27
- #: includes/class-freemius.php:2130
28
  msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
29
  msgstr ""
30
 
31
- #: includes/class-freemius.php:2132
32
  msgid "Error"
33
  msgstr ""
34
 
35
- #: includes/class-freemius.php:2532
36
  msgid "I found a better %s"
37
  msgstr ""
38
 
39
- #: includes/class-freemius.php:2534
40
  msgid "What's the %s's name?"
41
  msgstr ""
42
 
43
- #: includes/class-freemius.php:2540
44
  msgid "It's a temporary %s. I'm just debugging an issue."
45
  msgstr ""
46
 
47
- #: includes/class-freemius.php:2542
48
  msgid "Deactivation"
49
  msgstr ""
50
 
51
- #: includes/class-freemius.php:2543
52
  msgid "Theme Switch"
53
  msgstr ""
54
 
55
- #: includes/class-freemius.php:2552, templates/forms/resend-key.php:24, templates/forms/user-change.php:29
56
  msgid "Other"
57
  msgstr ""
58
 
59
- #: includes/class-freemius.php:2560
60
  msgid "I no longer need the %s"
61
  msgstr ""
62
 
63
- #: includes/class-freemius.php:2567
64
  msgid "I only needed the %s for a short period"
65
  msgstr ""
66
 
67
- #: includes/class-freemius.php:2573
68
  msgid "The %s broke my site"
69
  msgstr ""
70
 
71
- #: includes/class-freemius.php:2580
72
  msgid "The %s suddenly stopped working"
73
  msgstr ""
74
 
75
- #: includes/class-freemius.php:2590
76
  msgid "I can't pay for it anymore"
77
  msgstr ""
78
 
79
- #: includes/class-freemius.php:2592
80
  msgid "What price would you feel comfortable paying?"
81
  msgstr ""
82
 
83
- #: includes/class-freemius.php:2598
84
  msgid "I don't like to share my information with you"
85
  msgstr ""
86
 
87
- #: includes/class-freemius.php:2619
88
  msgid "The %s didn't work"
89
  msgstr ""
90
 
91
- #: includes/class-freemius.php:2629
92
  msgid "I couldn't understand how to make it work"
93
  msgstr ""
94
 
95
- #: includes/class-freemius.php:2637
96
  msgid "The %s is great, but I need specific feature that you don't support"
97
  msgstr ""
98
 
99
- #: includes/class-freemius.php:2639
100
  msgid "What feature?"
101
  msgstr ""
102
 
103
- #: includes/class-freemius.php:2643
104
  msgid "The %s is not working"
105
  msgstr ""
106
 
107
- #: includes/class-freemius.php:2645
108
  msgid "Kindly share what didn't work so we can fix it for future users..."
109
  msgstr ""
110
 
111
- #: includes/class-freemius.php:2649
112
  msgid "It's not what I was looking for"
113
  msgstr ""
114
 
115
- #: includes/class-freemius.php:2651
116
  msgid "What you've been looking for?"
117
  msgstr ""
118
 
119
- #: includes/class-freemius.php:2655
120
  msgid "The %s didn't work as expected"
121
  msgstr ""
122
 
123
- #: includes/class-freemius.php:2657
124
  msgid "What did you expect?"
125
  msgstr ""
126
 
127
- #: includes/class-freemius.php:3512, templates/debug.php:20
128
  msgid "Freemius Debug"
129
  msgstr ""
130
 
131
- #: includes/class-freemius.php:4264
132
  msgid "I don't know what is cURL or how to install it, help me!"
133
  msgstr ""
134
 
135
- #: includes/class-freemius.php:4266
136
  msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
137
  msgstr ""
138
 
139
- #: includes/class-freemius.php:4273
140
  msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
141
  msgstr ""
142
 
143
- #: includes/class-freemius.php:4378
144
  msgid "Yes - do your thing"
145
  msgstr ""
146
 
147
- #: includes/class-freemius.php:4383
148
  msgid "No - just deactivate"
149
  msgstr ""
150
 
151
- #: includes/class-freemius.php:4428, includes/class-freemius.php:4922, includes/class-freemius.php:6178, includes/class-freemius.php:13282, includes/class-freemius.php:14000, includes/class-freemius.php:17451, includes/class-freemius.php:17556, includes/class-freemius.php:17731, includes/class-freemius.php:19965, includes/class-freemius.php:20323, includes/class-freemius.php:20333, includes/class-freemius.php:20997, includes/class-freemius.php:21903, includes/class-freemius.php:22036, includes/class-freemius.php:22192, templates/add-ons.php:57
152
  msgctxt "exclamation"
153
  msgid "Oops"
154
  msgstr ""
155
 
156
- #: includes/class-freemius.php:4497
157
  msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
158
  msgstr ""
159
 
160
- #: includes/class-freemius.php:4919
161
  msgctxt "addonX cannot run without pluginY"
162
  msgid "%s cannot run without %s."
163
  msgstr ""
164
 
165
- #: includes/class-freemius.php:4920
166
  msgctxt "addonX cannot run..."
167
  msgid "%s cannot run without the plugin."
168
  msgstr ""
169
 
170
- #: includes/class-freemius.php:5119, includes/class-freemius.php:5144, includes/class-freemius.php:21068
171
  msgid "Unexpected API error. Please contact the %s's author with the following error."
172
  msgstr ""
173
 
174
- #: includes/class-freemius.php:5844
175
  msgid "Premium %s version was successfully activated."
176
  msgstr ""
177
 
178
- #: includes/class-freemius.php:5856, includes/class-freemius.php:7755
179
  msgctxt "Used to express elation, enthusiasm, or triumph (especially in electronic communication)."
180
  msgid "W00t"
181
  msgstr ""
182
 
183
- #: includes/class-freemius.php:5871
184
  msgid "You have a %s license."
185
  msgstr ""
186
 
187
- #: includes/class-freemius.php:5875, includes/class-freemius.php:16850, includes/class-freemius.php:16861, includes/class-freemius.php:20234, includes/class-freemius.php:20584, includes/class-freemius.php:20653, includes/class-freemius.php:20818
188
  msgctxt "interjection expressing joy or exuberance"
189
  msgid "Yee-haw"
190
  msgstr ""
191
 
192
- #: includes/class-freemius.php:6161
193
  msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
194
  msgstr ""
195
 
196
- #: includes/class-freemius.php:6165
197
  msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
198
  msgstr ""
199
 
200
- #: includes/class-freemius.php:6174, templates/add-ons.php:186, templates/account/partials/addon.php:381
201
  msgid "More information about %s"
202
  msgstr ""
203
 
204
- #: includes/class-freemius.php:6175
205
  msgid "Purchase License"
206
  msgstr ""
207
 
208
- #: includes/class-freemius.php:7114, templates/connect.php:171
209
  msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
210
  msgstr ""
211
 
212
- #: includes/class-freemius.php:7118
213
  msgid "start the trial"
214
  msgstr ""
215
 
216
- #: includes/class-freemius.php:7119, templates/connect.php:175
217
  msgid "complete the install"
218
  msgstr ""
219
 
220
- #: includes/class-freemius.php:7237
221
  msgid "You are just one step away - %s"
222
  msgstr ""
223
 
224
- #: includes/class-freemius.php:7240
225
  msgctxt "%s - plugin name. As complete \"PluginX\" activation now"
226
  msgid "Complete \"%s\" Activation Now"
227
  msgstr ""
228
 
229
- #: includes/class-freemius.php:7318
230
  msgid "We made a few tweaks to the %s, %s"
231
  msgstr ""
232
 
233
- #: includes/class-freemius.php:7322
234
  msgid "Opt in to make \"%s\" better!"
235
  msgstr ""
236
 
237
- #: includes/class-freemius.php:7754
238
  msgid "The upgrade of %s was successfully completed."
239
  msgstr ""
240
 
241
- #: includes/class-freemius.php:10223, includes/class-fs-plugin-updater.php:1044, includes/class-fs-plugin-updater.php:1239, includes/class-fs-plugin-updater.php:1246, templates/auto-installation.php:32
242
  msgid "Add-On"
243
  msgstr ""
244
 
245
- #: includes/class-freemius.php:10225, templates/account.php:392, templates/account.php:400, templates/debug.php:358, templates/debug.php:549
246
  msgid "Plugin"
247
  msgstr ""
248
 
249
- #: includes/class-freemius.php:10226, templates/account.php:393, templates/account.php:401, templates/debug.php:358, templates/debug.php:549, templates/forms/deactivation/form.php:71
250
  msgid "Theme"
251
  msgstr ""
252
 
253
- #: includes/class-freemius.php:13180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  msgid "An unknown error has occurred while trying to set the user's beta mode."
255
  msgstr ""
256
 
257
- #: includes/class-freemius.php:13253
258
  msgid "Invalid new user ID or email address."
259
  msgstr ""
260
 
261
- #: includes/class-freemius.php:13283, includes/class-freemius.php:22147
262
  msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
263
  msgstr ""
264
 
265
- #: includes/class-freemius.php:13284, includes/class-freemius.php:22148
266
  msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
267
  msgstr ""
268
 
269
- #: includes/class-freemius.php:13291, includes/class-freemius.php:22155
270
  msgid "Change Ownership"
271
  msgstr ""
272
 
273
- #: includes/class-freemius.php:13867
274
  msgid "Invalid site details collection."
275
  msgstr ""
276
 
277
- #: includes/class-freemius.php:13987
278
  msgid "We couldn't find your email address in the system, are you sure it's the right address?"
279
  msgstr ""
280
 
281
- #: includes/class-freemius.php:13989
282
  msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
283
  msgstr ""
284
 
285
- #: includes/class-freemius.php:14263
286
  msgid "Account is pending activation."
287
  msgstr ""
288
 
289
- #: includes/class-freemius.php:14375, templates/forms/premium-versions-upgrade-handler.php:47
290
  msgid "Buy a license now"
291
  msgstr ""
292
 
293
- #: includes/class-freemius.php:14387, templates/forms/premium-versions-upgrade-handler.php:46
294
  msgid "Renew your license now"
295
  msgstr ""
296
 
297
- #: includes/class-freemius.php:14391
298
  msgid "%s to access version %s security & feature updates, and support."
299
  msgstr ""
300
 
301
- #: includes/class-freemius.php:16832
302
  msgid "%s activation was successfully completed."
303
  msgstr ""
304
 
305
- #: includes/class-freemius.php:16846
306
  msgid "Your account was successfully activated with the %s plan."
307
  msgstr ""
308
 
309
- #: includes/class-freemius.php:16857, includes/class-freemius.php:20649
310
  msgid "Your trial has been successfully started."
311
  msgstr ""
312
 
313
- #: includes/class-freemius.php:17449, includes/class-freemius.php:17554, includes/class-freemius.php:17729
314
  msgid "Couldn't activate %s."
315
  msgstr ""
316
 
317
- #: includes/class-freemius.php:17450, includes/class-freemius.php:17555, includes/class-freemius.php:17730
318
  msgid "Please contact us with the following message:"
319
  msgstr ""
320
 
321
- #: includes/class-freemius.php:17551, templates/forms/data-debug-mode.php:162
322
  msgid "An unknown error has occurred."
323
  msgstr ""
324
 
325
- #: includes/class-freemius.php:18087, includes/class-freemius.php:23208
326
  msgid "Upgrade"
327
  msgstr ""
328
 
329
- #: includes/class-freemius.php:18093
330
  msgid "Start Trial"
331
  msgstr ""
332
 
333
- #: includes/class-freemius.php:18095
334
  msgid "Pricing"
335
  msgstr ""
336
 
337
- #: includes/class-freemius.php:18175, includes/class-freemius.php:18177
338
  msgid "Affiliation"
339
  msgstr ""
340
 
341
- #: includes/class-freemius.php:18205, includes/class-freemius.php:18207, templates/account.php:240, templates/debug.php:324
342
  msgid "Account"
343
  msgstr ""
344
 
345
- #: includes/class-freemius.php:18221, includes/class-freemius.php:18223, includes/customizer/class-fs-customizer-support-section.php:60
346
  msgid "Contact Us"
347
  msgstr ""
348
 
349
- #: includes/class-freemius.php:18234, includes/class-freemius.php:18236, includes/class-freemius.php:23222, templates/account.php:119, templates/account/partials/addon.php:44
350
  msgid "Add-Ons"
351
  msgstr ""
352
 
353
- #: includes/class-freemius.php:18270
354
  msgctxt "ASCII arrow left icon"
355
  msgid "&#x2190;"
356
  msgstr ""
357
 
358
- #: includes/class-freemius.php:18270
359
  msgctxt "ASCII arrow right icon"
360
  msgid "&#x27a4;"
361
  msgstr ""
362
 
363
- #: includes/class-freemius.php:18272, templates/pricing.php:109
364
  msgctxt "noun"
365
  msgid "Pricing"
366
  msgstr ""
367
 
368
- #: includes/class-freemius.php:18485, includes/customizer/class-fs-customizer-support-section.php:67
369
  msgid "Support Forum"
370
  msgstr ""
371
 
372
- #: includes/class-freemius.php:19459
373
  msgid "Your email has been successfully verified - you are AWESOME!"
374
  msgstr ""
375
 
376
- #: includes/class-freemius.php:19460
377
  msgctxt "a positive response"
378
  msgid "Right on"
379
  msgstr ""
380
 
381
- #: includes/class-freemius.php:19966
382
  msgid "seems like the key you entered doesn't match our records."
383
  msgstr ""
384
 
385
- #: includes/class-freemius.php:19990
386
  msgid "Debug mode was successfully enabled and will be automatically disabled in 60 min. You can also disable it earlier by clicking the \"Stop Debug\" link."
387
  msgstr ""
388
 
389
- #: includes/class-freemius.php:20225
390
  msgid "Your %s Add-on plan was successfully upgraded."
391
  msgstr ""
392
 
393
- #: includes/class-freemius.php:20227
394
  msgid "%s Add-on was successfully purchased."
395
  msgstr ""
396
 
397
- #: includes/class-freemius.php:20230
398
  msgid "Download the latest version"
399
  msgstr ""
400
 
401
- #: includes/class-freemius.php:20316
402
  msgid "Your server is blocking the access to Freemius' API, which is crucial for %1$s synchronization. Please contact your host to whitelist %2$s"
403
  msgstr ""
404
 
405
- #: includes/class-freemius.php:20322, includes/class-freemius.php:20332, includes/class-freemius.php:20777, includes/class-freemius.php:20866
406
  msgid "Error received from the server:"
407
  msgstr ""
408
 
409
- #: includes/class-freemius.php:20332
410
  msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
411
  msgstr ""
412
 
413
- #: includes/class-freemius.php:20546, includes/class-freemius.php:20782, includes/class-freemius.php:20837, includes/class-freemius.php:20944
414
  msgctxt "something somebody says when they are thinking about what you have just said."
415
  msgid "Hmm"
416
  msgstr ""
417
 
418
- #: includes/class-freemius.php:20559
419
  msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
420
  msgstr ""
421
 
422
- #: includes/class-freemius.php:20560, templates/account.php:121, templates/add-ons.php:250, templates/account/partials/addon.php:46
423
  msgctxt "trial period"
424
  msgid "Trial"
425
  msgstr ""
426
 
427
- #: includes/class-freemius.php:20565
428
  msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
429
  msgstr ""
430
 
431
- #: includes/class-freemius.php:20569, includes/class-freemius.php:20628
432
  msgid "Please contact us here"
433
  msgstr ""
434
 
435
- #: includes/class-freemius.php:20580
436
  msgid "Your plan was successfully activated."
437
  msgstr ""
438
 
439
- #: includes/class-freemius.php:20581
440
  msgid "Your plan was successfully upgraded."
441
  msgstr ""
442
 
443
- #: includes/class-freemius.php:20598
444
  msgid "Your plan was successfully changed to %s."
445
  msgstr ""
446
 
447
- #: includes/class-freemius.php:20614
448
  msgid "Your license has expired. You can still continue using the free %s forever."
449
  msgstr ""
450
 
451
- #: includes/class-freemius.php:20616
452
  msgid "Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
453
  msgstr ""
454
 
455
- #: includes/class-freemius.php:20624
456
  msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
457
  msgstr ""
458
 
459
- #: includes/class-freemius.php:20637
460
  msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
461
  msgstr ""
462
 
463
- #: includes/class-freemius.php:20663
464
  msgid "Your free trial has expired. You can still continue using all our free features."
465
  msgstr ""
466
 
467
- #: includes/class-freemius.php:20665
468
  msgid "Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
469
  msgstr ""
470
 
471
- #: includes/class-freemius.php:20773
472
  msgid "It looks like the license could not be activated."
473
  msgstr ""
474
 
475
- #: includes/class-freemius.php:20815
476
  msgid "Your license was successfully activated."
477
  msgstr ""
478
 
479
- #: includes/class-freemius.php:20841
480
  msgid "It looks like your site currently doesn't have an active license."
481
  msgstr ""
482
 
483
- #: includes/class-freemius.php:20865
484
  msgid "It looks like the license deactivation failed."
485
  msgstr ""
486
 
487
- #: includes/class-freemius.php:20894
488
  msgid "Your %s license was successfully deactivated."
489
  msgstr ""
490
 
491
- #: includes/class-freemius.php:20895
492
  msgid "Your license was successfully deactivated, you are back to the %s plan."
493
  msgstr ""
494
 
495
- #: includes/class-freemius.php:20898
496
  msgid "O.K"
497
  msgstr ""
498
 
499
- #: includes/class-freemius.php:20951
500
  msgid "Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes."
501
  msgstr ""
502
 
503
- #: includes/class-freemius.php:20960
504
  msgid "Your subscription was successfully cancelled. Your %s plan license will expire in %s."
505
  msgstr ""
506
 
507
- #: includes/class-freemius.php:21002
508
  msgid "You are already running the %s in a trial mode."
509
  msgstr ""
510
 
511
- #: includes/class-freemius.php:21013
512
  msgid "You already utilized a trial before."
513
  msgstr ""
514
 
515
- #: includes/class-freemius.php:21027
516
  msgid "Plan %s do not exist, therefore, can't start a trial."
517
  msgstr ""
518
 
519
- #: includes/class-freemius.php:21038
520
  msgid "Plan %s does not support a trial period."
521
  msgstr ""
522
 
523
- #: includes/class-freemius.php:21049
524
  msgid "None of the %s's plans supports a trial period."
525
  msgstr ""
526
 
527
- #: includes/class-freemius.php:21099
528
  msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
529
  msgstr ""
530
 
531
- #: includes/class-freemius.php:21135
532
  msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
533
  msgstr ""
534
 
535
- #: includes/class-freemius.php:21154
536
  msgid "Your %s free trial was successfully cancelled."
537
  msgstr ""
538
 
539
- #: includes/class-freemius.php:21470
540
  msgid "Version %s was released."
541
  msgstr ""
542
 
543
- #: includes/class-freemius.php:21470
544
  msgid "Please download %s."
545
  msgstr ""
546
 
547
- #: includes/class-freemius.php:21477
548
  msgid "the latest %s version here"
549
  msgstr ""
550
 
551
- #: includes/class-freemius.php:21482
552
  msgid "New"
553
  msgstr ""
554
 
555
- #: includes/class-freemius.php:21487
556
  msgid "Seems like you got the latest release."
557
  msgstr ""
558
 
559
- #: includes/class-freemius.php:21488
560
  msgid "You are all good!"
561
  msgstr ""
562
 
563
- #: includes/class-freemius.php:21791
564
  msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
565
  msgstr ""
566
 
567
- #: includes/class-freemius.php:21931
568
  msgid "Site successfully opted in."
569
  msgstr ""
570
 
571
- #: includes/class-freemius.php:21932, includes/class-freemius.php:22918
572
  msgid "Awesome"
573
  msgstr ""
574
 
575
- #: includes/class-freemius.php:21948, templates/forms/optout.php:41
576
  msgid "We appreciate your help in making the %s better by letting us track some usage data."
577
  msgstr ""
578
 
579
- #: includes/class-freemius.php:21949
580
  msgid "Thank you!"
581
  msgstr ""
582
 
583
- #: includes/class-freemius.php:21956
584
  msgid "We will no longer be sending any usage data of %s on %s to %s."
585
  msgstr ""
586
 
587
- #: includes/class-freemius.php:22114
588
  msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
589
  msgstr ""
590
 
591
- #: includes/class-freemius.php:22120
592
  msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
593
  msgstr ""
594
 
595
- #: includes/class-freemius.php:22125
596
  msgid "%s is the new owner of the account."
597
  msgstr ""
598
 
599
- #: includes/class-freemius.php:22127
600
  msgctxt "as congratulations"
601
  msgid "Congrats"
602
  msgstr ""
603
 
604
- #: includes/class-freemius.php:22163
605
  msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
606
  msgstr ""
607
 
608
- #: includes/class-freemius.php:22175
609
  msgid "Please provide your full name."
610
  msgstr ""
611
 
612
- #: includes/class-freemius.php:22180
613
  msgid "Your name was successfully updated."
614
  msgstr ""
615
 
616
- #: includes/class-freemius.php:22241
617
  msgid "You have successfully updated your %s."
618
  msgstr ""
619
 
620
- #: includes/class-freemius.php:22381
 
 
 
 
 
 
 
 
621
  msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
622
  msgstr ""
623
 
624
- #: includes/class-freemius.php:22382
625
  msgctxt "advance notice of something that will need attention."
626
  msgid "Heads up"
627
  msgstr ""
628
 
629
- #: includes/class-freemius.php:22958
630
  msgctxt "exclamation"
631
  msgid "Hey"
632
  msgstr ""
633
 
634
- #: includes/class-freemius.php:22958
635
  msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
636
  msgstr ""
637
 
638
- #: includes/class-freemius.php:22966
639
  msgid "No commitment for %s days - cancel anytime!"
640
  msgstr ""
641
 
642
- #: includes/class-freemius.php:22967
643
  msgid "No credit card required"
644
  msgstr ""
645
 
646
- #: includes/class-freemius.php:22974, templates/forms/trial-start.php:53
647
  msgctxt "call to action"
648
  msgid "Start free trial"
649
  msgstr ""
650
 
651
- #: includes/class-freemius.php:23051
652
  msgid "Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!"
653
  msgstr ""
654
 
655
- #: includes/class-freemius.php:23060
656
  msgid "Learn more"
657
  msgstr ""
658
 
659
- #: includes/class-freemius.php:23246, templates/account.php:556, templates/account.php:706, templates/connect.php:179, templates/connect.php:455, templates/forms/license-activation.php:27, templates/account/partials/addon.php:321
660
  msgid "Activate License"
661
  msgstr ""
662
 
663
- #: includes/class-freemius.php:23247, templates/account.php:650, templates/account.php:705, templates/account/partials/addon.php:322, templates/account/partials/site.php:271
664
  msgid "Change License"
665
  msgstr ""
666
 
667
- #: includes/class-freemius.php:23356, templates/account/partials/site.php:169
668
  msgid "Opt Out"
669
  msgstr ""
670
 
671
- #: includes/class-freemius.php:23358, includes/class-freemius.php:23364, templates/account/partials/site.php:49, templates/account/partials/site.php:169
672
  msgid "Opt In"
673
  msgstr ""
674
 
675
- #: includes/class-freemius.php:23592
676
  msgid " The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s"
677
  msgstr ""
678
 
679
- #: includes/class-freemius.php:23600
680
  msgid "Activate %s features"
681
  msgstr ""
682
 
683
- #: includes/class-freemius.php:23613
684
  msgid "Please follow these steps to complete the upgrade"
685
  msgstr ""
686
 
687
- #: includes/class-freemius.php:23617
688
  msgid "Download the latest %s version"
689
  msgstr ""
690
 
691
- #: includes/class-freemius.php:23621
692
  msgid "Upload and activate the downloaded version"
693
  msgstr ""
694
 
695
- #: includes/class-freemius.php:23623
696
  msgid "How to upload and activate?"
697
  msgstr ""
698
 
699
- #: includes/class-freemius.php:23757
700
  msgid "%sClick here%s to choose the sites where you'd like to activate the license on."
701
  msgstr ""
702
 
703
- #: includes/class-freemius.php:23926
704
  msgid "Auto installation only works for opted-in users."
705
  msgstr ""
706
 
707
- #: includes/class-freemius.php:23936, includes/class-freemius.php:23969, includes/class-fs-plugin-updater.php:1218, includes/class-fs-plugin-updater.php:1232
708
  msgid "Invalid module ID."
709
  msgstr ""
710
 
711
- #: includes/class-freemius.php:23945, includes/class-fs-plugin-updater.php:1254
712
  msgid "Premium version already active."
713
  msgstr ""
714
 
715
- #: includes/class-freemius.php:23952
716
  msgid "You do not have a valid license to access the premium version."
717
  msgstr ""
718
 
719
- #: includes/class-freemius.php:23959
720
  msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
721
  msgstr ""
722
 
723
- #: includes/class-freemius.php:23977, includes/class-fs-plugin-updater.php:1253
724
  msgid "Premium add-on version already installed."
725
  msgstr ""
726
 
727
- #: includes/class-freemius.php:24327
728
  msgid "View paid features"
729
  msgstr ""
730
 
731
- #: includes/class-freemius.php:24649
732
  msgid "Thank you so much for using %s and its add-ons!"
733
  msgstr ""
734
 
735
- #: includes/class-freemius.php:24650
736
  msgid "Thank you so much for using %s!"
737
  msgstr ""
738
 
739
- #: includes/class-freemius.php:24656
740
  msgid "You've already opted-in to our usage-tracking, which helps us keep improving the %s."
741
  msgstr ""
742
 
743
- #: includes/class-freemius.php:24660
744
  msgid "Thank you so much for using our products!"
745
  msgstr ""
746
 
747
- #: includes/class-freemius.php:24661
748
  msgid "You've already opted-in to our usage-tracking, which helps us keep improving them."
749
  msgstr ""
750
 
751
- #: includes/class-freemius.php:24680
752
  msgid "%s and its add-ons"
753
  msgstr ""
754
 
755
- #: includes/class-freemius.php:24689
756
  msgid "Products"
757
  msgstr ""
758
 
759
- #: includes/class-freemius.php:24696, templates/connect.php:280
760
  msgid "Yes"
761
  msgstr ""
762
 
763
- #: includes/class-freemius.php:24697, templates/connect.php:281
764
  msgid "send me security & feature updates, educational content and offers."
765
  msgstr ""
766
 
767
- #: includes/class-freemius.php:24698, templates/connect.php:286
768
  msgid "No"
769
  msgstr ""
770
 
771
- #: includes/class-freemius.php:24700, templates/connect.php:288
772
  msgid "do %sNOT%s send me security & feature updates, educational content and offers."
773
  msgstr ""
774
 
775
- #: includes/class-freemius.php:24710
776
  msgid "Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)"
777
  msgstr ""
778
 
779
- #: includes/class-freemius.php:24712, templates/connect.php:295
780
  msgid "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:"
781
  msgstr ""
782
 
783
- #: includes/class-freemius.php:24994
784
  msgid "License key is empty."
785
  msgstr ""
786
 
@@ -808,314 +832,314 @@ msgstr ""
808
  msgid "Important Upgrade Notice:"
809
  msgstr ""
810
 
811
- #: includes/class-fs-plugin-updater.php:1283
812
  msgid "Installing plugin: %s"
813
  msgstr ""
814
 
815
- #: includes/class-fs-plugin-updater.php:1324
816
  msgid "Unable to connect to the filesystem. Please confirm your credentials."
817
  msgstr ""
818
 
819
- #: includes/class-fs-plugin-updater.php:1506
820
  msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
821
  msgstr ""
822
 
823
- #: includes/fs-plugin-info-dialog.php:535
824
  msgid "Purchase More"
825
  msgstr ""
826
 
827
- #: includes/fs-plugin-info-dialog.php:536, templates/account/partials/addon.php:385
828
  msgctxt "verb"
829
  msgid "Purchase"
830
  msgstr ""
831
 
832
- #: includes/fs-plugin-info-dialog.php:540
833
  msgid "Start my free %s"
834
  msgstr ""
835
 
836
- #: includes/fs-plugin-info-dialog.php:738
837
  msgid "Install Free Version Update Now"
838
  msgstr ""
839
 
840
- #: includes/fs-plugin-info-dialog.php:739, templates/account.php:639
841
  msgid "Install Update Now"
842
  msgstr ""
843
 
844
- #: includes/fs-plugin-info-dialog.php:748
845
  msgid "Install Free Version Now"
846
  msgstr ""
847
 
848
- #: includes/fs-plugin-info-dialog.php:749, templates/add-ons.php:323, templates/auto-installation.php:111, templates/account/partials/addon.php:365, templates/account/partials/addon.php:418
849
  msgid "Install Now"
850
  msgstr ""
851
 
852
- #: includes/fs-plugin-info-dialog.php:765
853
  msgctxt "as download latest version"
854
  msgid "Download Latest Free Version"
855
  msgstr ""
856
 
857
- #: includes/fs-plugin-info-dialog.php:766, templates/account.php:99, templates/add-ons.php:37, templates/account/partials/addon.php:25
858
  msgctxt "as download latest version"
859
  msgid "Download Latest"
860
  msgstr ""
861
 
862
- #: includes/fs-plugin-info-dialog.php:781, templates/add-ons.php:329, templates/account/partials/addon.php:356, templates/account/partials/addon.php:412
863
  msgid "Activate this add-on"
864
  msgstr ""
865
 
866
- #: includes/fs-plugin-info-dialog.php:783, templates/connect.php:452
867
  msgid "Activate Free Version"
868
  msgstr ""
869
 
870
- #: includes/fs-plugin-info-dialog.php:784, templates/account.php:123, templates/add-ons.php:330, templates/account/partials/addon.php:48
871
  msgid "Activate"
872
  msgstr ""
873
 
874
- #: includes/fs-plugin-info-dialog.php:996
875
  msgctxt "Plugin installer section title"
876
  msgid "Description"
877
  msgstr ""
878
 
879
- #: includes/fs-plugin-info-dialog.php:997
880
  msgctxt "Plugin installer section title"
881
  msgid "Installation"
882
  msgstr ""
883
 
884
- #: includes/fs-plugin-info-dialog.php:998
885
  msgctxt "Plugin installer section title"
886
  msgid "FAQ"
887
  msgstr ""
888
 
889
- #: includes/fs-plugin-info-dialog.php:999, templates/plugin-info/description.php:55
890
  msgid "Screenshots"
891
  msgstr ""
892
 
893
- #: includes/fs-plugin-info-dialog.php:1000
894
  msgctxt "Plugin installer section title"
895
  msgid "Changelog"
896
  msgstr ""
897
 
898
- #: includes/fs-plugin-info-dialog.php:1001
899
  msgctxt "Plugin installer section title"
900
  msgid "Reviews"
901
  msgstr ""
902
 
903
- #: includes/fs-plugin-info-dialog.php:1002
904
  msgctxt "Plugin installer section title"
905
  msgid "Other Notes"
906
  msgstr ""
907
 
908
- #: includes/fs-plugin-info-dialog.php:1017
909
  msgctxt "Plugin installer section title"
910
  msgid "Features & Pricing"
911
  msgstr ""
912
 
913
- #: includes/fs-plugin-info-dialog.php:1027
914
  msgid "Plugin Install"
915
  msgstr ""
916
 
917
- #: includes/fs-plugin-info-dialog.php:1099
918
  msgctxt "e.g. Professional Plan"
919
  msgid "%s Plan"
920
  msgstr ""
921
 
922
- #: includes/fs-plugin-info-dialog.php:1125
923
  msgctxt "e.g. the best product"
924
  msgid "Best"
925
  msgstr ""
926
 
927
- #: includes/fs-plugin-info-dialog.php:1131, includes/fs-plugin-info-dialog.php:1151
928
  msgctxt "as every month"
929
  msgid "Monthly"
930
  msgstr ""
931
 
932
- #: includes/fs-plugin-info-dialog.php:1134
933
  msgctxt "as once a year"
934
  msgid "Annual"
935
  msgstr ""
936
 
937
- #: includes/fs-plugin-info-dialog.php:1137
938
  msgid "Lifetime"
939
  msgstr ""
940
 
941
- #: includes/fs-plugin-info-dialog.php:1151, includes/fs-plugin-info-dialog.php:1153, includes/fs-plugin-info-dialog.php:1155
942
  msgctxt "e.g. billed monthly"
943
  msgid "Billed %s"
944
  msgstr ""
945
 
946
- #: includes/fs-plugin-info-dialog.php:1153
947
  msgctxt "as once a year"
948
  msgid "Annually"
949
  msgstr ""
950
 
951
- #: includes/fs-plugin-info-dialog.php:1155
952
  msgctxt "as once a year"
953
  msgid "Once"
954
  msgstr ""
955
 
956
- #: includes/fs-plugin-info-dialog.php:1161
957
  msgid "Single Site License"
958
  msgstr ""
959
 
960
- #: includes/fs-plugin-info-dialog.php:1163
961
  msgid "Unlimited Licenses"
962
  msgstr ""
963
 
964
- #: includes/fs-plugin-info-dialog.php:1165
965
  msgid "Up to %s Sites"
966
  msgstr ""
967
 
968
- #: includes/fs-plugin-info-dialog.php:1175, templates/plugin-info/features.php:82
969
  msgctxt "as monthly period"
970
  msgid "mo"
971
  msgstr ""
972
 
973
- #: includes/fs-plugin-info-dialog.php:1182, templates/plugin-info/features.php:80
974
  msgctxt "as annual period"
975
  msgid "year"
976
  msgstr ""
977
 
978
- #: includes/fs-plugin-info-dialog.php:1236
979
  msgctxt "noun"
980
  msgid "Price"
981
  msgstr ""
982
 
983
- #: includes/fs-plugin-info-dialog.php:1284
984
  msgid "Save %s"
985
  msgstr ""
986
 
987
- #: includes/fs-plugin-info-dialog.php:1294
988
  msgid "No commitment for %s - cancel anytime"
989
  msgstr ""
990
 
991
- #: includes/fs-plugin-info-dialog.php:1297
992
  msgid "After your free %s, pay as little as %s"
993
  msgstr ""
994
 
995
- #: includes/fs-plugin-info-dialog.php:1308
996
  msgid "Details"
997
  msgstr ""
998
 
999
- #: includes/fs-plugin-info-dialog.php:1312, templates/account.php:110, templates/debug.php:201, templates/debug.php:238, templates/debug.php:455, templates/account/partials/addon.php:36
1000
  msgctxt "product version"
1001
  msgid "Version"
1002
  msgstr ""
1003
 
1004
- #: includes/fs-plugin-info-dialog.php:1319
1005
  msgctxt "as the plugin author"
1006
  msgid "Author"
1007
  msgstr ""
1008
 
1009
- #: includes/fs-plugin-info-dialog.php:1326
1010
  msgid "Last Updated"
1011
  msgstr ""
1012
 
1013
- #: includes/fs-plugin-info-dialog.php:1331, templates/account.php:525
1014
  msgctxt "x-ago"
1015
  msgid "%s ago"
1016
  msgstr ""
1017
 
1018
- #: includes/fs-plugin-info-dialog.php:1340
1019
  msgid "Requires WordPress Version"
1020
  msgstr ""
1021
 
1022
- #: includes/fs-plugin-info-dialog.php:1341
1023
  msgid "%s or higher"
1024
  msgstr ""
1025
 
1026
- #: includes/fs-plugin-info-dialog.php:1348
1027
  msgid "Compatible up to"
1028
  msgstr ""
1029
 
1030
- #: includes/fs-plugin-info-dialog.php:1356
1031
  msgid "Downloaded"
1032
  msgstr ""
1033
 
1034
- #: includes/fs-plugin-info-dialog.php:1360
1035
  msgid "%s time"
1036
  msgstr ""
1037
 
1038
- #: includes/fs-plugin-info-dialog.php:1362
1039
  msgid "%s times"
1040
  msgstr ""
1041
 
1042
- #: includes/fs-plugin-info-dialog.php:1373
1043
  msgid "WordPress.org Plugin Page"
1044
  msgstr ""
1045
 
1046
- #: includes/fs-plugin-info-dialog.php:1382
1047
  msgid "Plugin Homepage"
1048
  msgstr ""
1049
 
1050
- #: includes/fs-plugin-info-dialog.php:1391, includes/fs-plugin-info-dialog.php:1475
1051
  msgid "Donate to this plugin"
1052
  msgstr ""
1053
 
1054
- #: includes/fs-plugin-info-dialog.php:1398
1055
  msgid "Average Rating"
1056
  msgstr ""
1057
 
1058
- #: includes/fs-plugin-info-dialog.php:1405
1059
  msgid "based on %s"
1060
  msgstr ""
1061
 
1062
- #: includes/fs-plugin-info-dialog.php:1409
1063
  msgid "%s rating"
1064
  msgstr ""
1065
 
1066
- #: includes/fs-plugin-info-dialog.php:1411
1067
  msgid "%s ratings"
1068
  msgstr ""
1069
 
1070
- #: includes/fs-plugin-info-dialog.php:1426
1071
  msgid "%s star"
1072
  msgstr ""
1073
 
1074
- #: includes/fs-plugin-info-dialog.php:1428
1075
  msgid "%s stars"
1076
  msgstr ""
1077
 
1078
- #: includes/fs-plugin-info-dialog.php:1440
1079
  msgid "Click to see reviews that provided a rating of %s"
1080
  msgstr ""
1081
 
1082
- #: includes/fs-plugin-info-dialog.php:1453
1083
  msgid "Contributors"
1084
  msgstr ""
1085
 
1086
- #: includes/fs-plugin-info-dialog.php:1483, includes/fs-plugin-info-dialog.php:1485
1087
  msgid "Warning"
1088
  msgstr ""
1089
 
1090
- #: includes/fs-plugin-info-dialog.php:1483
1091
  msgid "This plugin has not been tested with your current version of WordPress."
1092
  msgstr ""
1093
 
1094
- #: includes/fs-plugin-info-dialog.php:1485
1095
  msgid "This plugin has not been marked as compatible with your version of WordPress."
1096
  msgstr ""
1097
 
1098
- #: includes/fs-plugin-info-dialog.php:1504
1099
  msgid "Paid add-on must be deployed to Freemius."
1100
  msgstr ""
1101
 
1102
- #: includes/fs-plugin-info-dialog.php:1505
1103
  msgid "Add-on must be deployed to WordPress.org or Freemius."
1104
  msgstr ""
1105
 
1106
- #: includes/fs-plugin-info-dialog.php:1526
1107
  msgid "Newer Version (%s) Installed"
1108
  msgstr ""
1109
 
1110
- #: includes/fs-plugin-info-dialog.php:1527
1111
  msgid "Newer Free Version (%s) Installed"
1112
  msgstr ""
1113
 
1114
- #: includes/fs-plugin-info-dialog.php:1534
1115
  msgid "Latest Version Installed"
1116
  msgstr ""
1117
 
1118
- #: includes/fs-plugin-info-dialog.php:1535
1119
  msgid "Latest Free Version Installed"
1120
  msgstr ""
1121
 
@@ -1401,6 +1425,14 @@ msgstr ""
1401
  msgid "Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?"
1402
  msgstr ""
1403
 
 
 
 
 
 
 
 
 
1404
  #: templates/add-ons.php:38
1405
  msgid "View details"
1406
  msgstr ""
@@ -1530,7 +1562,7 @@ msgstr ""
1530
  msgid "Can't find your license key?"
1531
  msgstr ""
1532
 
1533
- #: templates/connect.php:323, templates/connect.php:694, templates/forms/deactivation/retry-skip.php:20
1534
  msgctxt "verb"
1535
  msgid "Skip"
1536
  msgstr ""
@@ -1587,40 +1619,40 @@ msgstr ""
1587
  msgid "Title, slug, version, and is active"
1588
  msgstr ""
1589
 
1590
- #: templates/connect.php:420, templates/forms/license-activation.php:41
1591
  msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
1592
  msgstr ""
1593
 
1594
- #: templates/connect.php:425
1595
  msgid "What permissions are being granted?"
1596
  msgstr ""
1597
 
1598
- #: templates/connect.php:451
1599
  msgid "Don't have a license key?"
1600
  msgstr ""
1601
 
1602
- #: templates/connect.php:454
1603
  msgid "Have a license key?"
1604
  msgstr ""
1605
 
1606
- #: templates/connect.php:462
1607
  msgid "Privacy Policy"
1608
  msgstr ""
1609
 
1610
- #: templates/connect.php:464
1611
  msgid "License Agreement"
1612
  msgstr ""
1613
 
1614
- #: templates/connect.php:464
1615
  msgid "Terms of Service"
1616
  msgstr ""
1617
 
1618
- #: templates/connect.php:853
1619
  msgctxt "as in the process of sending an email"
1620
  msgid "Sending email"
1621
  msgstr ""
1622
 
1623
- #: templates/connect.php:854
1624
  msgctxt "as activating plugin"
1625
  msgid "Activating"
1626
  msgstr ""
@@ -2177,11 +2209,11 @@ msgstr ""
2177
  msgid "Please provide details on how you intend to promote %s (please be as specific as possible)."
2178
  msgstr ""
2179
 
2180
- #: templates/forms/affiliation.php:230, templates/forms/resend-key.php:22
2181
  msgid "Cancel"
2182
  msgstr ""
2183
 
2184
- #: templates/forms/affiliation.php:232
2185
  msgid "Become an affiliate"
2186
  msgstr ""
2187
 
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
+ #: includes/class-freemius.php:1912, templates/account.php:910
20
  msgid "An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned."
21
  msgstr ""
22
 
23
+ #: includes/class-freemius.php:1919
24
  msgid "Would you like to proceed with the update?"
25
  msgstr ""
26
 
27
+ #: includes/class-freemius.php:2131
28
  msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
29
  msgstr ""
30
 
31
+ #: includes/class-freemius.php:2133
32
  msgid "Error"
33
  msgstr ""
34
 
35
+ #: includes/class-freemius.php:2533
36
  msgid "I found a better %s"
37
  msgstr ""
38
 
39
+ #: includes/class-freemius.php:2535
40
  msgid "What's the %s's name?"
41
  msgstr ""
42
 
43
+ #: includes/class-freemius.php:2541
44
  msgid "It's a temporary %s. I'm just debugging an issue."
45
  msgstr ""
46
 
47
+ #: includes/class-freemius.php:2543
48
  msgid "Deactivation"
49
  msgstr ""
50
 
51
+ #: includes/class-freemius.php:2544
52
  msgid "Theme Switch"
53
  msgstr ""
54
 
55
+ #: includes/class-freemius.php:2553, templates/forms/resend-key.php:24, templates/forms/user-change.php:29
56
  msgid "Other"
57
  msgstr ""
58
 
59
+ #: includes/class-freemius.php:2561
60
  msgid "I no longer need the %s"
61
  msgstr ""
62
 
63
+ #: includes/class-freemius.php:2568
64
  msgid "I only needed the %s for a short period"
65
  msgstr ""
66
 
67
+ #: includes/class-freemius.php:2574
68
  msgid "The %s broke my site"
69
  msgstr ""
70
 
71
+ #: includes/class-freemius.php:2581
72
  msgid "The %s suddenly stopped working"
73
  msgstr ""
74
 
75
+ #: includes/class-freemius.php:2591
76
  msgid "I can't pay for it anymore"
77
  msgstr ""
78
 
79
+ #: includes/class-freemius.php:2593
80
  msgid "What price would you feel comfortable paying?"
81
  msgstr ""
82
 
83
+ #: includes/class-freemius.php:2599
84
  msgid "I don't like to share my information with you"
85
  msgstr ""
86
 
87
+ #: includes/class-freemius.php:2620
88
  msgid "The %s didn't work"
89
  msgstr ""
90
 
91
+ #: includes/class-freemius.php:2630
92
  msgid "I couldn't understand how to make it work"
93
  msgstr ""
94
 
95
+ #: includes/class-freemius.php:2638
96
  msgid "The %s is great, but I need specific feature that you don't support"
97
  msgstr ""
98
 
99
+ #: includes/class-freemius.php:2640
100
  msgid "What feature?"
101
  msgstr ""
102
 
103
+ #: includes/class-freemius.php:2644
104
  msgid "The %s is not working"
105
  msgstr ""
106
 
107
+ #: includes/class-freemius.php:2646
108
  msgid "Kindly share what didn't work so we can fix it for future users..."
109
  msgstr ""
110
 
111
+ #: includes/class-freemius.php:2650
112
  msgid "It's not what I was looking for"
113
  msgstr ""
114
 
115
+ #: includes/class-freemius.php:2652
116
  msgid "What you've been looking for?"
117
  msgstr ""
118
 
119
+ #: includes/class-freemius.php:2656
120
  msgid "The %s didn't work as expected"
121
  msgstr ""
122
 
123
+ #: includes/class-freemius.php:2658
124
  msgid "What did you expect?"
125
  msgstr ""
126
 
127
+ #: includes/class-freemius.php:3513, templates/debug.php:20
128
  msgid "Freemius Debug"
129
  msgstr ""
130
 
131
+ #: includes/class-freemius.php:4265
132
  msgid "I don't know what is cURL or how to install it, help me!"
133
  msgstr ""
134
 
135
+ #: includes/class-freemius.php:4267
136
  msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
137
  msgstr ""
138
 
139
+ #: includes/class-freemius.php:4274
140
  msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
141
  msgstr ""
142
 
143
+ #: includes/class-freemius.php:4379
144
  msgid "Yes - do your thing"
145
  msgstr ""
146
 
147
+ #: includes/class-freemius.php:4384
148
  msgid "No - just deactivate"
149
  msgstr ""
150
 
151
+ #: includes/class-freemius.php:4429, includes/class-freemius.php:4923, includes/class-freemius.php:6182, includes/class-freemius.php:13357, includes/class-freemius.php:14075, includes/class-freemius.php:17526, includes/class-freemius.php:17631, includes/class-freemius.php:17806, includes/class-freemius.php:20040, includes/class-freemius.php:20398, includes/class-freemius.php:20408, includes/class-freemius.php:21079, includes/class-freemius.php:21985, includes/class-freemius.php:22118, includes/class-freemius.php:22274, templates/add-ons.php:57
152
  msgctxt "exclamation"
153
  msgid "Oops"
154
  msgstr ""
155
 
156
+ #: includes/class-freemius.php:4498
157
  msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
158
  msgstr ""
159
 
160
+ #: includes/class-freemius.php:4920
161
  msgctxt "addonX cannot run without pluginY"
162
  msgid "%s cannot run without %s."
163
  msgstr ""
164
 
165
+ #: includes/class-freemius.php:4921
166
  msgctxt "addonX cannot run..."
167
  msgid "%s cannot run without the plugin."
168
  msgstr ""
169
 
170
+ #: includes/class-freemius.php:5120, includes/class-freemius.php:5145, includes/class-freemius.php:21150
171
  msgid "Unexpected API error. Please contact the %s's author with the following error."
172
  msgstr ""
173
 
174
+ #: includes/class-freemius.php:5848
175
  msgid "Premium %s version was successfully activated."
176
  msgstr ""
177
 
178
+ #: includes/class-freemius.php:5860, includes/class-freemius.php:7762
179
  msgctxt "Used to express elation, enthusiasm, or triumph (especially in electronic communication)."
180
  msgid "W00t"
181
  msgstr ""
182
 
183
+ #: includes/class-freemius.php:5875
184
  msgid "You have a %s license."
185
  msgstr ""
186
 
187
+ #: includes/class-freemius.php:5879, includes/class-freemius.php:16925, includes/class-freemius.php:16936, includes/class-freemius.php:20309, includes/class-freemius.php:20659, includes/class-freemius.php:20728, includes/class-freemius.php:20900
188
  msgctxt "interjection expressing joy or exuberance"
189
  msgid "Yee-haw"
190
  msgstr ""
191
 
192
+ #: includes/class-freemius.php:6165
193
  msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
194
  msgstr ""
195
 
196
+ #: includes/class-freemius.php:6169
197
  msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
198
  msgstr ""
199
 
200
+ #: includes/class-freemius.php:6178, templates/add-ons.php:186, templates/account/partials/addon.php:381
201
  msgid "More information about %s"
202
  msgstr ""
203
 
204
+ #: includes/class-freemius.php:6179
205
  msgid "Purchase License"
206
  msgstr ""
207
 
208
+ #: includes/class-freemius.php:7118, templates/connect.php:171
209
  msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
210
  msgstr ""
211
 
212
+ #: includes/class-freemius.php:7122
213
  msgid "start the trial"
214
  msgstr ""
215
 
216
+ #: includes/class-freemius.php:7123, templates/connect.php:175
217
  msgid "complete the install"
218
  msgstr ""
219
 
220
+ #: includes/class-freemius.php:7241
221
  msgid "You are just one step away - %s"
222
  msgstr ""
223
 
224
+ #: includes/class-freemius.php:7244
225
  msgctxt "%s - plugin name. As complete \"PluginX\" activation now"
226
  msgid "Complete \"%s\" Activation Now"
227
  msgstr ""
228
 
229
+ #: includes/class-freemius.php:7322
230
  msgid "We made a few tweaks to the %s, %s"
231
  msgstr ""
232
 
233
+ #: includes/class-freemius.php:7326
234
  msgid "Opt in to make \"%s\" better!"
235
  msgstr ""
236
 
237
+ #: includes/class-freemius.php:7761
238
  msgid "The upgrade of %s was successfully completed."
239
  msgstr ""
240
 
241
+ #: includes/class-freemius.php:10243, includes/class-fs-plugin-updater.php:1099, includes/class-fs-plugin-updater.php:1294, includes/class-fs-plugin-updater.php:1301, templates/auto-installation.php:32
242
  msgid "Add-On"
243
  msgstr ""
244
 
245
+ #: includes/class-freemius.php:10245, templates/account.php:392, templates/account.php:400, templates/debug.php:358, templates/debug.php:549
246
  msgid "Plugin"
247
  msgstr ""
248
 
249
+ #: includes/class-freemius.php:10246, templates/account.php:393, templates/account.php:401, templates/debug.php:358, templates/debug.php:549, templates/forms/deactivation/form.php:71
250
  msgid "Theme"
251
  msgstr ""
252
 
253
+ #: includes/class-freemius.php:13176
254
+ msgid "An unknown error has occurred while trying to toggle the license's white-label mode."
255
+ msgstr ""
256
+
257
+ #: includes/class-freemius.php:13190
258
+ msgid "Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s."
259
+ msgstr ""
260
+
261
+ #: includes/class-freemius.php:13195
262
+ msgid "User Dashboard"
263
+ msgstr ""
264
+
265
+ #: includes/class-freemius.php:13196
266
+ msgid "revert it now"
267
+ msgstr ""
268
+
269
+ #: includes/class-freemius.php:13255
270
  msgid "An unknown error has occurred while trying to set the user's beta mode."
271
  msgstr ""
272
 
273
+ #: includes/class-freemius.php:13328
274
  msgid "Invalid new user ID or email address."
275
  msgstr ""
276
 
277
+ #: includes/class-freemius.php:13358, includes/class-freemius.php:22229
278
  msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
279
  msgstr ""
280
 
281
+ #: includes/class-freemius.php:13359, includes/class-freemius.php:22230
282
  msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
283
  msgstr ""
284
 
285
+ #: includes/class-freemius.php:13366, includes/class-freemius.php:22237
286
  msgid "Change Ownership"
287
  msgstr ""
288
 
289
+ #: includes/class-freemius.php:13942
290
  msgid "Invalid site details collection."
291
  msgstr ""
292
 
293
+ #: includes/class-freemius.php:14062
294
  msgid "We couldn't find your email address in the system, are you sure it's the right address?"
295
  msgstr ""
296
 
297
+ #: includes/class-freemius.php:14064
298
  msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
299
  msgstr ""
300
 
301
+ #: includes/class-freemius.php:14338
302
  msgid "Account is pending activation."
303
  msgstr ""
304
 
305
+ #: includes/class-freemius.php:14450, templates/forms/premium-versions-upgrade-handler.php:47
306
  msgid "Buy a license now"
307
  msgstr ""
308
 
309
+ #: includes/class-freemius.php:14462, templates/forms/premium-versions-upgrade-handler.php:46
310
  msgid "Renew your license now"
311
  msgstr ""
312
 
313
+ #: includes/class-freemius.php:14466
314
  msgid "%s to access version %s security & feature updates, and support."
315
  msgstr ""
316
 
317
+ #: includes/class-freemius.php:16907
318
  msgid "%s activation was successfully completed."
319
  msgstr ""
320
 
321
+ #: includes/class-freemius.php:16921
322
  msgid "Your account was successfully activated with the %s plan."
323
  msgstr ""
324
 
325
+ #: includes/class-freemius.php:16932, includes/class-freemius.php:20724
326
  msgid "Your trial has been successfully started."
327
  msgstr ""
328
 
329
+ #: includes/class-freemius.php:17524, includes/class-freemius.php:17629, includes/class-freemius.php:17804
330
  msgid "Couldn't activate %s."
331
  msgstr ""
332
 
333
+ #: includes/class-freemius.php:17525, includes/class-freemius.php:17630, includes/class-freemius.php:17805
334
  msgid "Please contact us with the following message:"
335
  msgstr ""
336
 
337
+ #: includes/class-freemius.php:17626, templates/forms/data-debug-mode.php:162
338
  msgid "An unknown error has occurred."
339
  msgstr ""
340
 
341
+ #: includes/class-freemius.php:18162, includes/class-freemius.php:23310
342
  msgid "Upgrade"
343
  msgstr ""
344
 
345
+ #: includes/class-freemius.php:18168
346
  msgid "Start Trial"
347
  msgstr ""
348
 
349
+ #: includes/class-freemius.php:18170
350
  msgid "Pricing"
351
  msgstr ""
352
 
353
+ #: includes/class-freemius.php:18250, includes/class-freemius.php:18252
354
  msgid "Affiliation"
355
  msgstr ""
356
 
357
+ #: includes/class-freemius.php:18280, includes/class-freemius.php:18282, templates/account.php:240, templates/debug.php:324
358
  msgid "Account"
359
  msgstr ""
360
 
361
+ #: includes/class-freemius.php:18296, includes/class-freemius.php:18298, includes/customizer/class-fs-customizer-support-section.php:60
362
  msgid "Contact Us"
363
  msgstr ""
364
 
365
+ #: includes/class-freemius.php:18309, includes/class-freemius.php:18311, includes/class-freemius.php:23324, templates/account.php:119, templates/account/partials/addon.php:44
366
  msgid "Add-Ons"
367
  msgstr ""
368
 
369
+ #: includes/class-freemius.php:18345
370
  msgctxt "ASCII arrow left icon"
371
  msgid "&#x2190;"
372
  msgstr ""
373
 
374
+ #: includes/class-freemius.php:18345
375
  msgctxt "ASCII arrow right icon"
376
  msgid "&#x27a4;"
377
  msgstr ""
378
 
379
+ #: includes/class-freemius.php:18347, templates/pricing.php:109
380
  msgctxt "noun"
381
  msgid "Pricing"
382
  msgstr ""
383
 
384
+ #: includes/class-freemius.php:18560, includes/customizer/class-fs-customizer-support-section.php:67
385
  msgid "Support Forum"
386
  msgstr ""
387
 
388
+ #: includes/class-freemius.php:19534
389
  msgid "Your email has been successfully verified - you are AWESOME!"
390
  msgstr ""
391
 
392
+ #: includes/class-freemius.php:19535
393
  msgctxt "a positive response"
394
  msgid "Right on"
395
  msgstr ""
396
 
397
+ #: includes/class-freemius.php:20041
398
  msgid "seems like the key you entered doesn't match our records."
399
  msgstr ""
400
 
401
+ #: includes/class-freemius.php:20065
402
  msgid "Debug mode was successfully enabled and will be automatically disabled in 60 min. You can also disable it earlier by clicking the \"Stop Debug\" link."
403
  msgstr ""
404
 
405
+ #: includes/class-freemius.php:20300
406
  msgid "Your %s Add-on plan was successfully upgraded."
407
  msgstr ""
408
 
409
+ #: includes/class-freemius.php:20302
410
  msgid "%s Add-on was successfully purchased."
411
  msgstr ""
412
 
413
+ #: includes/class-freemius.php:20305
414
  msgid "Download the latest version"
415
  msgstr ""
416
 
417
+ #: includes/class-freemius.php:20391
418
  msgid "Your server is blocking the access to Freemius' API, which is crucial for %1$s synchronization. Please contact your host to whitelist %2$s"
419
  msgstr ""
420
 
421
+ #: includes/class-freemius.php:20397, includes/class-freemius.php:20407, includes/class-freemius.php:20859, includes/class-freemius.php:20948
422
  msgid "Error received from the server:"
423
  msgstr ""
424
 
425
+ #: includes/class-freemius.php:20407
426
  msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
427
  msgstr ""
428
 
429
+ #: includes/class-freemius.php:20621, includes/class-freemius.php:20864, includes/class-freemius.php:20919, includes/class-freemius.php:21026
430
  msgctxt "something somebody says when they are thinking about what you have just said."
431
  msgid "Hmm"
432
  msgstr ""
433
 
434
+ #: includes/class-freemius.php:20634
435
  msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
436
  msgstr ""
437
 
438
+ #: includes/class-freemius.php:20635, templates/account.php:121, templates/add-ons.php:250, templates/account/partials/addon.php:46
439
  msgctxt "trial period"
440
  msgid "Trial"
441
  msgstr ""
442
 
443
+ #: includes/class-freemius.php:20640
444
  msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
445
  msgstr ""
446
 
447
+ #: includes/class-freemius.php:20644, includes/class-freemius.php:20703
448
  msgid "Please contact us here"
449
  msgstr ""
450
 
451
+ #: includes/class-freemius.php:20655
452
  msgid "Your plan was successfully activated."
453
  msgstr ""
454
 
455
+ #: includes/class-freemius.php:20656
456
  msgid "Your plan was successfully upgraded."
457
  msgstr ""
458
 
459
+ #: includes/class-freemius.php:20673
460
  msgid "Your plan was successfully changed to %s."
461
  msgstr ""
462
 
463
+ #: includes/class-freemius.php:20689
464
  msgid "Your license has expired. You can still continue using the free %s forever."
465
  msgstr ""
466
 
467
+ #: includes/class-freemius.php:20691
468
  msgid "Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
469
  msgstr ""
470
 
471
+ #: includes/class-freemius.php:20699
472
  msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
473
  msgstr ""
474
 
475
+ #: includes/class-freemius.php:20712
476
  msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
477
  msgstr ""
478
 
479
+ #: includes/class-freemius.php:20738
480
  msgid "Your free trial has expired. You can still continue using all our free features."
481
  msgstr ""
482
 
483
+ #: includes/class-freemius.php:20740
484
  msgid "Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
485
  msgstr ""
486
 
487
+ #: includes/class-freemius.php:20855
488
  msgid "It looks like the license could not be activated."
489
  msgstr ""
490
 
491
+ #: includes/class-freemius.php:20897
492
  msgid "Your license was successfully activated."
493
  msgstr ""
494
 
495
+ #: includes/class-freemius.php:20923
496
  msgid "It looks like your site currently doesn't have an active license."
497
  msgstr ""
498
 
499
+ #: includes/class-freemius.php:20947
500
  msgid "It looks like the license deactivation failed."
501
  msgstr ""
502
 
503
+ #: includes/class-freemius.php:20976
504
  msgid "Your %s license was successfully deactivated."
505
  msgstr ""
506
 
507
+ #: includes/class-freemius.php:20977
508
  msgid "Your license was successfully deactivated, you are back to the %s plan."
509
  msgstr ""
510
 
511
+ #: includes/class-freemius.php:20980
512
  msgid "O.K"
513
  msgstr ""
514
 
515
+ #: includes/class-freemius.php:21033
516
  msgid "Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes."
517
  msgstr ""
518
 
519
+ #: includes/class-freemius.php:21042
520
  msgid "Your subscription was successfully cancelled. Your %s plan license will expire in %s."
521
  msgstr ""
522
 
523
+ #: includes/class-freemius.php:21084
524
  msgid "You are already running the %s in a trial mode."
525
  msgstr ""
526
 
527
+ #: includes/class-freemius.php:21095
528
  msgid "You already utilized a trial before."
529
  msgstr ""
530
 
531
+ #: includes/class-freemius.php:21109
532
  msgid "Plan %s do not exist, therefore, can't start a trial."
533
  msgstr ""
534
 
535
+ #: includes/class-freemius.php:21120
536
  msgid "Plan %s does not support a trial period."
537
  msgstr ""
538
 
539
+ #: includes/class-freemius.php:21131
540
  msgid "None of the %s's plans supports a trial period."
541
  msgstr ""
542
 
543
+ #: includes/class-freemius.php:21181
544
  msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
545
  msgstr ""
546
 
547
+ #: includes/class-freemius.php:21217
548
  msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
549
  msgstr ""
550
 
551
+ #: includes/class-freemius.php:21236
552
  msgid "Your %s free trial was successfully cancelled."
553
  msgstr ""
554
 
555
+ #: includes/class-freemius.php:21552
556
  msgid "Version %s was released."
557
  msgstr ""
558
 
559
+ #: includes/class-freemius.php:21552
560
  msgid "Please download %s."
561
  msgstr ""
562
 
563
+ #: includes/class-freemius.php:21559
564
  msgid "the latest %s version here"
565
  msgstr ""
566
 
567
+ #: includes/class-freemius.php:21564
568
  msgid "New"
569
  msgstr ""
570
 
571
+ #: includes/class-freemius.php:21569
572
  msgid "Seems like you got the latest release."
573
  msgstr ""
574
 
575
+ #: includes/class-freemius.php:21570
576
  msgid "You are all good!"
577
  msgstr ""
578
 
579
+ #: includes/class-freemius.php:21873
580
  msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
581
  msgstr ""
582
 
583
+ #: includes/class-freemius.php:22013
584
  msgid "Site successfully opted in."
585
  msgstr ""
586
 
587
+ #: includes/class-freemius.php:22014, includes/class-freemius.php:23020
588
  msgid "Awesome"
589
  msgstr ""
590
 
591
+ #: includes/class-freemius.php:22030, templates/forms/optout.php:41
592
  msgid "We appreciate your help in making the %s better by letting us track some usage data."
593
  msgstr ""
594
 
595
+ #: includes/class-freemius.php:22031
596
  msgid "Thank you!"
597
  msgstr ""
598
 
599
+ #: includes/class-freemius.php:22038
600
  msgid "We will no longer be sending any usage data of %s on %s to %s."
601
  msgstr ""
602
 
603
+ #: includes/class-freemius.php:22196
604
  msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
605
  msgstr ""
606
 
607
+ #: includes/class-freemius.php:22202
608
  msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
609
  msgstr ""
610
 
611
+ #: includes/class-freemius.php:22207
612
  msgid "%s is the new owner of the account."
613
  msgstr ""
614
 
615
+ #: includes/class-freemius.php:22209
616
  msgctxt "as congratulations"
617
  msgid "Congrats"
618
  msgstr ""
619
 
620
+ #: includes/class-freemius.php:22245
621
  msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
622
  msgstr ""
623
 
624
+ #: includes/class-freemius.php:22257
625
  msgid "Please provide your full name."
626
  msgstr ""
627
 
628
+ #: includes/class-freemius.php:22262
629
  msgid "Your name was successfully updated."
630
  msgstr ""
631
 
632
+ #: includes/class-freemius.php:22323
633
  msgid "You have successfully updated your %s."
634
  msgstr ""
635
 
636
+ #: includes/class-freemius.php:22382
637
+ msgid "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin."
638
+ msgstr ""
639
+
640
+ #: includes/class-freemius.php:22385
641
+ msgid "Click here"
642
+ msgstr ""
643
+
644
+ #: includes/class-freemius.php:22483
645
  msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
646
  msgstr ""
647
 
648
+ #: includes/class-freemius.php:22484
649
  msgctxt "advance notice of something that will need attention."
650
  msgid "Heads up"
651
  msgstr ""
652
 
653
+ #: includes/class-freemius.php:23060
654
  msgctxt "exclamation"
655
  msgid "Hey"
656
  msgstr ""
657
 
658
+ #: includes/class-freemius.php:23060
659
  msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
660
  msgstr ""
661
 
662
+ #: includes/class-freemius.php:23068
663
  msgid "No commitment for %s days - cancel anytime!"
664
  msgstr ""
665
 
666
+ #: includes/class-freemius.php:23069
667
  msgid "No credit card required"
668
  msgstr ""
669
 
670
+ #: includes/class-freemius.php:23076, templates/forms/trial-start.php:53
671
  msgctxt "call to action"
672
  msgid "Start free trial"
673
  msgstr ""
674
 
675
+ #: includes/class-freemius.php:23153
676
  msgid "Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!"
677
  msgstr ""
678
 
679
+ #: includes/class-freemius.php:23162
680
  msgid "Learn more"
681
  msgstr ""
682
 
683
+ #: includes/class-freemius.php:23348, templates/account.php:556, templates/account.php:706, templates/connect.php:179, templates/connect.php:456, templates/forms/license-activation.php:27, templates/account/partials/addon.php:321
684
  msgid "Activate License"
685
  msgstr ""
686
 
687
+ #: includes/class-freemius.php:23349, templates/account.php:650, templates/account.php:705, templates/account/partials/addon.php:322, templates/account/partials/site.php:271
688
  msgid "Change License"
689
  msgstr ""
690
 
691
+ #: includes/class-freemius.php:23462, templates/account/partials/site.php:169
692
  msgid "Opt Out"
693
  msgstr ""
694
 
695
+ #: includes/class-freemius.php:23464, includes/class-freemius.php:23470, templates/account/partials/site.php:49, templates/account/partials/site.php:169
696
  msgid "Opt In"
697
  msgstr ""
698
 
699
+ #: includes/class-freemius.php:23700
700
  msgid " The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s"
701
  msgstr ""
702
 
703
+ #: includes/class-freemius.php:23708
704
  msgid "Activate %s features"
705
  msgstr ""
706
 
707
+ #: includes/class-freemius.php:23721
708
  msgid "Please follow these steps to complete the upgrade"
709
  msgstr ""
710
 
711
+ #: includes/class-freemius.php:23725
712
  msgid "Download the latest %s version"
713
  msgstr ""
714
 
715
+ #: includes/class-freemius.php:23729
716
  msgid "Upload and activate the downloaded version"
717
  msgstr ""
718
 
719
+ #: includes/class-freemius.php:23731
720
  msgid "How to upload and activate?"
721
  msgstr ""
722
 
723
+ #: includes/class-freemius.php:23865
724
  msgid "%sClick here%s to choose the sites where you'd like to activate the license on."
725
  msgstr ""
726
 
727
+ #: includes/class-freemius.php:24034
728
  msgid "Auto installation only works for opted-in users."
729
  msgstr ""
730
 
731
+ #: includes/class-freemius.php:24044, includes/class-freemius.php:24077, includes/class-fs-plugin-updater.php:1273, includes/class-fs-plugin-updater.php:1287
732
  msgid "Invalid module ID."
733
  msgstr ""
734
 
735
+ #: includes/class-freemius.php:24053, includes/class-fs-plugin-updater.php:1309
736
  msgid "Premium version already active."
737
  msgstr ""
738
 
739
+ #: includes/class-freemius.php:24060
740
  msgid "You do not have a valid license to access the premium version."
741
  msgstr ""
742
 
743
+ #: includes/class-freemius.php:24067
744
  msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
745
  msgstr ""
746
 
747
+ #: includes/class-freemius.php:24085, includes/class-fs-plugin-updater.php:1308
748
  msgid "Premium add-on version already installed."
749
  msgstr ""
750
 
751
+ #: includes/class-freemius.php:24435
752
  msgid "View paid features"
753
  msgstr ""
754
 
755
+ #: includes/class-freemius.php:24757
756
  msgid "Thank you so much for using %s and its add-ons!"
757
  msgstr ""
758
 
759
+ #: includes/class-freemius.php:24758
760
  msgid "Thank you so much for using %s!"
761
  msgstr ""
762
 
763
+ #: includes/class-freemius.php:24764
764
  msgid "You've already opted-in to our usage-tracking, which helps us keep improving the %s."
765
  msgstr ""
766
 
767
+ #: includes/class-freemius.php:24768
768
  msgid "Thank you so much for using our products!"
769
  msgstr ""
770
 
771
+ #: includes/class-freemius.php:24769
772
  msgid "You've already opted-in to our usage-tracking, which helps us keep improving them."
773
  msgstr ""
774
 
775
+ #: includes/class-freemius.php:24788
776
  msgid "%s and its add-ons"
777
  msgstr ""
778
 
779
+ #: includes/class-freemius.php:24797
780
  msgid "Products"
781
  msgstr ""
782
 
783
+ #: includes/class-freemius.php:24804, templates/connect.php:280
784
  msgid "Yes"
785
  msgstr ""
786
 
787
+ #: includes/class-freemius.php:24805, templates/connect.php:281
788
  msgid "send me security & feature updates, educational content and offers."
789
  msgstr ""
790
 
791
+ #: includes/class-freemius.php:24806, templates/connect.php:286
792
  msgid "No"
793
  msgstr ""
794
 
795
+ #: includes/class-freemius.php:24808, templates/connect.php:288
796
  msgid "do %sNOT%s send me security & feature updates, educational content and offers."
797
  msgstr ""
798
 
799
+ #: includes/class-freemius.php:24818
800
  msgid "Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)"
801
  msgstr ""
802
 
803
+ #: includes/class-freemius.php:24820, templates/connect.php:295
804
  msgid "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:"
805
  msgstr ""
806
 
807
+ #: includes/class-freemius.php:25102
808
  msgid "License key is empty."
809
  msgstr ""
810
 
832
  msgid "Important Upgrade Notice:"
833
  msgstr ""
834
 
835
+ #: includes/class-fs-plugin-updater.php:1338
836
  msgid "Installing plugin: %s"
837
  msgstr ""
838
 
839
+ #: includes/class-fs-plugin-updater.php:1379
840
  msgid "Unable to connect to the filesystem. Please confirm your credentials."
841
  msgstr ""
842
 
843
+ #: includes/class-fs-plugin-updater.php:1561
844
  msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
845
  msgstr ""
846
 
847
+ #: includes/fs-plugin-info-dialog.php:541
848
  msgid "Purchase More"
849
  msgstr ""
850
 
851
+ #: includes/fs-plugin-info-dialog.php:542, templates/account/partials/addon.php:385
852
  msgctxt "verb"
853
  msgid "Purchase"
854
  msgstr ""
855
 
856
+ #: includes/fs-plugin-info-dialog.php:546
857
  msgid "Start my free %s"
858
  msgstr ""
859
 
860
+ #: includes/fs-plugin-info-dialog.php:744
861
  msgid "Install Free Version Update Now"
862
  msgstr ""
863
 
864
+ #: includes/fs-plugin-info-dialog.php:745, templates/account.php:639
865
  msgid "Install Update Now"
866
  msgstr ""
867
 
868
+ #: includes/fs-plugin-info-dialog.php:754
869
  msgid "Install Free Version Now"
870
  msgstr ""
871
 
872
+ #: includes/fs-plugin-info-dialog.php:755, templates/add-ons.php:323, templates/auto-installation.php:111, templates/account/partials/addon.php:365, templates/account/partials/addon.php:418
873
  msgid "Install Now"
874
  msgstr ""
875
 
876
+ #: includes/fs-plugin-info-dialog.php:771
877
  msgctxt "as download latest version"
878
  msgid "Download Latest Free Version"
879
  msgstr ""
880
 
881
+ #: includes/fs-plugin-info-dialog.php:772, templates/account.php:99, templates/add-ons.php:37, templates/account/partials/addon.php:25
882
  msgctxt "as download latest version"
883
  msgid "Download Latest"
884
  msgstr ""
885
 
886
+ #: includes/fs-plugin-info-dialog.php:787, templates/add-ons.php:329, templates/account/partials/addon.php:356, templates/account/partials/addon.php:412
887
  msgid "Activate this add-on"
888
  msgstr ""
889
 
890
+ #: includes/fs-plugin-info-dialog.php:789, templates/connect.php:453
891
  msgid "Activate Free Version"
892
  msgstr ""
893
 
894
+ #: includes/fs-plugin-info-dialog.php:790, templates/account.php:123, templates/add-ons.php:330, templates/account/partials/addon.php:48
895
  msgid "Activate"
896
  msgstr ""
897
 
898
+ #: includes/fs-plugin-info-dialog.php:1002
899
  msgctxt "Plugin installer section title"
900
  msgid "Description"
901
  msgstr ""
902
 
903
+ #: includes/fs-plugin-info-dialog.php:1003
904
  msgctxt "Plugin installer section title"
905
  msgid "Installation"
906
  msgstr ""
907
 
908
+ #: includes/fs-plugin-info-dialog.php:1004
909
  msgctxt "Plugin installer section title"
910
  msgid "FAQ"
911
  msgstr ""
912
 
913
+ #: includes/fs-plugin-info-dialog.php:1005, templates/plugin-info/description.php:55
914
  msgid "Screenshots"
915
  msgstr ""
916
 
917
+ #: includes/fs-plugin-info-dialog.php:1006
918
  msgctxt "Plugin installer section title"
919
  msgid "Changelog"
920
  msgstr ""
921
 
922
+ #: includes/fs-plugin-info-dialog.php:1007
923
  msgctxt "Plugin installer section title"
924
  msgid "Reviews"
925
  msgstr ""
926
 
927
+ #: includes/fs-plugin-info-dialog.php:1008
928
  msgctxt "Plugin installer section title"
929
  msgid "Other Notes"
930
  msgstr ""
931
 
932
+ #: includes/fs-plugin-info-dialog.php:1023
933
  msgctxt "Plugin installer section title"
934
  msgid "Features & Pricing"
935
  msgstr ""
936
 
937
+ #: includes/fs-plugin-info-dialog.php:1033
938
  msgid "Plugin Install"
939
  msgstr ""
940
 
941
+ #: includes/fs-plugin-info-dialog.php:1105
942
  msgctxt "e.g. Professional Plan"
943
  msgid "%s Plan"
944
  msgstr ""
945
 
946
+ #: includes/fs-plugin-info-dialog.php:1131
947
  msgctxt "e.g. the best product"
948
  msgid "Best"
949
  msgstr ""
950
 
951
+ #: includes/fs-plugin-info-dialog.php:1137, includes/fs-plugin-info-dialog.php:1157
952
  msgctxt "as every month"
953
  msgid "Monthly"
954
  msgstr ""
955
 
956
+ #: includes/fs-plugin-info-dialog.php:1140
957
  msgctxt "as once a year"
958
  msgid "Annual"
959
  msgstr ""
960
 
961
+ #: includes/fs-plugin-info-dialog.php:1143
962
  msgid "Lifetime"
963
  msgstr ""
964
 
965
+ #: includes/fs-plugin-info-dialog.php:1157, includes/fs-plugin-info-dialog.php:1159, includes/fs-plugin-info-dialog.php:1161
966
  msgctxt "e.g. billed monthly"
967
  msgid "Billed %s"
968
  msgstr ""
969
 
970
+ #: includes/fs-plugin-info-dialog.php:1159
971
  msgctxt "as once a year"
972
  msgid "Annually"
973
  msgstr ""
974
 
975
+ #: includes/fs-plugin-info-dialog.php:1161
976
  msgctxt "as once a year"
977
  msgid "Once"
978
  msgstr ""
979
 
980
+ #: includes/fs-plugin-info-dialog.php:1167
981
  msgid "Single Site License"
982
  msgstr ""
983
 
984
+ #: includes/fs-plugin-info-dialog.php:1169
985
  msgid "Unlimited Licenses"
986
  msgstr ""
987
 
988
+ #: includes/fs-plugin-info-dialog.php:1171
989
  msgid "Up to %s Sites"
990
  msgstr ""
991
 
992
+ #: includes/fs-plugin-info-dialog.php:1181, templates/plugin-info/features.php:82
993
  msgctxt "as monthly period"
994
  msgid "mo"
995
  msgstr ""
996
 
997
+ #: includes/fs-plugin-info-dialog.php:1188, templates/plugin-info/features.php:80
998
  msgctxt "as annual period"
999
  msgid "year"
1000
  msgstr ""
1001
 
1002
+ #: includes/fs-plugin-info-dialog.php:1242
1003
  msgctxt "noun"
1004
  msgid "Price"
1005
  msgstr ""
1006
 
1007
+ #: includes/fs-plugin-info-dialog.php:1290
1008
  msgid "Save %s"
1009
  msgstr ""
1010
 
1011
+ #: includes/fs-plugin-info-dialog.php:1300
1012
  msgid "No commitment for %s - cancel anytime"
1013
  msgstr ""
1014
 
1015
+ #: includes/fs-plugin-info-dialog.php:1303
1016
  msgid "After your free %s, pay as little as %s"
1017
  msgstr ""
1018
 
1019
+ #: includes/fs-plugin-info-dialog.php:1314
1020
  msgid "Details"
1021
  msgstr ""
1022
 
1023
+ #: includes/fs-plugin-info-dialog.php:1318, templates/account.php:110, templates/debug.php:201, templates/debug.php:238, templates/debug.php:455, templates/account/partials/addon.php:36
1024
  msgctxt "product version"
1025
  msgid "Version"
1026
  msgstr ""
1027
 
1028
+ #: includes/fs-plugin-info-dialog.php:1325
1029
  msgctxt "as the plugin author"
1030
  msgid "Author"
1031
  msgstr ""
1032
 
1033
+ #: includes/fs-plugin-info-dialog.php:1332
1034
  msgid "Last Updated"
1035
  msgstr ""
1036
 
1037
+ #: includes/fs-plugin-info-dialog.php:1337, templates/account.php:525
1038
  msgctxt "x-ago"
1039
  msgid "%s ago"
1040
  msgstr ""
1041
 
1042
+ #: includes/fs-plugin-info-dialog.php:1346
1043
  msgid "Requires WordPress Version"
1044
  msgstr ""
1045
 
1046
+ #: includes/fs-plugin-info-dialog.php:1347
1047
  msgid "%s or higher"
1048
  msgstr ""
1049
 
1050
+ #: includes/fs-plugin-info-dialog.php:1354
1051
  msgid "Compatible up to"
1052
  msgstr ""
1053
 
1054
+ #: includes/fs-plugin-info-dialog.php:1362
1055
  msgid "Downloaded"
1056
  msgstr ""
1057
 
1058
+ #: includes/fs-plugin-info-dialog.php:1366
1059
  msgid "%s time"
1060
  msgstr ""
1061
 
1062
+ #: includes/fs-plugin-info-dialog.php:1368
1063
  msgid "%s times"
1064
  msgstr ""
1065
 
1066
+ #: includes/fs-plugin-info-dialog.php:1379
1067
  msgid "WordPress.org Plugin Page"
1068
  msgstr ""
1069
 
1070
+ #: includes/fs-plugin-info-dialog.php:1388
1071
  msgid "Plugin Homepage"
1072
  msgstr ""
1073
 
1074
+ #: includes/fs-plugin-info-dialog.php:1397, includes/fs-plugin-info-dialog.php:1481
1075
  msgid "Donate to this plugin"
1076
  msgstr ""
1077
 
1078
+ #: includes/fs-plugin-info-dialog.php:1404
1079
  msgid "Average Rating"
1080
  msgstr ""
1081
 
1082
+ #: includes/fs-plugin-info-dialog.php:1411
1083
  msgid "based on %s"
1084
  msgstr ""
1085
 
1086
+ #: includes/fs-plugin-info-dialog.php:1415
1087
  msgid "%s rating"
1088
  msgstr ""
1089
 
1090
+ #: includes/fs-plugin-info-dialog.php:1417
1091
  msgid "%s ratings"
1092
  msgstr ""
1093
 
1094
+ #: includes/fs-plugin-info-dialog.php:1432
1095
  msgid "%s star"
1096
  msgstr ""
1097
 
1098
+ #: includes/fs-plugin-info-dialog.php:1434
1099
  msgid "%s stars"
1100
  msgstr ""
1101
 
1102
+ #: includes/fs-plugin-info-dialog.php:1446
1103
  msgid "Click to see reviews that provided a rating of %s"
1104
  msgstr ""
1105
 
1106
+ #: includes/fs-plugin-info-dialog.php:1459
1107
  msgid "Contributors"
1108
  msgstr ""
1109
 
1110
+ #: includes/fs-plugin-info-dialog.php:1489, includes/fs-plugin-info-dialog.php:1491
1111
  msgid "Warning"
1112
  msgstr ""
1113
 
1114
+ #: includes/fs-plugin-info-dialog.php:1489
1115
  msgid "This plugin has not been tested with your current version of WordPress."
1116
  msgstr ""
1117
 
1118
+ #: includes/fs-plugin-info-dialog.php:1491
1119
  msgid "This plugin has not been marked as compatible with your version of WordPress."
1120
  msgstr ""
1121
 
1122
+ #: includes/fs-plugin-info-dialog.php:1510
1123
  msgid "Paid add-on must be deployed to Freemius."
1124
  msgstr ""
1125
 
1126
+ #: includes/fs-plugin-info-dialog.php:1511
1127
  msgid "Add-on must be deployed to WordPress.org or Freemius."
1128
  msgstr ""
1129
 
1130
+ #: includes/fs-plugin-info-dialog.php:1532
1131
  msgid "Newer Version (%s) Installed"
1132
  msgstr ""
1133
 
1134
+ #: includes/fs-plugin-info-dialog.php:1533
1135
  msgid "Newer Free Version (%s) Installed"
1136
  msgstr ""
1137
 
1138
+ #: includes/fs-plugin-info-dialog.php:1540
1139
  msgid "Latest Version Installed"
1140
  msgstr ""
1141
 
1142
+ #: includes/fs-plugin-info-dialog.php:1541
1143
  msgid "Latest Free Version Installed"
1144
  msgstr ""
1145
 
1425
  msgid "Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?"
1426
  msgstr ""
1427
 
1428
+ #: templates/account.php:1073
1429
+ msgid "Disabling white-label mode"
1430
+ msgstr ""
1431
+
1432
+ #: templates/account.php:1074
1433
+ msgid "Enabling white-label mode"
1434
+ msgstr ""
1435
+
1436
  #: templates/add-ons.php:38
1437
  msgid "View details"
1438
  msgstr ""
1562
  msgid "Can't find your license key?"
1563
  msgstr ""
1564
 
1565
+ #: templates/connect.php:323, templates/connect.php:695, templates/forms/deactivation/retry-skip.php:20
1566
  msgctxt "verb"
1567
  msgid "Skip"
1568
  msgstr ""
1619
  msgid "Title, slug, version, and is active"
1620
  msgstr ""
1621
 
1622
+ #: templates/connect.php:421, templates/forms/license-activation.php:41
1623
  msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
1624
  msgstr ""
1625
 
1626
+ #: templates/connect.php:426
1627
  msgid "What permissions are being granted?"
1628
  msgstr ""
1629
 
1630
+ #: templates/connect.php:452
1631
  msgid "Don't have a license key?"
1632
  msgstr ""
1633
 
1634
+ #: templates/connect.php:455
1635
  msgid "Have a license key?"
1636
  msgstr ""
1637
 
1638
+ #: templates/connect.php:463
1639
  msgid "Privacy Policy"
1640
  msgstr ""
1641
 
1642
+ #: templates/connect.php:465
1643
  msgid "License Agreement"
1644
  msgstr ""
1645
 
1646
+ #: templates/connect.php:465
1647
  msgid "Terms of Service"
1648
  msgstr ""
1649
 
1650
+ #: templates/connect.php:854
1651
  msgctxt "as in the process of sending an email"
1652
  msgid "Sending email"
1653
  msgstr ""
1654
 
1655
+ #: templates/connect.php:855
1656
  msgctxt "as activating plugin"
1657
  msgid "Activating"
1658
  msgstr ""
2209
  msgid "Please provide details on how you intend to promote %s (please be as specific as possible)."
2210
  msgstr ""
2211
 
2212
+ #: templates/forms/affiliation.php:232, templates/forms/resend-key.php:22
2213
  msgid "Cancel"
2214
  msgstr ""
2215
 
2216
+ #: templates/forms/affiliation.php:234
2217
  msgid "Become an affiliate"
2218
  msgstr ""
2219
 
freemius/start.php CHANGED
@@ -15,7 +15,7 @@
15
  *
16
  * @var string
17
  */
18
- $this_sdk_version = '2.4.0.1';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
15
  *
16
  * @var string
17
  */
18
+ $this_sdk_version = '2.4.1';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
freemius/templates/account.php CHANGED
@@ -1056,6 +1056,29 @@
1056
  });
1057
  });
1058
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1059
  })(jQuery);
1060
  </script>
1061
  <?php
1056
  });
1057
  });
1058
 
1059
+ $( '.fs-toggle-whitelabel-mode' ).click( function () {
1060
+ var $toggleLink = $( this );
1061
+
1062
+ $.ajax( {
1063
+ url : ajaxurl,
1064
+ method: 'POST',
1065
+ data : {
1066
+ action : '<?php echo $fs->get_ajax_action( 'toggle_whitelabel_mode' ) ?>',
1067
+ security : '<?php echo $fs->get_ajax_security( 'toggle_whitelabel_mode' ) ?>',
1068
+ module_id: <?php echo $fs->get_id() ?>
1069
+ },
1070
+ beforeSend: function () {
1071
+ $toggleLink.parent().text( '<?php
1072
+ $is_whitelabeled ?
1073
+ fs_esc_html_echo_inline( 'Disabling white-label mode', 'disabling-whitelabel-mode' ) :
1074
+ fs_esc_html_echo_inline( 'Enabling white-label mode', 'enabling-whitelabel-mode' )
1075
+ ?>' + '...' );
1076
+ },
1077
+ complete: function () {
1078
+ location.reload();
1079
+ }
1080
+ } );
1081
+ });
1082
  })(jQuery);
1083
  </script>
1084
  <?php
freemius/templates/add-ons.php CHANGED
File without changes
freemius/templates/checkout.php CHANGED
File without changes
freemius/templates/connect.php CHANGED
File without changes
freemius/templates/contact.php CHANGED
File without changes
freemius/templates/firewall-issues-js.php CHANGED
File without changes
freemius/templates/forms/affiliation.php CHANGED
@@ -220,10 +220,12 @@
220
  <p class="description"><?php echo esc_html( sprintf( fs_text_inline( 'Please provide details on how you intend to promote %s (please be as specific as possible).', 'promotion-method-desc-field-desc', $slug ), $plugin_title ) ) ?></p>
221
  <?php endif ?>
222
  </div>
 
223
  <div>
224
  <input type="checkbox" id="legal_consent_checkbox">
225
  <label for="legal_consent_checkbox">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noopener">Referrer Program</a>'s terms & conditions.</label>
226
  </div>
 
227
  </form>
228
  </div>
229
  <?php if ( ! $is_affiliate ) : ?>
220
  <p class="description"><?php echo esc_html( sprintf( fs_text_inline( 'Please provide details on how you intend to promote %s (please be as specific as possible).', 'promotion-method-desc-field-desc', $slug ), $plugin_title ) ) ?></p>
221
  <?php endif ?>
222
  </div>
223
+ <?php if ( ! $is_affiliate ) : ?>
224
  <div>
225
  <input type="checkbox" id="legal_consent_checkbox">
226
  <label for="legal_consent_checkbox">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noopener">Referrer Program</a>'s terms & conditions.</label>
227
  </div>
228
+ <?php endif ?>
229
  </form>
230
  </div>
231
  <?php if ( ! $is_affiliate ) : ?>
freemius/templates/forms/deactivation/form.php CHANGED
File without changes
freemius/templates/powered-by.php CHANGED
File without changes
freemius/templates/sticky-admin-notice-js.php CHANGED
File without changes
includes/assets/img/menu-image-60.png ADDED
Binary file
includes/assets/img/pro-badge-1.png ADDED
Binary file
includes/assets/img/pro-badge-2.png ADDED
Binary file
includes/assets/img/pro-badge-3.png ADDED
Binary file
includes/assets/img/pro-button-1.png ADDED
Binary file
includes/assets/img/pro-button-2.png ADDED
Binary file
includes/css/menu-image-admin.css ADDED
@@ -0,0 +1,423 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .menu-item-handle .item-title {
2
+ margin-right: 0px!important;
3
+ }
4
+ .menu-item-bar .menu-item-handle:hover .menu-image-item-settings {
5
+ opacity: 1;
6
+ cursor: pointer;
7
+ background-color: #428BFF;
8
+ color: #fff;
9
+ padding: 2px 8px;
10
+ border-radius: 2px;
11
+ }
12
+ .menu-item-handle .item-title {
13
+ margin-right: 0px!important;
14
+ }
15
+ .menu-item-bar .menu-image-item-settings:before {
16
+ padding-right: 5px;
17
+ }
18
+ .menu-item-bar .menu-image-item-settings {
19
+ opacity: 0;
20
+ }
21
+ .menu-item-bar .menu-image-item-settings .dashicons {
22
+ font-size: 9px;
23
+ vertical-align: unset;
24
+ color:#fff;
25
+ }
26
+ #menu-image-modal-body {
27
+ overflow-y: scroll;
28
+ width: 100%;
29
+ height: 100%;
30
+ float: left;
31
+ padding: 30px;
32
+ }
33
+ .menu-item-image-options label {
34
+ font-weight: 500;
35
+ width: 200px;
36
+ float: left;
37
+ color:#333;
38
+ }
39
+ .menu-image-item-settings-overlay {
40
+ position: fixed;
41
+ top: 0;
42
+ left: 0;
43
+ z-index: 9999;
44
+ width: 100%;
45
+ height: 100%;
46
+ background:rgb(58 58 58 / 87%);
47
+ opacity: 0.8;
48
+ }
49
+ .menu-image-label, .menu-image-field {
50
+ display: inline-table;
51
+ }
52
+ .menu-image-label {
53
+ min-width: 200px;
54
+ }
55
+ .menu-image-field .description {
56
+ font-size: 13px;
57
+ }
58
+ .menu-item-image-options p {
59
+ font-size: 14px;
60
+ margin-bottom: 20px;
61
+
62
+ }
63
+ .menu-item-image-options input[type="radio"] {
64
+ margin-right: 5px;
65
+ margin-left: 5px;
66
+ }
67
+ .menu-image-item-settings-content h4 {
68
+ font-size: 18px;
69
+ font-weight: 400;
70
+ }
71
+ .menu-image-item-settings-content {
72
+ max-width: 100%;
73
+ background: #fff;
74
+ border-radius: 3px;
75
+ height: 90%;
76
+ max-height: 90%;
77
+ overflow: hidden;
78
+ position: fixed;
79
+ z-index: 10000;
80
+ width: 80%;
81
+ top: 7%;
82
+ left: 10%;
83
+
84
+ }
85
+ .menu-item-image-options .description-half {
86
+ display: inline-flex;
87
+ margin-right: 70px;
88
+ }
89
+ #menu-image-modal-header {
90
+ background-color: #f8f8f8;
91
+ -moz-box-shadow: 2px 3px 5px 0 rgba(0,0,0,.12);
92
+ webkit-box-shadow: 2px 3px 5px 0 rgba(0,0,0,.12);
93
+ box-shadow: 2px 3px 5px 0 rgba(0,0,0,0.12);
94
+ padding: 10px 0 0;
95
+ border-radius: 3px 3px 0 0;
96
+ height: auto;
97
+ overflow: hidden;
98
+ width: 100%;
99
+ z-index: 3;
100
+ height: 50px;
101
+
102
+ }
103
+
104
+ #menu-image-modal-header h2 {
105
+ float: left;
106
+ margin-bottom: 0;
107
+ margin-top: 0px;
108
+ margin-left: 30px;
109
+ padding: 0;
110
+ line-height: 45px;
111
+ font-size: 15px;
112
+ color: rgb(101 98 98 / 87%);
113
+ font-weight: 300;
114
+ cursor: pointer;
115
+ }
116
+ #menu-image-modal-header h2.active {
117
+ border-bottom: 2px solid #6292df;
118
+ font-weight: 600;
119
+ color: #000000de;
120
+ }
121
+
122
+ .menu-image-close-overlay {
123
+ float: right;
124
+ }
125
+ .menu-image-padding-label {
126
+ vertical-align: top;
127
+ }
128
+ .menu-image-close-overlay {
129
+ cursor: pointer;
130
+ }
131
+ .menu-image-close-overlay .dashicons.dashicons-no-alt{
132
+ font-size: 30px;
133
+ margin-right: 20px;
134
+ }
135
+ .menu-image-close-overlay .close-text {
136
+ top: 36px;
137
+ position: absolute;
138
+ }
139
+ .menu-item-icon-type, .menu-item-button-type {
140
+ display: none;
141
+ }
142
+ .menu-image-item-settings-content .submit {
143
+ position: absolute;
144
+ bottom: 0px;
145
+ right: 40px;
146
+ }
147
+ .menu-image-item-settings-overlay {
148
+ overflow-y: auto;
149
+ }
150
+ .menu-image-item-settings-content .menu-item-preview {
151
+ position: absolute;
152
+ top: 60px;
153
+ right: 0px;
154
+ padding: 0px 40px 30px 40px;
155
+ background: #fff;
156
+ width: 22%;
157
+ height: 100%;
158
+ border-left: 1px solid #ccc;
159
+ }
160
+ .prodemo-imgs {
161
+ margin-bottom: 160px;
162
+ border: 1px solid #ccc;
163
+ width: 700px;
164
+ padding-bottom: 10px;
165
+ }
166
+ .prodemo-imgs h4 {
167
+ font-size: 14px;
168
+ line-height: 12px;
169
+ padding: 5px;
170
+ margin: 10px;
171
+ }
172
+ .menu-image-dashicons-list, .menu-image-fontawesome-list {
173
+ max-width: 55vw;
174
+ overflow: scroll;
175
+ height: 50vh;
176
+ overflow-x: hidden;
177
+ }
178
+ .menu-item-preview .title-text {
179
+ padding:10px 20px 10px 20px;
180
+ border: 1px solid #FFF;
181
+ position: relative;
182
+ display: inline-block;
183
+ }
184
+ .mi-button-professional-upgrade {
185
+ background-color: #FF015C;
186
+ border-color: #fff;
187
+ color: #fff;
188
+ margin: 20px 10px 20px 10px;
189
+ text-transform: uppercase;
190
+ min-height: 35px;
191
+ padding: 15px;
192
+ border-radius: 6px;
193
+ margin-left: 20px;
194
+ }
195
+ .mi-button-professional-upgrade:hover {
196
+ color: #FF015C;
197
+ background: aliceblue;
198
+ }
199
+ .menu-image-padding-control label {
200
+ width: 50px;
201
+ display: inline-flex;
202
+ margin-right: 20px;
203
+ }
204
+ .menu-image-padding-control input {
205
+ float: left;
206
+ width: 50px;
207
+ margin-right: 20px;
208
+ }
209
+ .menu-item-preview span {
210
+ font-size: 2em;
211
+ line-height: 1em;
212
+ display: inline-flex;
213
+ }
214
+ .menu-item-preview .menu-image-badge {
215
+ display:none;
216
+ font-weight: 700;
217
+ color: #fff;
218
+ font-size: 10px;
219
+ padding: 3px 4px 3px;
220
+ margin-top: 0px;
221
+ position: relative;
222
+ top: -40px;
223
+ right: 25px;
224
+ text-transform: uppercase;
225
+ line-height: 11px;
226
+ border-radius: 5px;
227
+ letter-spacing: .3px;
228
+ }
229
+ .menu-item-preview .title-text img {
230
+ margin-right: 10px;
231
+ margin-left: 10px;
232
+ }
233
+ .menu-item-preview .menu-image-bubble {
234
+ display: none;
235
+ color: #fff;
236
+ font-size: 15px;
237
+ font-weight: 700;
238
+ top: -22px;
239
+ right: 16px;
240
+ position: relative;
241
+ box-shadow: 0 0 0 .1rem var(--white,#fff);
242
+ border-radius: 25px;
243
+ padding: 1px 6px 3px 5px;
244
+ text-align: center;
245
+ font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
246
+ }
247
+ .menu-item-preview span svg {
248
+ margin-right: 10px;
249
+ margin-left: 10px;
250
+ }
251
+ .above-title.menu-item-preview span svg, .below-title.menu-item-preview span svg {
252
+ margin: auto;
253
+ }
254
+ .menu-item-preview span:hover img:nth-child(2) {
255
+ display: inline-block;
256
+ }
257
+
258
+ .menu-item-preview span:hover .menu-img-normal {
259
+ opacity: 0;
260
+ height: 0px;
261
+ width: 0px;
262
+ margin: 0px;
263
+ }
264
+ .menu-item-preview.item-fill span {
265
+ background: #008000;
266
+ color: #fff;
267
+ }
268
+ .menu-item-preview.item-outline span {
269
+ color: #008000;
270
+ background: #fff;
271
+ border: 1px solid #008000;
272
+ }
273
+ .menu-item-image-options .menu-image-field-holder {
274
+ width: 60%;
275
+ border-bottom: 1px solid #efeeee;
276
+ margin: 10px 20px 20px 10px;
277
+ }
278
+ .menu-item-image-options {
279
+ margin-bottom: 150px;
280
+ }
281
+ .menu-item-images .description-half:nth-child(1) label {
282
+ width: 50px;
283
+ }
284
+ .menu-item-images .description-half:nth-child(2) label {
285
+ width: 115px;
286
+ }
287
+ .menu-image-fontawesome-list svg, .menu-image-fontawesome-list i {
288
+ padding: 10px;
289
+ color: #7b7b7b;
290
+ width: 5%!important;
291
+ }
292
+ .menu-image-dashicons-list .dashicons {
293
+ padding: 10px;
294
+ color: #7b7b7b;
295
+ width: 5%!important;
296
+ }
297
+ .menu-image-dashicons-list .dashicons.menu-item-icon-selected {
298
+ border: 2px solid #428BFF;
299
+ }
300
+ .menu-image-dashicons-list .dashicons {
301
+ border: 2px solid #fff;
302
+ cursor: pointer;
303
+ font-size: 30px;
304
+ }
305
+ .menu-item-preview .dashicons {
306
+ padding: 0px 8px;
307
+ font-size: inherit;
308
+ }
309
+ .menu-image-dashicons-list .dashicons:hover {
310
+ border: 2px solid #cccccc;
311
+ }
312
+ .menu-item-images .set-post-thumbnail.button {
313
+ display: contents;
314
+ }
315
+ .menu-image-icons-list.menu-item-icon-type {
316
+ width: 98%;
317
+ margin-top: 20px;
318
+ }
319
+ .menu-image-fontawesome-list svg.menu-item-icon-selected {
320
+ border: 2px solid #4593d6;
321
+ }
322
+ .menu-image-fontawesome-list svg {
323
+ border: 2px solid #fff;
324
+ cursor: pointer;
325
+ }
326
+ .menu-image-fontawesome-list svg:hover {
327
+ border: 2px solid #cccccc;
328
+ }
329
+ .menu-image-icons-list-header {
330
+ width: 100%;
331
+ display: flex;
332
+ background: #fff;
333
+ margin: 0;
334
+ }
335
+ .menu-image-section-header {
336
+ color: #333;
337
+ font-weight: 600;
338
+ text-align: center;
339
+ border-bottom: 2px solid #6292df;
340
+ min-width: 101px;
341
+ width: 200px;
342
+ line-height: 25px;
343
+ }
344
+ .menu-image-icons-list-header li.active {
345
+ border-bottom: 3px solid #6292df;
346
+ color: #333;
347
+ }
348
+ .menu-image-icons-list-header li {
349
+ width: 80px;
350
+ border-bottom: 3px solid #FFF;
351
+ color:#828d9e;
352
+ padding: 5px;
353
+ cursor: pointer;
354
+ text-align: center;
355
+ font-weight: 600;
356
+ font-size: 14px;
357
+ margin-right: 20px;
358
+ min-width: 120px;
359
+ }
360
+ .menu-image-fa-solid-list, .menu-image-fa-regular-list, .menu-image-fa-brands-list, .menu-image-fontawesome-list, .menu-image-dashicons-list {
361
+ display: none;
362
+ }
363
+ .active.menu-image-fa-solid-list, .active.menu-image-fa-regular-list, .active.menu-image-fa-brands-list, .active.menu-image-fontawesome-list, .active.menu-image-dashicons-list {
364
+ display: block;
365
+ }
366
+ .menu-item-preview.hide-title span.title-text {
367
+ font-size: 0px;
368
+ }
369
+ .above-title.menu-item-preview .title-text img, .below-title.menu-item-preview .title-text img {
370
+ text-align: center;
371
+ margin: auto;
372
+ }
373
+ .menu-image-icons-fa-list-header {
374
+ width: 100%;
375
+ float: left;
376
+ margin: 0px;
377
+ }
378
+ .menu-image-icons-fa-list-header li.active {
379
+ background: #f0f8ff;
380
+ }
381
+ .menu-image-icons-fa-list-header li {
382
+ float: left;
383
+ padding: 5px;
384
+ width: 100px;
385
+ font-weight: 600;
386
+ cursor: pointer;
387
+ background: #f7f7f7;
388
+ margin: 2px;
389
+ }
390
+ .below-title.menu-item-preview span, .above-title.menu-item-preview span {
391
+ display: inline-grid;
392
+ }
393
+ .menu-item-preview.hide-title span.title-text svg {
394
+ font-size: x-large;
395
+ }
396
+ .menu-item-preview .menu-img-hover {
397
+ display: none;
398
+ }
399
+ .menu-image-item-settings-content .menu-image-toast {
400
+ padding: 10px;
401
+ background: #56b980;
402
+ color: #fff;
403
+ position: relative;
404
+ border-radius: 5px;
405
+ margin: auto;
406
+ text-align: center;
407
+ top: 50vh;
408
+ }
409
+ .above-title.menu-item-preview .title-text .dashicons, .below-title.menu-item-preview .title-text .dashicons {
410
+ text-align: center;
411
+ width: auto;
412
+ margin: 5px;
413
+ }
414
+ .menu-item-preview.hide-title span.title-text span {
415
+ font-size: 26px;
416
+ }
417
+ .wp-menu-image-notice {
418
+ padding: 10px;
419
+ }
420
+ /* Custom Css */
421
+ #fs_connect .fs-visual .fs-plugin-icon, #fs_connect .fs-visual .fs-connect-logo, #fs_connect .fs-visual .fs-site-icon {
422
+ border: none;
423
+ }
includes/css/menu-image.css CHANGED
@@ -22,7 +22,7 @@
22
  padding-left: 10px;
23
  }
24
 
25
- .menu-item a.menu-image-title-above, .menu-item a.menu-image-title-below, .menu-image-title.menu-image-title-above, .menu-image-title.menu-image-title-below {
26
  text-align: center;
27
  display: block;
28
  }
@@ -44,4 +44,57 @@
44
  /* Alignment of the Menu items. Divi, Twenty 17*/
45
  #et-top-navigation .nav li.menu-item, .navigation-top .main-navigation li {
46
  display: inline-block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
22
  padding-left: 10px;
23
  }
24
 
25
+ .menu-image-title.menu-image-title-above, .menu-image-title.menu-image-title-below {
26
  text-align: center;
27
  display: block;
28
  }
44
  /* Alignment of the Menu items. Divi, Twenty 17*/
45
  #et-top-navigation .nav li.menu-item, .navigation-top .main-navigation li {
46
  display: inline-block;
47
+ }
48
+
49
+ .above-menu-image-icons, .below-menu-image-icons {
50
+ margin: auto;
51
+ text-align: center;
52
+ display: block;
53
+ }
54
+ ul li.menu-item > .menu-image-title-above.menu-link, ul li.menu-item > .menu-image-title-below.menu-link {
55
+ display: block;
56
+ }
57
+ .menu-item:hover .sub-menu .menu-image-hover-wrapper img.menu-image {
58
+ opacity: 1;
59
+ }
60
+ .menu-item:hover .sub-menu .menu-image-hover-wrapper img.hovered-image {
61
+ opacity: 0;
62
+ }
63
+ .menu-item:hover .sub-menu .menu-item:hover .menu-image-hover-wrapper img.menu-image {
64
+ opacity: 0;
65
+ }
66
+ .menu-item:hover .sub-menu .menu-item:hover .menu-image-hover-wrapper img.hovered-image {
67
+ opacity: 1;
68
+ }
69
+ .menu-item-text span.dashicons {
70
+ display: contents;
71
+ transition: none;
72
+ }
73
+ .menu-image-title .menu-image-badge {
74
+ background-color: rgb(255, 140, 68);
75
+ display: inline;
76
+ font-weight: 700;
77
+ color: #fff;
78
+ font-size: 0.95rem;
79
+ padding: 3px 4px 3px;
80
+ margin-top: 0px;
81
+ position: relative;
82
+ top: -20px;
83
+ right: 10px;
84
+ text-transform: uppercase;
85
+ line-height: 11px;
86
+ border-radius: 5px;
87
+ letter-spacing: .3px;
88
+ }
89
+ .menu-image-title .menu-image-bubble {
90
+ color: #fff;
91
+ font-size: 13px;
92
+ font-weight: 700;
93
+ top: -18px;
94
+ right: 10px;
95
+ position: relative;
96
+ box-shadow: 0 0 0 .1rem var(--white,#fff);
97
+ border-radius: 25px;
98
+ padding: 1px 6px 3px 5px;
99
+ text-align: center;
100
  }
includes/js/menu-image-admin.js CHANGED
@@ -1,39 +1,456 @@
1
  (function ($) {
2
  $(document).ready(function () {
 
3
  var menuImageUpdate = function( item_id, thumb_id, is_hover ) {
 
4
  wp.media.post( 'set-menu-item-thumbnail', {
5
  json: true,
6
  post_id: item_id,
7
  thumbnail_id: thumb_id,
8
- is_hover: is_hover ? 1 : 0,
9
  _wpnonce: menuImage.settings.nonce
10
  }).done( function( html ) {
11
- $('.menu-item-images', '#menu-item-' + item_id).html( html );
12
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  };
14
 
15
- $('#menu-to-edit')
16
- .on('click', '.menu-item .set-post-thumbnail', function (e) {
17
- e.preventDefault();
18
- e.stopPropagation();
19
-
20
- var item_id = $(this).parents('.field-image').siblings('input.menu-item-data-db-id').val(),
21
- is_hover = $(this).hasClass('hover-image'),
22
- uploader = wp.media({
23
- title: menuImage.l10n.uploaderTitle, // todo: translate
24
- button: { text: menuImage.l10n.uploaderButtonText },
25
- multiple: false
26
- }).on('select', function () {
27
- var attachment = uploader.state().get('selection').first().toJSON();
28
- menuImageUpdate( item_id, attachment.id, is_hover );
29
- }).open();
30
- })
31
- .on('click', '.menu-item .remove-post-thumbnail', function (e) {
32
- e.preventDefault();
33
- e.stopPropagation();
34
-
35
- var item_id = $(this).parents('.field-image').siblings('input.menu-item-data-db-id').val();
36
- menuImageUpdate( item_id, -1, $(this).hasClass('hover-image') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  });
39
  })(jQuery);
1
  (function ($) {
2
  $(document).ready(function () {
3
+
4
  var menuImageUpdate = function( item_id, thumb_id, is_hover ) {
5
+ $( '.wp-core-ui .media-modal-icon').trigger( 'click' );
6
  wp.media.post( 'set-menu-item-thumbnail', {
7
  json: true,
8
  post_id: item_id,
9
  thumbnail_id: thumb_id,
10
+ is_hover: is_hover ? 1 : 0,
11
  _wpnonce: menuImage.settings.nonce
12
  }).done( function( html ) {
13
+ $('.menu-item-images').html( html );
14
+
15
+ $( '.menu-item-preview .dashicons' ).remove();
16
+ var new_content_preview = $( '.menu-item-preview span' );
17
+
18
+ $( '.menu-item-preview i, .menu-item-preview svg, .menu-item-preview img' ).remove();
19
+ $( '.menu-item-preview' ).append( new_content_preview );
20
+ $( '.menu-item-preview .title-text' ).prepend( $( '.menu-item-images .set-post-thumbnail img').clone() );
21
+ $( '.menu-image-item-settings-content .menu-item-preview' ).append( '<div class="menu-image-toast">Image was saved successfully</div>' ).fadeIn();
22
+ setTimeout(() => {
23
+ $( '.menu-image-toast' ).fadeOut( '500' ).remove();
24
+ }, 2000);
25
+ });
26
+
27
+
28
  };
29
 
30
+ $(document).on( 'click', '.button.set-post-thumbnail', function (e) {
31
+ e.preventDefault();
32
+ e.stopPropagation();
33
+
34
+ var item_id = $( '.menu-image-item-settings-content' ).attr( 'data-menu-item-id' );
35
+ var is_hover = $(this).hasClass('hover-image');
36
+ var uploader = wp.media({
37
+ title: menuImage.l10n.uploaderTitle, // todo: translate
38
+ button: { text: menuImage.l10n.uploaderButtonText },
39
+ multiple: false
40
+ }).on('select', function () {
41
+ var attachment = uploader.state().get('selection').first().toJSON();
42
+ menuImageUpdate( item_id, attachment.id, is_hover );
43
+ }).open();
44
+ })
45
+
46
+ $(document).on( 'click', '.menu-item-image-options .remove-post-thumbnail', function (e) {
47
+ e.preventDefault();
48
+ e.stopPropagation();
49
+
50
+ var item_id = $( '.menu-image-item-settings-content' ).attr( 'data-menu-item-id' );
51
+
52
+ if ( $( this).hasClass( 'hover-image' ) ) {
53
+ menuImageUpdate( item_id, -1, 1 );
54
+ } else {
55
+ menuImageUpdate( item_id, -1, 0 );
56
+ }
57
+
58
+ })
59
+
60
+ // Control the visibility of the fields related to the option selected.
61
+ $( document ).on( 'change', 'input[name="menu_item_image_title_position"]', function(){
62
+
63
+ var title_position = $( this ).val();
64
+
65
+ if ( title_position == 'above' || title_position == 'before' ) {
66
+ $( '.menu-item-preview .title-text' ).append( jQuery( '.menu-item-preview .title-text i, .menu-item-preview .title-text img, .menu-item-preview .title-text svg, .menu-item-preview .title-text .dashicons' ).detach());
67
+ } else {
68
+ $( '.menu-item-preview .title-text' ).prepend( jQuery( '.menu-item-preview .title-text img, .menu-item-preview .title-text i, .menu-item-preview .title-text svg, .menu-item-preview .title-text .dashicons' ).detach());
69
+ }
70
+
71
+ $( '.menu-item-preview' ).removeClass().addClass( title_position + '-title' ).addClass( 'menu-item-preview' );
72
+
73
+ });
74
+
75
+ // Control the visibility of the fields related to the option selected.
76
+ $( document ).on( 'change', 'input[name="menu_item_image_type"]', function(){
77
+ $( '.menu-item-icon-type, .menu-item-image-type' ).hide();
78
+ $( '.menu-item-' + $( this ).val() + '-type' ).show();
79
+
80
+ if ( $( this ).val() == 'image' ) {
81
+ $( '.menu-item-preview i, .menu-item-preview svg, .menu-item-preview img, .menu-item-preview .dashicons' ).remove();
82
+ $( '.menu-item-preview .title-text' ).prepend( $( '.menu-item-images .set-post-thumbnail img').clone() );
83
+ } else {
84
+ $( '.menu-item-preview i, .menu-item-preview svg, .menu-item-preview img' ).remove();
85
+
86
+ if ( $( '.menu-item-icon-selected' ).hasClass('fa-2x') ) {
87
+ $( '.menu-item-preview span' ).first().prepend( $( '.menu-item-icon-selected' ).clone().removeClass('fa-2x').addClass('fa-1x') );
88
+ } else {
89
+ $( '.menu-item-preview span' ).first().prepend( $( '.menu-item-icon-selected' ).clone() );
90
+ }
91
+
92
+ }
93
+ });
94
+
95
+ $( document ).on( 'change', '#menu_item_image_notification', function(){
96
+ switch( $(this).val() ) {
97
+ case 'none':
98
+ $( '.menu-item-preview .menu-image-badge' ).hide();
99
+ $( '.menu-item-preview .menu-image-bubble' ).hide();
100
+ $( '.menu-image-badge-type' ).hide();
101
+ $( '.menu-image-bubble-type' ).hide();
102
+ break;
103
+ case 'bubble':
104
+ $( '.menu-item-preview .menu-image-badge' ).hide();
105
+ $( '.menu-item-preview .menu-image-bubble' ).toggle();
106
+ $( '.menu-image-badge-type' ).hide();
107
+ $( '.menu-image-bubble-type' ).show();
108
+ break;
109
+ case 'badge':
110
+ $( '.menu-item-preview .menu-image-bubble' ).hide();
111
+ $( '.menu-item-preview .menu-image-badge' ).toggle();
112
+ $( '.menu-image-badge-type' ).show();
113
+ $( '.menu-image-bubble-type' ).hide();
114
+ break;
115
+ }
116
+ });
117
+
118
+ // Control the visibility of the fields related to the button options.
119
+ $( document ).on( 'click', 'input[name="menu_item_button"]', function(){
120
+ $( '.menu-item-button-type' ).toggle();
121
+ updateMenuItemPreview();
122
+ });
123
+
124
+ // Close the settings overlay.
125
+ $( document ).on( 'click', '.menu-image-close-overlay' , function () {
126
+
127
+ $( '.menu-image-item-settings-content' ).fadeOut();
128
+ $( '.menu-image-item-settings-overlay' ).fadeOut();
129
+ $( 'body').css( 'overflow-y', 'initial' );
130
+ return false;
131
+
132
+ });
133
+
134
+ });
135
+
136
+ $( '#menu-to-edit li.menu-item' ).each( function() {
137
+
138
+ var menu_item = $(this);
139
+ $( '.item-title', menu_item ).append( $( "<i class='menu-image-item-settings mob-icon-mobile-2'><span class='dashicons dashicons-admin-generic'></span><span>Menu Image</span></i>" ) );
140
+
141
+ });
142
+
143
+ // Update Preview - When changing Border Radius.
144
+ $( document ).on( 'change', '#menu_item_image_border_radius, #menu_item_image_bt_padding_top, #menu_item_image_bt_padding_bottom, #menu_item_image_bt_padding_left, #menu_item_image_bt_padding_right', function (){
145
+ updateMenuItemPreview();
146
+ });
147
+
148
+ // Update Preview - When changing Button Color.
149
+ $( document ).on( 'change', 'input[name=menu_item_image_button_style]', function( e ) {
150
+ var color = $( '.menu-image-button-color' ).val();
151
+
152
+ if ( $( this ).val() == 'outline' ) {
153
+ $( '.menu-item-preview .title-text' ).css( 'border', '1px solid ' + color );
154
+ } else {
155
+ $( '.menu-item-preview .title-text' ).css( 'border', '1px solid #F3F3F3' );
156
+ }
157
+
158
+ });
159
+
160
+ $( document ).on( 'keyup', '#menu_item_badge_text', function(){
161
+ $( '.menu-image-badge' ).text( $( this ).val() );
162
+ });
163
+
164
+ $( document ).on( 'click', '.menu-image-fontawesome-list svg, .menu-image-fontawesome-list i, .menu-image-dashicons-list .dashicons', function(){
165
+
166
+ $( '.menu-item-icon-selected' ).removeClass( 'menu-item-icon-selected' );
167
+ $( this ).addClass( 'menu-item-icon-selected' );
168
+ $( '.menu-item-preview i, .menu-item-preview svg, .menu-item-preview img, .menu-item-preview .dashicons' ).remove();
169
+
170
+ var new_content_preview = $( '.menu-item-preview span' );
171
+
172
+ $( '.menu-item-preview' ).append( new_content_preview );
173
+
174
+
175
+ if ( $( '.menu-item-preview' ).hasClass( 'below-title' ) || $( '.menu-item-preview' ).hasClass( 'after-title' ) ) {
176
+ $( '.menu-item-preview span' ).first().prepend( $( '.menu-item-icon-selected' ).clone().removeClass('fa-2x').addClass('fa-1x') );
177
+ }
178
+ if ( $( '.menu-item-preview' ).hasClass( 'above-title' ) || $( '.menu-item-preview' ).hasClass( 'before-title' ) || $( '.menu-item-preview' ).hasClass( 'hide-title' ) ) {
179
+ $( '.menu-item-preview span' ).first().append( $( '.menu-item-icon-selected' ).clone().removeClass('fa-2x').addClass('fa-1x') );
180
+ }
181
+ });
182
+
183
+ $( document ).on( 'click', '#menu-image-modal-header h2', function(){
184
+ $( '#menu-image-modal-header h2' ).removeClass('active' );
185
+ $( '.menu-image-container' ).hide();
186
+ $( '.' + $( this ).attr('data-target')).show();
187
+ $( this ).addClass( 'active' );
188
+ });
189
+
190
+ $( document ).on( 'click', '.menu-image-icons-list-header li', function(){
191
+ $( '.menu-image-icons-list-header li, .menu-image-fontawesome-list, .menu-image-dashicons-list' ).removeClass( 'active' );
192
+ $( '.menu-image-' + $( this ).attr( 'data-tab-id' ) ).addClass( 'active' );
193
+ $( this ).addClass( 'active' );
194
+ });
195
+
196
+ $( document ).on( 'click', '.menu-image-icons-fa-list-header li', function(){
197
+ $( '.menu-image-fa-regular-list, .menu-image-fa-solid-list, .menu-image-fa-brands-list, .menu-image-icons-fa-list-header li' ).removeClass( 'active' );
198
+ $( '.menu-image-' + $( this ).attr( 'data-tab-id' ) ).addClass( 'active' );
199
+
200
+ $( this ).addClass( 'active' );
201
+ });
202
+
203
+ $( document ).on( 'click', '.menu-image-item-settings-content #submit' , function( e ) {
204
+
205
+ e.preventDefault();
206
+ $( this ).attr( 'disabled', true);
207
+ var menu_item_id = $( '.menu-image-item-settings-content' ).attr( 'data-menu-item-id' );
208
+ var border_radius = $( '#menu_item_image_border_radius' ).val();
209
+ var button_color = $( '.menu-image-button-color' ).val();
210
+ var button_bg_color = $( '.menu-image-button-bg-color' ).val();
211
+ var button_padding_top = $( '#menu_item_image_bt_padding_top' ).val();
212
+ var button_padding_left = $( '#menu_item_image_bt_padding_left' ).val();
213
+ var button_padding_right = $( '#menu_item_image_bt_padding_right' ).val();
214
+ var button_padding_bottom = $( '#menu_item_image_bt_padding_bottom' ).val();
215
+ var button_style = $( 'input[name="menu_item_image_button_style"]:checked' ).val();
216
+ var select_icon = '';
217
+ var title_position = $( 'input[name="menu_item_image_title_position"]:checked' ).val();
218
+ var item_image_type = $( 'input[name="menu_item_image_type"]:checked' ).val();
219
+ var item_image_notification = $( '#menu_item_image_notification' ).val();
220
+ var menu_item_button = $( 'input[name="menu_item_button"]' ).is(':checked');
221
+ var bubble_color = $( '.menu-image-bubble-color' ).val();
222
+ var bubble_func = $( '#menu_item_bubble_number_func' ).val();
223
+ var badge_text = $( '#menu_item_badge_text' ).val();
224
+ var badge_color = $( '.menu-image-badge-color' ).val();
225
+
226
+ var menuImageData = {
227
+ action : 'set-menu-item-settings',
228
+ menu_item_id: menu_item_id,
229
+ menu_item_image_title_position: title_position,
230
+ menu_item_image_type: item_image_type,
231
+ }
232
+
233
+ if ( $( '.menu-item-icon-selected' ).length > 0 ) {
234
+ if ( $( '.menu-item-icon-selected' ).hasClass( 'dashicons') ) {
235
+ var cloneIcon = $( '.menu-item-icon-selected' ).clone();
236
+ cloneIcon.removeClass('menu-item-icon-selected').removeClass( 'dashicons' );
237
+ select_icon = cloneIcon.attr('class').trim()
238
+ } else {
239
+ select_icon = $( '.menu-item-icon-selected' ).attr( 'data-prefix' ) + ' fa-' + $( '.menu-item-icon-selected' ).attr( 'data-icon' );
240
+ }
241
+ menuImageData.menu_image_icon = select_icon;
242
+
243
+ }
244
+
245
+ // Collect the Notification data (badges, bubble)
246
+ menuImageData.menu_item_image_notification = item_image_notification;
247
+
248
+ if ( item_image_notification == 'bubble' ) {
249
+ menuImageData.bubble_color = bubble_color;
250
+ menuImageData.bubble_func = bubble_func;
251
+ }
252
+
253
+ if ( item_image_notification == 'badge' ) {
254
+ menuImageData.badge_text = badge_text;
255
+ menuImageData.badge_color = badge_color;
256
+ }
257
+
258
+ // Collect button data.
259
+ menuImageData.menu_item_image_button = menu_item_button;
260
+ menuImageData.menu_item_image_button = menu_item_button;
261
+ menuImageData.menu_image_button_bg_color = button_bg_color;
262
+ menuImageData.menu_item_button_border_radius = border_radius;
263
+ menuImageData.menu_image_button_color = button_color;
264
+ menuImageData.menu_image_button_style = button_style;
265
+ menuImageData.menu_image_button_pd_top = button_padding_top;
266
+ menuImageData.menu_image_button_pd_left = button_padding_left;
267
+ menuImageData.menu_image_button_pd_right = button_padding_right;
268
+ menuImageData.menu_image_button_pd_bottom = button_padding_bottom;
269
+
270
+ // Send the data to be saved.
271
+ $.ajax({
272
+ type: 'POST',
273
+ url: ajaxurl,
274
+ data: menuImageData,
275
+ success: function( response ) {
276
+ $( '.menu-image-item-settings-content .menu-item-preview' ).append( '<div class="menu-image-toast">Changes saved successfully</div>' ).fadeIn();
277
+ setTimeout(() => {
278
+ $( '.menu-image-toast' ).fadeOut( '500' ).remove();
279
+ }, 2000);
280
+
281
+ $( 'input[name="submit"] ').attr('disabled' , false );
282
+ }
283
+ });
284
+
285
+ e.preventDefault();
286
+ });
287
+
288
+ $( document ).on( 'click', '.menu-image-item-settings' , function( e ) {
289
+
290
+ e.preventDefault();
291
+
292
+ var menu_item = $( this ).parent().parent().parent().parent();
293
+ var menu_title = $(this).parent().parent().find( '.menu-item-title' ).text();
294
+ var menu_id = $( '#menu' ).val();
295
+ var id = parseInt( menu_item.attr( 'id' ).match(/[0-9]+/)[0], 10);
296
+
297
+ $.ajax({
298
+ type: 'POST',
299
+ url: ajaxurl,
300
+ data: {
301
+ action: 'get_menu_image_item_settings',
302
+ menu_item_id: id,
303
+ menu_id: menu_id,
304
+ menu_title: menu_title
305
+ },
306
+
307
+ success: function( response ) {
308
+ if ( $( '.menu-image-item-settings-content' ).length ) {
309
+ $( '.menu-image-item-settings-content' ).replaceWith( response );
310
+ $( '.menu-image-item-settings-overlay' ).fadeIn();
311
+ } else {
312
+ $( 'body' ).append( response );
313
+ $( 'body' ).append( '<div class="menu-image-item-settings-overlay"></div>' );
314
+ }
315
+
316
+ $( 'body').css( 'overflow-y', 'hidden' );
317
+ $( '#menu-image-modal-body' ).scrollTop( $( '.mobmenu-item-selected' ).offset() - 250 );
318
+ $( '.menu-image-item-settings-content' ).attr( 'data-menu-id', menu_id );
319
+ $( '.menu-image-item-settings-content' ).attr( 'data-menu-item-id' , id );
320
+
321
+ if ( $( 'input[name="menu_item_image_type"]:checked' ).val() == 'image' ) {
322
+ // Load Menu Images on Preview.
323
+ if ( $( '.menu-item-images .set-post-thumbnail img' ).length > 0 ) {
324
+ $( '.menu-item-preview .title-text' ).prepend( $( '.menu-item-images .set-post-thumbnail img' ).clone() );
325
+ }
326
+ $( '.menu-item-image-type' ).show();
327
+ $( '.menu-item-icon-type' ).hide();
328
+ } else {
329
+ $( '.menu-item-icon-type' ).show();
330
+ $( '.menu-item-image-type' ).hide();
331
+ $( '.menu-item-preview span' ).first().prepend( $( '.menu-item-icon-selected' ).clone().removeClass('fa-2x').addClass('fa-1x') );
332
+ }
333
+
334
+ // Load Badge color.
335
+ $( '.menu-image-badge' ).css( 'background-color', $( '.menu-image-badge-color' ).val() );
336
+
337
+ // Load Bubble color.
338
+ $( '.menu-image-bubble' ).css( 'background-color', $( '.menu-image-bubble-color' ).val() );
339
+
340
+ // Load menu item notification.
341
+ $( '#menu_item_image_notification' ).trigger( 'change' );
342
+
343
+ // Set the icons active tab.
344
+ if ( $( '.menu-item-icon-selected' ).hasClass( 'fa-2x') ) {
345
+ $( '.menu-image-icons-list-header li[data-tab-id="fontawesome-list"]' ).addClass( 'active' );
346
+ } else {
347
+ $( '.menu-image-icons-list-header li[data-tab-id="dashicons-list"]' ).addClass( 'active' );
348
+ }
349
+
350
+ // Load the Menu item as button option.
351
+ if ( $( 'input[name="menu_item_button"]' ).is( ':checked' ) ) {
352
+ $( '.menu-item-button-type' ).toggle();
353
+ updateMenuItemPreview();
354
+ }
355
+
356
+ $( '.menu-image-item-settings-content .menu-item-preview').hide();
357
+
358
+ setTimeout(() => {
359
+ // Load Title Position.
360
+ $( 'input[name="menu_item_image_title_position"]:checked' ).trigger( 'change' );
361
+ $( '.menu-image-item-settings-content .menu-item-preview').fadeIn();
362
+ }, 200);
363
+
364
+ $( '.menu-image-color-picker').wpColorPicker({
365
+ /**
366
+ * @param {Event} event - standard jQuery event, produced by whichever
367
+ * control was changed.
368
+ * @param {Object} ui - standard jQuery UI object, with a color member
369
+ * containing a Color.js object.
370
+ */
371
+ change: function (event, ui) {
372
+ var element = event.target;
373
+ var color = ui.color.toString();
374
+
375
+ // Button Color.
376
+ if ( $( element ).hasClass( 'menu-image-button-color' ) ) {
377
+
378
+ if ( $( 'input[name=menu_item_image_button_style]:checked' ).val() == 'outline' ) {
379
+ $( '.menu-item-preview .title-text' ).css( 'border', '1px solid ' + color );
380
+ }
381
+ $( '.menu-item-preview .title-text' ).css('color', color );
382
+ }
383
+
384
+ // Button Background Color.
385
+ if ( $( element ).hasClass( 'menu-image-button-bg-color' ) ) {
386
+ $( '.menu-item-preview .title-text' ).css( 'background-color', color );
387
+ }
388
+
389
+ // Bubble Color.
390
+ if ( $( element ).hasClass( 'menu-image-bubble-color' ) ) {
391
+ $( '.menu-image-bubble' ).css( 'background-color', color );
392
+ }
393
+
394
+ // Badge Color.
395
+ if ( $( element ).hasClass( 'menu-image-badge-color' ) ) {
396
+ $( '.menu-image-badge' ).css( 'background-color', color );
397
+ }
398
+ },
399
+ });
400
+ }
401
+
402
  });
403
+
404
+ e.stopPropagation();
405
+ return false;
406
+ });
407
+
408
+ function updateMenuItemPreview() {
409
+
410
+ var color = '#444';
411
+ var bgcolor = '#FFF';
412
+ var border_radius = '10';
413
+ var pad_top = '0';
414
+ var pad_bottom = '0';
415
+ var pad_left = '0';
416
+ var pad_right = '0';
417
+
418
+ // If button option is enabled.
419
+ if ( $( 'input[name="menu_item_button"]' ).is(':checked') ) {
420
+
421
+ border_radius = $('#menu_item_image_border_radius' ).val() + 'px';
422
+ color = $( '.menu-image-button-color' ).val();
423
+ bgcolor = $( '.menu-image-button-bg-color' ).val();
424
+ pad_top = $( '#menu_item_image_bt_padding_top' ).val();
425
+ pad_bottom = $( '#menu_item_image_bt_padding_bottom' ).val();
426
+ pad_left = $( '#menu_item_image_bt_padding_left' ).val();
427
+ pad_right = $( '#menu_item_image_bt_padding_right' ).val();
428
+
429
+ // Check if the button style is Outline or Fill.
430
+ if ( $( 'input[name=menu_item_image_button_style]:checked' ).val() == 'outline' ) {
431
+ $( '.menu-item-preview .title-text' ).css( 'border', '1px solid ' + color );
432
+ }
433
+
434
+ // Update Preview - When changing Padding Fields.
435
+ $( '.menu-item-preview .title-text' ).css( 'padding', pad_top + 'px ' + pad_right + 'px ' + pad_bottom + 'px ' + pad_left + 'px ');
436
+ } else {
437
+ $( '.menu-item-preview .title-text' ).css( 'border', '1px solid #FFF' );
438
+ }
439
+
440
+ $( '.menu-item-preview .title-text' ).css( 'border-radius', border_radius );
441
+ $( '.menu-item-preview .title-text' ).css( 'color', color );
442
+ $( '.menu-item-preview .title-text' ).css( 'background-color', bgcolor );
443
+ }
444
+ $( document ).on( 'click', '.wp-menu-image-notice .notice-dismiss' , function( e ) {
445
+
446
+ $.ajax({
447
+ type: 'POST',
448
+ url: ajaxurl,
449
+
450
+ data: {
451
+ action: 'dismiss_wp_menu_image_fa',
452
+ security: $( this ).parent().attr( 'data-ajax-nonce' )
453
+ }
454
+ });
455
  });
456
  })(jQuery);
menu-image.php CHANGED
@@ -1,1177 +1,2027 @@
1
  <?php
 
2
  /**
3
  * @package Menu_Image
4
- * @version 2.9.7
5
  * @licence GPLv2
6
  */
7
-
8
  /*
9
  Plugin Name: Menu Image
10
- Plugin URI: https://www.jedipress.com
11
  Description: Improve your navigation menu items with images, logos, icons, buttons.
12
  Author: Rui Guerreiro
13
- Version: 2.9.7
14
- Author URI: https://www.jedipress.com
 
15
  */
16
-
17
-
 
 
 
 
18
  /**
19
  * Provide attaching images to menu items.
20
  *
21
  * @package Menu_Image
22
  */
23
- class Menu_Image_Plugin {
24
-
25
- private $image_size_1 = '';
26
- private $image_size_2 = '';
27
- private $image_size_3 = '';
28
-
29
- /**
30
- * Self provided image sizes for most menu usage.
31
- *
32
- * @var array
33
- */
34
- protected $image_sizes = array();
35
-
36
- public $mi_fs;
37
- /**
38
- * List of used attachment ids grouped by size.
39
- *
40
- * Need to list all ids to prevent Jetpack Phonon in image_downsize filter.
41
- *
42
- * @var array
43
- */
44
- private $used_attachments = array();
45
-
46
- /**
47
- * List of file extensions that allowed to resize and display as image.
48
- *
49
- * @var array
50
- */
51
- private $additionalDisplayableImageExtensions = array( 'ico' );
52
-
53
- /**
54
- * List of processed menu item ids.
55
- *
56
- * Mark item id as processed for new core version, 'cause old themes
57
- * doesn't supports filters like `nav_menu_link_attributes` and the only
58
- * way is to override whole element in filter `walker_nav_menu_start_el`.
59
- *
60
- * @var array
61
- */
62
- private $processed = array();
63
-
64
- /**
65
- * Plugin constructor, add all filters and actions.
66
- */
67
- public function __construct() {
68
-
69
- $this->image_size_1 = get_option( 'menu_image_size_1', '24x24' );
70
- $this->image_size_2 = get_option( 'menu_image_size_2', '36x36' );
71
- $this->image_size_3 = get_option( 'menu_image_size_3', '48x48' );
72
-
73
- $image_parts_1 = explode('x', $this->image_size_1);
74
- $image_parts_2 = explode('x', $this->image_size_2);
75
- $image_parts_3 = explode('x', $this->image_size_3);
76
-
77
- /**
78
- * Self provided image sizes for most menu usage.
79
- *
80
- * @var array
81
- */
82
- $this->image_sizes = array(
83
- 'menu-' . $this->image_size_1 => array( $image_parts_1[0], $image_parts_1[1], false ),
84
- 'menu-' . $this->image_size_2 => array( $image_parts_2[0], $image_parts_2[1], false ),
85
- 'menu-' . $this->image_size_3 => array( $image_parts_3[0], $image_parts_3[1], false ),
86
- );
87
-
88
- // Add new admin menu options page for Menu image.
89
- add_action( 'admin_menu', array( $this, 'create_menu_image_options_page' ) );
90
- // Register Menu Image settings.
91
- add_action( 'admin_init', array( $this, 'register_mysettings' ) );
92
- // Init Freemius.
93
- $this->mi_fs = $this->mi_fs();
94
- // Uninstall Action.
95
- $this->mi_fs->add_action( 'after_uninstall', array( $this, 'mm_fs_uninstall_cleanup' ) );
96
- // Freemius is loaded.
97
- do_action( 'mi_fs_loaded' );
98
-
99
- // Actions.
100
- add_action( 'init', array( $this, 'menu_image_init' ) );
101
- add_action( 'save_post_nav_menu_item', array( $this, 'menu_image_save_post_action' ), 10, 3 );
102
- add_action( 'admin_head-nav-menus.php', array( $this, 'menu_image_admin_head_nav_menus_action' ) );
103
- add_action( 'wp_enqueue_scripts', array( $this, 'menu_image_add_inline_style_action' ) );
104
- add_action( 'admin_action_delete-menu-item-image', array( $this, 'menu_image_delete_menu_item_image_action' ) );
105
- add_action( 'wp_ajax_set-menu-item-thumbnail', array( $this, 'wp_ajax_set_menu_item_thumbnail' ) );
106
-
107
- // Add support of WPML menus sync.
108
- add_action( 'wp_update_nav_menu_item', array( $this, 'wp_update_nav_menu_item_action' ), 10, 2 );
109
- add_action( 'admin_init', array( $this, 'admin_init' ), 99 );
110
-
111
- // Filters.
112
-
113
- add_filter( 'wp_setup_nav_menu_item', array( $this, 'menu_image_wp_setup_nav_menu_item' ) );
114
- add_filter( 'nav_menu_link_attributes', array( $this, 'menu_image_nav_menu_link_attributes_filter' ), 10, 4 );
115
- add_filter( 'manage_nav-menus_columns', array( $this, 'menu_image_nav_menu_manage_columns' ), 11 );
116
- add_filter( 'nav_menu_item_title', array( $this, 'menu_image_nav_menu_item_title_filter' ), 10, 4 );
117
- add_filter( 'the_title', array( $this, 'menu_image_nav_menu_item_title_filter' ), 10, 4 );
118
-
119
- // Add support for additional image types.
120
- add_filter( 'file_is_displayable_image', array( $this, 'file_is_displayable_image' ), 10, 2 );
121
- add_filter( 'jetpack_photon_override_image_downsize', array( $this, 'jetpack_photon_override_image_downsize_filter' ), 10, 2 );
122
- add_filter( 'wp_get_attachment_image_attributes', array( $this, 'wp_get_attachment_image_attributes' ), 99, 3 );
123
-
124
- // Add support for Max Megamenu.
125
- if ( function_exists( 'max_mega_menu_is_enabled' ) ) {
126
- add_filter( 'megamenu_nav_menu_link_attributes', array( $this, 'menu_image_nav_menu_link_attributes_filter' ), 10, 3 );
127
- add_filter( 'megamenu_the_title', array( $this, 'menu_image_nav_menu_item_title_filter' ), 10, 2 );
128
- }
129
-
130
- }
131
-
132
- /**
133
- * Admin init action with lowest execution priority
134
- */
135
- public function admin_init() {
136
- // Add custom field for menu edit walker
137
- if ( ! has_action( 'wp_nav_menu_item_custom_fields' ) ) {
138
- add_filter( 'wp_edit_nav_menu_walker', array( $this, 'menu_image_edit_nav_menu_walker_filter' ) );
139
- }
140
- add_action( 'wp_nav_menu_item_custom_fields', array( $this, 'menu_item_custom_fields' ), 10, 4 );
141
- }
142
-
143
- /**
144
- * Create a helper function for easy SDK access
145
- */
146
- public function mi_fs() {
147
- global $mi_fs;
148
-
149
- if ( ! isset( $mi_fs ) ) {
150
- // Include Freemius SDK.
151
- require_once dirname( __FILE__ ) . '/freemius/start.php';
152
-
153
- $mi_fs = fs_dynamic_init( array(
154
- 'id' => '4123',
155
- 'slug' => 'menu-image',
156
- 'premium_slug' => 'menu-image-premium',
157
- 'type' => 'plugin',
158
- 'public_key' => 'pk_1a1cac31f5af1ba3d31bd86fe0e8b',
159
- 'is_premium' => false,
160
- 'has_addons' => false,
161
- 'has_paid_plans' => false,
162
- 'menu' => array(
163
- 'slug' => 'menu-image-options',
164
- 'account' => false,
165
- ),
166
- ) );
167
- }
168
-
169
- return $mi_fs;
170
- }
171
-
172
- /**
173
- * Filter adds additional validation for image type
174
- *
175
- * @param bool $result
176
- * @param string $path
177
- *
178
- * @return bool
179
- */
180
- public function file_is_displayable_image( $result, $path ) {
181
- if ( $result ) {
182
- return true;
183
- }
184
- $fileExtension = pathinfo( $path, PATHINFO_EXTENSION );
185
-
186
- return in_array( $fileExtension, $this->additionalDisplayableImageExtensions );
187
- }
188
-
189
- /**
190
- * Create the Menu Image options page
191
- */
192
- public function create_menu_image_options_page() {
193
- add_menu_page(
194
- 'Menu Image',
195
- 'Menu Image',
196
- 'manage_options',
197
- 'menu-image-options',
198
- array( $this, 'menu_image_options_page_html' ) ,
199
- 'dashicons-menu',
200
- 150
201
- );
202
- }
203
-
204
- /**
205
- * Validade Options form submission.
206
- */
207
- public function handle_options_form(){
208
- if( ! isset( $_POST['menu_image_form'] ) || ! wp_verify_nonce( $_POST['menu_image_form'], 'menu_image_options_update' ) ) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  <div class="error">
210
- <p><?php _e( 'Sorry, your nonce was not correct. Please try again.', 'menu-image' );?></p>
 
 
211
  </div>
212
- <?php
213
- } else {
214
-
215
- // Handle our form data.
216
- $enable_menu_image_hover = '0';
217
-
218
- // If the value of the Menu Image Hover is set.
219
- if ( isset( $_POST['menu_image_hover'] ) ) {
220
- $enable_menu_image_hover = $_POST['menu_image_hover'];
221
- }
222
-
223
- $menu_image_size_1 = $_POST['menu_image_size_1'];
224
- $menu_image_size_2 = $_POST['menu_image_size_2'];
225
- $menu_image_size_3 = $_POST['menu_image_size_3'];
226
- $image_parts_1 = explode('x', $menu_image_size_1);
227
- $image_parts_2 = explode('x', $menu_image_size_2);
228
- $image_parts_3 = explode('x', $menu_image_size_3);
229
-
230
- // Validate the menu image size format.
231
- if ( 2 === count( $image_parts_1 ) && 2 === count( $image_parts_2 ) && 2 === count( $image_parts_3 )) {
232
- update_option( 'menu_image_size_1', $menu_image_size_1 );
233
- update_option( 'menu_image_size_2', $menu_image_size_2 );
234
- update_option( 'menu_image_size_3', $menu_image_size_3 );
235
- update_option( 'menu_image_hover', $enable_menu_image_hover );
236
- ?>
 
 
 
237
  <div class="updated">
238
- <p><?php _e( 'Your Menu Image settings were saved!', 'menu-image' );?></p>
 
 
239
  </div>
240
- <?php
241
- } else { ?>
 
242
  <div class="error">
243
- <p><?php _e( 'Sorry, your image size format is not correct. Please try again.', 'menu-image' );?></p>
 
 
244
  </div>
245
- <?php
246
- }
247
- }
248
- }
249
-
250
- /**
251
- * Create the Menu Image options page HTML
252
- */
253
- public function menu_image_options_page_html() {
254
-
255
- // check user capabilities.
256
- if ( ! current_user_can( 'manage_options' ) ) {
257
- return;
258
- }
259
-
260
- // check if we are updating the options.
261
- if ( isset( $_POST['updated'] ) && 'true' === $_POST['updated'] ) {
262
- $this->handle_options_form();
263
- }
264
-
265
- ?>
266
- <div class="wrap">
267
- <h1><?php _e( 'Menu Image Settings', 'menu-image' ); ?></h1>
268
-
269
- <form method="POST">
270
- <?php wp_nonce_field( 'menu_image_options_update', 'menu_image_form' ); ?>
271
- <?php settings_fields( 'menu-image-settings-group' ); ?>
272
- <?php do_settings_sections( 'menu-image-settings-group' ); ?>
273
- <input type="hidden" name="updated" value="true" />
274
- <table class="form-table">
275
- <tr valign="top">
276
- <th scope="row"><?php _e( 'Menu image Hover', 'menu-image' );?></th>
277
- <td><input name="menu_image_hover" type="checkbox" value="1" <?php checked( '1', get_option( 'menu_image_hover', '1' ) ); ?> /><span class="helper"><?php _e( 'Enable the image on hover field', 'menu-image' ); ?></span></td>
278
- </tr>
279
- <tr valign="top">
280
- <th><h3><?php _e( 'Menu Image sizes ', 'menu-image' );?></h3></th>
281
- </tr>
282
- <tr valign="top">
283
- <th scope="row"><?php _e( '1st Menu Image size ', 'menu-image' );?></th>
284
- <td><input name="menu_image_size_1" type="text" value="<?php echo get_option( 'menu_image_size_1', '24x24' ) ; ?>" /><span class="helper"><?php _e( 'Use this format (24x24), width and height.', 'menu-image' ); ?></span></td>
285
- </tr>
286
- <tr>
287
- <th scope="row"><?php _e( '2nd Menu Image size ', 'menu-image' );?></th>
288
- <td><input name="menu_image_size_2" type="text" value="<?php echo get_option( 'menu_image_size_2', '36x36' ) ; ?>" /><span class="helper"><?php _e( 'Use this format (36x36), width and height.', 'menu-image' ); ?></span></td>
289
- </tr>
290
- <tr>
291
- <th scope="row"><?php _e( '3rd Menu Image size ', 'menu-image' );?></th>
292
- <td><input name="menu_image_size_3" type="text" value="<?php echo get_option( 'menu_image_size_3', '48x48' ) ; ?>" /><span class="helper"><?php _e( 'Use this format (48x48), width and height.', 'menu-image' ); ?></span></td>
293
- </tr>
294
- <tr>
295
- <th scope="row"><?php _e( 'Warning:', 'menu-image' );?></th>
296
- <td><span class="helper"> If you change the image sizes after uploading the images you will need to regenerate all thumbnails using this </span><a href="https://wordpress.org/plugins/regenerate-thumbnails/" target="_blank">plugin</a>.<p>It will also be necessary to select the icon image again in the menu items if you replaced any of the used custom image sizes.</p></td>
297
- </tr>
298
- </table>
299
-
300
- <?php submit_button(); ?>
301
- </form>
302
- </div>
303
- <?php
304
- }
305
-
306
- /**
307
- * Register Menu Image settings
308
- */
309
- public function register_mysettings() {
310
- register_setting( 'menu-image-settings-group', 'menu_image_hover' );
311
- register_setting( 'menu-image-settings-group', 'menu_image_size_1' );
312
- register_setting( 'menu-image-settings-group', 'menu_image_size_2' );
313
- register_setting( 'menu-image-settings-group', 'menu_image_size_3' );
314
- }
315
-
316
- /**
317
- * Initialization action.
318
- *
319
- * Adding image sizes for most popular menu icon sizes. Adding thumbnail
320
- * support to menu post type.
321
- */
322
- public function menu_image_init() {
323
- add_post_type_support( 'nav_menu_item', array( 'thumbnail' ) );
324
-
325
- $this->image_sizes = apply_filters( 'menu_image_default_sizes', $this->image_sizes );
326
- if ( is_array( $this->image_sizes ) ) {
327
- foreach ( $this->image_sizes as $name => $params ) {
328
- add_image_size( $name, $params[0], $params[1], ( array_key_exists( 2, $params ) ? $params[2] : false ) );
329
  }
330
- }
331
- load_plugin_textdomain( 'menu-image', false, basename( dirname( __FILE__ ) ) . '/languages' );
332
-
333
- }
334
-
335
- /**
336
- * Adding images as screen options.
337
- *
338
- * If not checked screen option 'image', uploading form not showed.
339
- *
340
- * @param array $columns
341
- *
342
- * @return array
343
- */
344
- public function menu_image_nav_menu_manage_columns( $columns ) {
345
- return $columns + array( 'image' => __( 'Image', 'menu-image' ) );
346
- }
347
-
348
- /**
349
- * Saving post action.
350
- *
351
- * Saving uploaded images and attach/detach to image post type.
352
- *
353
- * @param int $post_id
354
- * @param WP_Post $post
355
- */
356
- public function menu_image_save_post_action( $post_id, $post ) {
357
- $menu_image_settings = array(
358
- 'menu_item_image_size',
359
- 'menu_item_image_title_position',
360
- );
361
- foreach ( $menu_image_settings as $setting_name ) {
362
- if ( isset( $_POST[ $setting_name ][ $post_id ] ) && ! empty( $_POST[ $setting_name ][ $post_id ] ) ) {
363
- if ( $post->{"_$setting_name"} != $_POST[ $setting_name ][ $post_id ] ) {
364
- update_post_meta( $post_id, "_$setting_name", esc_sql( $_POST[ $setting_name ][ $post_id ] ) );
365
- }
366
  }
367
- }
368
- }
369
-
370
- /**
371
- * Save item settings while WPML sync menus.
372
- *
373
- * @param $item_menu_id
374
- * @param $menu_item_db_id
375
- */
376
- public function wp_update_nav_menu_item_action( $item_menu_id, $menu_item_db_id ) {
377
- global $sitepress, $icl_menus_sync;
378
- if ( class_exists( 'SitePress' ) && $sitepress instanceof SitePress && class_exists( 'ICLMenusSync' ) && $icl_menus_sync instanceof ICLMenusSync ) {
379
- static $run_times = array();
380
- $menu_image_settings = array(
381
- 'menu_item_image_size',
382
- 'menu_item_image_title_position',
383
- 'thumbnail_id',
384
- 'thumbnail_hover_id',
385
- );
386
-
387
- // iterate synchronized menus.
388
- foreach ( $icl_menus_sync->menus as $menu_id => $menu_data ) {
389
- if ( ! isset( $_POST[ 'sync' ][ 'add' ][ $menu_id ] ) ) {
390
- continue;
391
- }
392
-
393
- // remove cache and get language current item menu.
394
- $cache_key = md5( serialize( array( $item_menu_id, 'tax_nav_menu' ) ) );
395
- $cache_group = 'get_language_for_element';
396
- wp_cache_delete( $cache_key, $cache_group );
397
- $lang = $sitepress->get_language_for_element( $item_menu_id, 'tax_nav_menu' );
398
-
399
- if ( ! isset( $run_times[ $menu_id ][ $lang ] ) ) {
400
- $run_times[ $menu_id ][ $lang ] = 0;
401
- }
402
-
403
- // Count static var for each menu id and saved item language
404
- // and get original item id from counted position of synchronized
405
- // items from POST data. That's all magic.
406
- $post_item_ids = array();
407
- foreach ( $_POST['sync']['add'][ $menu_id ] as $id => $lang_array ) {
408
- if ( array_key_exists( $lang, $lang_array ) ) {
409
- $post_item_ids[ ] = $id;
410
- }
411
- }
412
- if ( ! array_key_exists( $run_times[ $menu_id ][ $lang ], $post_item_ids ) ) {
413
- continue;
414
- }
415
- $orig_item_id = $post_item_ids[ $run_times[ $menu_id ][ $lang ] ];
416
-
417
- // iterate all item settings and save it for new item.
418
- $orig_item_meta = get_metadata( 'post', $orig_item_id );
419
- foreach ( $menu_image_settings as $meta ) {
420
- if ( isset( $orig_item_meta[ "_$meta" ] ) && isset( $orig_item_meta[ "_$meta" ][0] ) ) {
421
- update_post_meta( $menu_item_db_id, "_$meta", $orig_item_meta[ "_$meta" ][0] );
422
- }
423
- }
424
- $run_times[ $menu_id ][ $lang ] ++;
425
- break;
426
- }
427
- }
428
- }
429
-
430
- /**
431
- * Replacement edit menu walker class.
432
- *
433
- * @return string
434
- */
435
- public function menu_image_edit_nav_menu_walker_filter() {
436
- return 'Menu_Image_Walker_Nav_Menu_Edit';
437
- }
438
-
439
- /**
440
- * Load menu image meta for each menu item.
441
- *
442
- * @since 2.0
443
- */
444
- public function menu_image_wp_setup_nav_menu_item( $item ) {
445
- if ( ! isset( $item->thumbnail_id ) ) {
446
- $item->thumbnail_id = get_post_thumbnail_id( $item->ID );
447
- }
448
- if ( ! isset( $item->thumbnail_hover_id ) && $item->thumbnail_id > 0 ) {
449
- $item->thumbnail_hover_id = get_post_meta( $item->ID, '_thumbnail_hover_id', true );
450
- }
451
- if ( ! isset( $item->image_size ) && $item->thumbnail_id > 0 ) {
452
- $item->image_size = get_post_meta( $item->ID, '_menu_item_image_size', true );
453
- }
454
- if ( ! isset( $item->title_position ) && $item->thumbnail_id > 0 ) {
455
- $item->title_position = get_post_meta( $item->ID, '_menu_item_image_title_position', true );
456
- }
457
-
458
- return $item;
459
- }
460
-
461
- /**
462
- * Filters the HTML attributes applied to a menu item's anchor element.
463
- *
464
- * @param array $atts {
465
- * The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
466
- *
467
- * @type string $title Title attribute.
468
- * @type string $target Target attribute.
469
- * @type string $rel The rel attribute.
470
- * @type string $href The href attribute.
471
- * }
472
- * @param WP_Post $item The current menu item.
473
- * @param stdClass $args An object of wp_nav_menu() arguments.
474
- * @param int $depth Depth of menu item. Used for padding.
475
- *
476
- * @return array Link attributes.
477
- */
478
- public function menu_image_nav_menu_link_attributes_filter( $atts, $item, $args, $depth = null ) {
479
-
480
- if ( '' !== $item->thumbnail_id && $item->thumbnail_id > 0 ) {
481
- $this->setProcessed( $item->ID );
482
- $position = $item->title_position ? $item->title_position : apply_filters( 'menu_image_default_title_position', 'after' );
483
- $class = ! empty( $atts['class'] ) ? $atts['class'] : '';
484
- $class .= " menu-image-title-{$position}";
485
- if ( $item->thumbnail_hover_id ) {
486
- $class .= ' menu-image-hovered';
487
- } elseif ( $item->thumbnail_id ) {
488
- $class .= ' menu-image-not-hovered';
489
  }
490
- // Fix dropdown menu for Flatsome theme.
491
- if ( ! empty( $args->walker ) && class_exists( 'FlatsomeNavDropdown' ) && $args->walker instanceof FlatsomeNavDropdown && ! is_null( $depth ) && $depth === 0 ) {
492
- $class .= ' nav-top-link';
493
  }
494
- $atts['class'] = trim( $class );
495
- }
496
-
497
- return $atts;
498
- }
499
-
500
- /**
501
- * Replacement default menu item output.
502
- *
503
- * @param string $title Default item output
504
- * @param object $item Menu item data object.
505
- * @param int $depth Depth of menu item. Used for padding.
506
- * @param object $args
507
- *
508
- * @return string
509
- */
510
- public function menu_image_nav_menu_item_title_filter( $title, $item = null, $depth = null, $args = null ) {
511
-
512
- if ( strpos( $title, 'menu-image' ) > 0 || ! is_nav_menu_item( $item ) || ! isset( $item ) ) {
513
- return $title;
514
- }
515
-
516
- if ( is_numeric( $item ) && $item < 0 ) {
517
- return $title;
518
- }
519
-
520
- if ( is_numeric( $item ) && $item > 0 ) {
521
- $item = wp_setup_nav_menu_item( get_post( $item ) );
522
- }
523
-
524
- // Process only if there is an menu image associated with the menu item.
525
- if ( gettype( $item ) !== 'string' && '' !== $item->thumbnail_id && $item->thumbnail_id > 0 ) {
526
- $image_size = $item->image_size ? $item->image_size : apply_filters( 'menu_image_default_size', 'menu-36x36' );
527
- $position = $item->title_position ? $item->title_position : apply_filters( 'menu_image_default_title_position', 'after' );
528
- $class = "menu-image-title-{$position}";
529
- $this->setUsedAttachments( $image_size, $item->thumbnail_id );
530
- $image = '';
531
- if ( $item->thumbnail_hover_id ) {
532
- $this->setUsedAttachments( $image_size, $item->thumbnail_hover_id );
533
- $hover_image_src = wp_get_attachment_image_src( $item->thumbnail_hover_id, $image_size );
534
- $margin_size = $hover_image_src[1];
535
- $image = "<span class='menu-image-hover-wrapper'>";
536
- $image .= wp_get_attachment_image( $item->thumbnail_id, $image_size, false, "class=menu-image {$class}" );
537
- $image .= wp_get_attachment_image(
538
- $item->thumbnail_hover_id, $image_size, false, array(
539
- 'class' => "hovered-image {$class}",
540
- 'style' => "margin-left: -{$margin_size}px;",
541
- )
542
- );
543
- $image .= '</span>';
544
- } elseif ( $item->thumbnail_id ) {
545
- $image = wp_get_attachment_image( $item->thumbnail_id, $image_size, false, "class=menu-image {$class}" );
546
  }
547
- $none = ''; // Sugar.
548
- $image = apply_filters( 'menu_image_img_html', $image );
549
- $class .= ' menu-image-title';
550
-
551
- switch ( $position ) {
552
- case 'hide':
553
- case 'before':
554
- case 'above':
555
- $item_args = array( $none, $class, $title, $image );
556
- break;
557
- case 'after':
558
- default:
559
- $item_args = array( $image, $class, $title, $none );
560
- break;
561
  }
562
-
563
- $title = vsprintf( '%s<span class="%s">%s</span>%s', $item_args );
564
-
565
- }
566
-
567
- return $title;
568
- }
569
-
570
- /**
571
- * Replacement default menu item output.
572
- *
573
- * @param string $item_output Default item output.
574
- * @param object $item Menu item data object.
575
- * @param int $depth Depth of menu item. Used for padding.
576
- * @param object $args
577
- *
578
- * @return string
579
- */
580
- public function menu_image_nav_menu_item_filter( $item_output, $item, $depth, $args ) {
581
- if ( $this->isProcessed( $item->ID ) ) {
582
- return $item_output;
583
- }
584
-
585
- if ( '' !== $item->thumbnail_id && $item->thumbnail_id > 0 ) {
586
- $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) . '"' : '';
587
- $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) . '"' : '';
588
- $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) . '"' : '';
589
- $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) . '"' : '';
590
- $attributes_array = shortcode_parse_atts( $attributes );
591
-
592
- $image_size = $item->image_size ? $item->image_size : apply_filters( 'menu_image_default_size', 'menu-36x36' );
593
- $position = $item->title_position ? $item->title_position : apply_filters( 'menu_image_default_title_position', 'after' );
594
- $class = "menu-image-title-{$position}";
595
- $this->setUsedAttachments( $image_size, $item->thumbnail_id );
596
- $image = '';
597
- if ( $item->thumbnail_hover_id ) {
598
- $this->setUsedAttachments( $image_size, $item->thumbnail_hover_id );
599
- $hover_image_src = wp_get_attachment_image_src( $item->thumbnail_hover_id, $image_size );
600
- $margin_size = $hover_image_src[1];
601
- $image = "<span class='menu-image-hover-wrapper'>";
602
- $image .= wp_get_attachment_image( $item->thumbnail_id, $image_size, false, "class=menu-image {$class}" );
603
- $image .= wp_get_attachment_image(
604
- $item->thumbnail_hover_id, $image_size, false, array(
605
- 'class' => "hovered-image {$class}",
606
- 'style' => "margin-left: -{$margin_size}px;",
607
- )
608
- );
609
- $image .= '</span>';
610
- $class .= ' menu-image-hovered';
611
- } elseif ( $item->thumbnail_id ) {
612
- $image = wp_get_attachment_image( $item->thumbnail_id, $image_size, false, "class=menu-image {$class}" );
613
- $class .= ' menu-image-not-hovered';
614
  }
615
- $attributes_array['class'] = $class;
616
-
617
- /**
618
- * Filter the menu link attributes.
619
- *
620
- * @since 2.6.7
621
- *
622
- * @param array $attributes An array of attributes.
623
- * @param object $item Menu item data object.
624
- * @param int $depth Depth of menu item. Used for padding.
625
- * @param object $args
626
- */
627
- $attributes_array = apply_filters( 'menu_image_link_attributes', $attributes_array, $item, $depth, $args );
628
- $attributes = '';
629
- foreach ( $attributes_array as $attr_name => $attr_value ) {
630
- $attributes .= "{$attr_name}=\"$attr_value\" ";
631
  }
632
- $attributes = trim( $attributes );
633
-
634
- $item_output = "{$args->before}<a {$attributes}>";
635
- $link = $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
636
- $none = ''; // Sugar.
637
- $image = apply_filters( 'menu_image_img_html', $image );
638
-
639
- switch ( $position ) {
640
- case 'hide':
641
- case 'before':
642
- case 'above':
643
- $item_args = array( $none, $link, $image );
644
- break;
645
- case 'after':
646
- default:
647
- $item_args = array( $image, $link, $none );
648
- break;
649
  }
650
- $item_output .= vsprintf( '%s<span class="menu-image-title">%s</span>%s', $item_args );
651
- $item_output .= "</a>{$args->after}";
652
- }
653
-
654
- return $item_output;
655
- }
656
-
657
- /**
658
- * Loading additional stylesheet.
659
- *
660
- * Loading custom stylesheet to fix images positioning in match themes
661
- */
662
- public function menu_image_add_inline_style_action() {
663
-
664
- wp_register_style( 'menu-image', plugins_url( '', __FILE__ ) . '/includes/css/menu-image.css', array(), '2.9.6' );
665
- wp_enqueue_style( 'menu-image' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
666
 
667
- }
668
-
669
- /**
670
- * Loading media-editor script ot nav-menus page.
671
- *
672
- * @since 2.0
673
- */
674
- public function menu_image_admin_head_nav_menus_action() {
675
-
676
- wp_enqueue_script( 'menu-image-admin', plugins_url( '/includes/js/menu-image-admin.js', __FILE__ ), array( 'jquery' ), '2.9.6' );
677
- wp_localize_script(
678
- 'menu-image-admin', 'menuImage', array(
679
- 'l10n' => array(
680
- 'uploaderTitle' => __( 'Chose menu image', 'menu-image' ),
681
- 'uploaderButtonText' => __( 'Select', 'menu-image' ),
682
- ),
683
- 'settings' => array(
684
- 'nonce' => wp_create_nonce( 'update-menu-item' ),
685
- ),
686
- )
687
- );
688
- wp_enqueue_media();
689
- wp_enqueue_style( 'editor-buttons' );
690
- }
691
-
692
- /**
693
- * When menu item removed remove menu image metadata.
694
- */
695
- public function menu_image_delete_menu_item_image_action() {
696
-
697
- $menu_item_id = (int) $_REQUEST['menu-item'];
698
-
699
- check_admin_referer( 'delete-menu_item_image_' . $menu_item_id );
700
-
701
- if ( is_nav_menu_item( $menu_item_id ) && has_post_thumbnail( $menu_item_id ) ) {
702
- delete_post_thumbnail( $menu_item_id );
703
- delete_post_meta( $menu_item_id, '_thumbnail_hover_id' );
704
- delete_post_meta( $menu_item_id, '_menu_item_image_size' );
705
- delete_post_meta( $menu_item_id, '_menu_item_image_title_position' );
706
- }
707
- }
708
-
709
- /**
710
- * Output HTML for the menu item images.
711
- *
712
- * @since 2.0
713
- *
714
- * @param int $item_id The post ID or object associated with the thumbnail, defaults to global $post.
715
- *
716
- * @return string html
717
- */
718
- public function wp_post_thumbnail_only_html( $item_id ) {
719
- $default_size = apply_filters( 'menu_image_default_size', 'menu-36x36' );
720
- $markup = '<p class="description description-thin" ><label>%s<br /><a title="%s" href="#" class="set-post-thumbnail button%s" data-item-id="%s" style="height: auto;">%s</a>%s</label></p>';
721
-
722
- $thumbnail_id = get_post_thumbnail_id( $item_id );
723
- $content = sprintf(
724
- $markup,
725
- esc_html__( 'Menu image', 'menu-image' ),
726
- $thumbnail_id ? esc_attr__( 'Change menu item image', 'menu-image' ) : esc_attr__( 'Set menu item image', 'menu-image' ),
727
- '',
728
- $item_id,
729
- $thumbnail_id ? wp_get_attachment_image( $thumbnail_id, $default_size ) : esc_html__( 'Set image', 'menu-image' ),
730
- $thumbnail_id ? '<a href="#" class="remove-post-thumbnail">' . __( 'Remove', 'menu-image' ) . '</a>' : ''
731
- );
732
-
733
- // Menu image on hover if enabled.
734
- if ( '1' == get_option( 'menu_image_hover', '1' ) ) {
735
- $hover_id = get_post_meta( $item_id, '_thumbnail_hover_id', true );
736
- $content .= sprintf(
737
- $markup,
738
- esc_html__( 'Image on hover', 'menu-image' ),
739
- $hover_id ? esc_attr__( 'Change menu item image on hover', 'menu-image' ) : esc_attr__( 'Set menu item image on hover', 'menu-image' ),
740
- ' hover-image',
741
- $item_id,
742
- $hover_id ? wp_get_attachment_image( $hover_id, $default_size ) : esc_html__( 'Set image on hover', 'menu-image' ),
743
- $hover_id ? '<a href="#" class="remove-post-thumbnail hover-image">' . __( 'Remove', 'menu-image' ) . '</a>' : ''
744
- );
745
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
 
747
- return $content;
748
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749
 
750
- /**
751
- * Output HTML for the menu item images section.
752
- *
753
- * @since 2.0
754
- *
755
- * @param int $item_id The post ID or object associated with the thumbnail, defaults to global $post.
756
- *
757
- * @return string html
758
- */
759
- public function wp_post_thumbnail_html( $item_id ) {
760
- $default_size = apply_filters( 'menu_image_default_size', 'menu-36x36' );
761
- $content = $this->wp_post_thumbnail_only_html( $item_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
 
763
- $image_size = get_post_meta( $item_id, '_menu_item_image_size', true );
764
- if ( ! $image_size ) {
765
- $image_size = $default_size;
766
- }
767
- $title_position = get_post_meta( $item_id, '_menu_item_image_title_position', true );
768
- if ( ! $title_position ) {
769
- $title_position = apply_filters( 'menu_image_default_title_position', 'after' );
770
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
771
 
772
- ob_start();
773
- ?>
 
 
 
 
774
 
775
- <div class="menu-item-image-options">
776
- <p class="description description-wide">
777
- <label for="edit-menu-item-image-size-<?php echo $item_id; ?>"><?php _e( 'Image size', 'menu-image' ); ?>
778
- <br />
779
- <select id="edit-menu-item-image-size-<?php echo $item_id; ?>"
 
 
 
 
 
 
 
 
 
 
780
  class="widefat edit-menu-item-image-size"
781
- name="menu_item_image_size[<?php echo $item_id; ?>]">
782
- <option value='full' <?php echo $image_size == 'full' ? ' selected="selected"' : '' ?>><?php _e( 'Original Size', 'menu-image' ); ?></option>
 
 
 
 
 
 
783
  <?php
784
- foreach ( get_intermediate_image_sizes() as $size ) :
785
- printf(
786
- "<option value='%s'%s>%s</option>\n",
787
- esc_attr( $size ),
788
- $image_size == $size ? ' selected="selected"' : '',
789
- ucfirst( $size )
790
- ); ?>
791
- <?php endforeach; ?>
 
 
 
792
  </select>
793
- </label>
794
- </p>
795
- <p class="description description-wide">
796
- <label><?php _e( 'Title position', 'menu-image' ); ?></label><br />
797
- <?php
798
-
799
- $positions = apply_filters('menu-image-positions', [
800
- 'hide' => __( 'Hide', 'menu-image' ),
801
- 'above' => __( 'Above', 'menu-image' ),
802
- 'below' => __( 'Below', 'menu-image' ),
803
- 'before' => __( 'Before', 'menu-image' ),
804
- 'after' => __( 'After', 'menu-image' ),
805
- ]);
806
-
807
- foreach ( $positions as $position => $label ) :
808
- printf(
809
- "<label><input type='radio' name='menu_item_image_title_position[%s]' value='%s'%s/> %s</label>%s",
810
- $item_id,
811
- esc_attr( $position ),
812
- $title_position == $position ? ' checked="checked"' : '',
813
- $label,
814
- $position != 'after' ? ' | ' : ''
815
- );
816
- endforeach;
817
- ?>
818
- </p>
819
- </div>
820
-
821
- <?php
822
- $content = "<div class='menu-item-images' style='min-height:70px'>$content</div>" . ob_get_clean();
823
-
824
- /**
825
- * Filter the admin menu item thumbnail HTML markup to return.
826
- *
827
- * @since 2.0
828
- *
829
- * @param string $content Admin menu item images HTML markup.
830
- * @param int $item_id Post ID.
831
- */
832
- return apply_filters( 'admin_menu_item_thumbnail_html', $content, $item_id );
833
- }
834
-
835
- /**
836
- * Update item thumbnail via ajax action.
837
- *
838
- * @since 2.0
839
- */
840
- public function wp_ajax_set_menu_item_thumbnail() {
841
- $json = ! empty( $_REQUEST['json'] );
842
-
843
- $post_ID = intval( $_POST['post_id'] );
844
- if ( ! current_user_can( 'edit_post', $post_ID ) ) {
845
- wp_die( - 1 );
846
- }
847
-
848
- $thumbnail_id = intval( $_POST['thumbnail_id'] );
849
- $is_hovered = (bool) $_POST['is_hover'];
850
-
851
- check_ajax_referer( 'update-menu-item' );
852
-
853
- if ( $thumbnail_id == '-1' ) {
854
- if ( $is_hovered ) {
855
- $success = delete_post_meta( $post_ID, '_thumbnail_hover_id' );
856
- } else {
857
- $success = delete_post_thumbnail( $post_ID );
858
- }
859
- } else {
860
- if ( $is_hovered ) {
861
- $success = update_post_meta( $post_ID, '_thumbnail_hover_id', $thumbnail_id );
862
- } else {
863
- $success = set_post_thumbnail( $post_ID, $thumbnail_id );
864
- }
865
- }
866
-
867
- if ( $success ) {
868
- $return = $this->wp_post_thumbnail_only_html( $post_ID );
869
- $json ? wp_send_json_success( $return ) : wp_die( $return );
870
- }
871
-
872
- wp_die( 0 );
873
- }
874
-
875
- /**
876
- * Add custom fields to menu item.
877
- *
878
- * @param int $item_id
879
- * @param object $item
880
- * @param int $depth
881
- * @param array $args
882
- *
883
- * @see http://web.archive.org/web/20141021012233/http://shazdeh.me/2014/06/25/custom-fields-nav-menu-items
884
- * @see https://core.trac.wordpress.org/ticket/18584
885
- */
886
- public function menu_item_custom_fields( $item_id, $item, $depth, $args ) {
887
- if ( ! $item_id && isset( $item->ID ) ) {
888
- $item_id = $item->ID;
889
- }
890
- ?>
891
- <div class="field-image hide-if-no-js wp-media-buttons">
892
- <?php echo $this->wp_post_thumbnail_html( $item_id ); ?>
893
- </div>
894
- <?php
895
- }
896
-
897
- /**
898
- * Prevent jetpack Phonon applied for menu item images.
899
- *
900
- * @param bool $prevent
901
- * @param array $data
902
- *
903
- * @return bool
904
- */
905
- public function jetpack_photon_override_image_downsize_filter( $prevent, $data ) {
906
- return $this->isAttachmentUsed( $data[ 'attachment_id' ], $data[ 'size' ] );
907
- }
908
-
909
- /**
910
- * Set used attachment ids.
911
- *
912
- * @param string $size
913
- * @param int $id
914
- */
915
- public function setUsedAttachments( $size, $id ) {
916
- $this->used_attachments[ $size ][ ] = $id;
917
- }
918
-
919
- /**
920
- * Check if attachment is used in menu items.
921
- *
922
- * @param int $id
923
- * @param string $size
924
- *
925
- * @return bool
926
- */
927
- public function isAttachmentUsed( $id, $size = null ) {
928
- if ( ! is_null( $size ) ) {
929
- return is_string( $size ) && isset( $this->used_attachments[ $size ] ) && in_array( $id, $this->used_attachments[ $size ] );
930
- } else {
931
- foreach ( $this->used_attachments as $used_attachment ) {
932
- if ( in_array( $id, $used_attachment ) ) {
933
- return true;
934
- }
935
- }
936
- return false;
937
- }
938
- }
939
-
940
- /**
941
- * Filters the list of attachment image attributes.
942
- *
943
- * @since 2.8.0
944
- *
945
- * @param array $attr Attributes for the image markup.
946
- * @param WP_Post $attachment Image attachment post.
947
- * @param string|array $size Requested size. Image size or array of width and height values
948
- * (in that order). Default 'thumbnail'.
949
- *
950
- * @return array Valid array of image attributes.
951
- */
952
- public function wp_get_attachment_image_attributes( $attr, $attachment, $size ) {
953
- if ( $this->isAttachmentUsed( $attachment->ID, $size ) ) {
954
- unset( $attr['sizes'], $attr['srcset'] );
955
- }
956
-
957
- return $attr;
958
- }
959
-
960
- /**
961
- * Mark item as processed to prevent re-processing it again.
962
- *
963
- * @param int $id
964
- */
965
- protected function setProcessed( $id ) {
966
- $this->processed[] = $id;
967
- }
968
-
969
- /**
970
- * Check if was already processed.
971
- *
972
- * @param int $id
973
- *
974
- * @return bool
975
- */
976
- protected function isProcessed( $id ) {
977
- return in_array( $id, $this->processed );
978
- }
979
- }
980
-
981
- $menu_image = new Menu_Image_Plugin();
982
-
983
- require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
984
-
985
- class Menu_Image_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
986
-
987
- public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
988
- global $_wp_nav_menu_max_depth;
989
- $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
990
-
991
- ob_start();
992
- $item_id = esc_attr( $item->ID );
993
- $removed_args = array(
994
- 'action',
995
- 'customlink-tab',
996
- 'edit-menu-item',
997
- 'menu-item',
998
- 'page-tab',
999
- '_wpnonce',
1000
- );
1001
-
1002
- $original_title = false;
1003
- if ( 'taxonomy' == $item->type ) {
1004
- $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
1005
- if ( is_wp_error( $original_title ) ) {
1006
- $original_title = false;
1007
- }
1008
- } elseif ( 'post_type' == $item->type ) {
1009
- $original_object = get_post( $item->object_id );
1010
- $original_title = get_the_title( $original_object->ID );
1011
- } elseif ( 'post_type_archive' == $item->type ) {
1012
- $original_object = get_post_type_object( $item->object );
1013
- if ( $original_object ) {
1014
- $original_title = $original_object->labels->archives;
1015
- }
1016
- }
1017
-
1018
- $classes = array(
1019
- 'menu-item menu-item-depth-' . $depth,
1020
- 'menu-item-' . esc_attr( $item->object ),
1021
- 'menu-item-edit-' . ( ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? 'active' : 'inactive'),
1022
- );
1023
 
1024
- $title = $item->title;
 
 
 
 
 
1025
 
1026
- if ( ! empty( $item->_invalid ) ) {
1027
- $classes[] = 'menu-item-invalid';
1028
- /* translators: %s: title of menu item which is invalid */
1029
- $title = sprintf( __( '%s (Invalid)' ), $item->title );
1030
- } elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) {
1031
- $classes[] = 'pending';
1032
- /* translators: %s: title of menu item in draft status */
1033
- $title = sprintf( __( '%s (Pending)' ), $item->title );
1034
- }
1035
 
1036
- $title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label;
 
1037
 
1038
- $submenu_text = '';
1039
- if ( 0 == $depth )
1040
- $submenu_text = 'style="display: none;"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1041
 
1042
- ?>
1043
- <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo implode( ' ', $classes ); ?>">
1044
- <div class="menu-item-bar">
1045
- <div class="menu-item-handle">
1046
- <span class="item-title"><span class="menu-item-title"><?php echo esc_html( $title ); ?></span> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span></span>
1047
- <span class="item-controls">
1048
- <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
1049
- <span class="item-order hide-if-js">
1050
- <a href="<?php
1051
- echo wp_nonce_url(
1052
- add_query_arg(
1053
- array(
1054
- 'action' => 'move-up-menu-item',
1055
- 'menu-item' => $item_id,
1056
- ),
1057
- remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
1058
- ),
1059
- 'move-menu_item'
1060
- );
1061
- ?>" class="item-move-up" aria-label="<?php esc_attr_e( 'Move up' ); ?>">&#8593;</a>
1062
- |
1063
- <a href="<?php
1064
- echo wp_nonce_url(
1065
- add_query_arg(
1066
- array(
1067
- 'action' => 'move-down-menu-item',
1068
- 'menu-item' => $item_id,
1069
- ),
1070
- remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) )
1071
- ),
1072
- 'move-menu_item'
1073
- );
1074
- ?>" class="item-move-down" aria-label="<?php esc_attr_e( 'Move down' ) ?>">&#8595;</a>
1075
- </span>
1076
- <a class="item-edit" id="edit-<?php echo $item_id; ?>" href="<?php
1077
- echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
1078
- ?>" aria-label="<?php esc_attr_e( 'Edit menu item' ); ?>"><span class="screen-reader-text"><?php _e( 'Edit' ); ?></span></a>
1079
- </span>
1080
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
1081
  </div>
 
 
 
 
 
1082
 
1083
- <div class="menu-item-settings wp-clearfix" id="menu-item-settings-<?php echo $item_id; ?>">
1084
- <?php if ( 'custom' == $item->type ) : ?>
1085
- <p class="field-url description description-wide">
1086
- <label for="edit-menu-item-url-<?php echo $item_id; ?>">
1087
- <?php _e( 'URL' ); ?><br />
1088
- <input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->url ); ?>" />
1089
- </label>
1090
- </p>
1091
- <?php endif; ?>
1092
- <p class="description description-wide">
1093
- <label for="edit-menu-item-title-<?php echo $item_id; ?>">
1094
- <?php _e( 'Navigation Label' ); ?><br />
1095
- <input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->title ); ?>" />
1096
- </label>
1097
- </p>
1098
- <p class="field-title-attribute field-attr-title description description-wide">
1099
- <label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
1100
- <?php _e( 'Title Attribute' ); ?><br />
1101
- <input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_excerpt ); ?>" />
1102
- </label>
1103
- </p>
1104
- <p class="field-link-target description">
1105
- <label for="edit-menu-item-target-<?php echo $item_id; ?>">
1106
- <input type="checkbox" id="edit-menu-item-target-<?php echo $item_id; ?>" value="_blank" name="menu-item-target[<?php echo $item_id; ?>]"<?php checked( $item->target, '_blank' ); ?> />
1107
- <?php _e( 'Open link in a new tab' ); ?>
1108
- </label>
1109
- </p>
1110
- <p class="field-css-classes description description-thin">
1111
- <label for="edit-menu-item-classes-<?php echo $item_id; ?>">
1112
- <?php _e( 'CSS Classes (optional)' ); ?><br />
1113
- <input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode(' ', $item->classes ) ); ?>" />
1114
- </label>
1115
- </p>
1116
- <p class="field-xfn description description-thin">
1117
- <label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
1118
- <?php _e( 'Link Relationship (XFN)' ); ?><br />
1119
- <input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->xfn ); ?>" />
1120
- </label>
1121
- </p>
1122
-
1123
- <?php
1124
- // This is the added section
1125
- do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth, $args );
1126
- // end added section
1127
- ?>
1128
 
1129
- <p class="field-description description description-wide">
1130
- <label for="edit-menu-item-description-<?php echo $item_id; ?>">
1131
- <?php _e( 'Description' ); ?><br />
1132
- <textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); // textarea_escaped ?></textarea>
1133
- <span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span>
1134
- </label>
1135
- </p>
1136
-
1137
- <fieldset class="field-move hide-if-no-js description description-wide">
1138
- <span class="field-move-visual-label" aria-hidden="true"><?php _e( 'Move' ); ?></span>
1139
- <button type="button" class="button-link menus-move menus-move-up" data-dir="up"><?php _e( 'Up one' ); ?></button>
1140
- <button type="button" class="button-link menus-move menus-move-down" data-dir="down"><?php _e( 'Down one' ); ?></button>
1141
- <button type="button" class="button-link menus-move menus-move-left" data-dir="left"></button>
1142
- <button type="button" class="button-link menus-move menus-move-right" data-dir="right"></button>
1143
- <button type="button" class="button-link menus-move menus-move-top" data-dir="top"><?php _e( 'To the top' ); ?></button>
1144
- </fieldset>
1145
 
1146
- <div class="menu-item-actions description-wide submitbox">
1147
- <?php if ( 'custom' != $item->type && $original_title !== false ) : ?>
1148
- <p class="link-to-original">
1149
- <?php printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
1150
- </p>
1151
- <?php endif; ?>
1152
- <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php
1153
- echo wp_nonce_url(
1154
- add_query_arg(
1155
- array(
1156
- 'action' => 'delete-menu-item',
1157
- 'menu-item' => $item_id,
1158
- ),
1159
- admin_url( 'nav-menus.php' )
1160
- ),
1161
- 'delete-menu_item_' . $item_id
1162
- ); ?>"><?php _e( 'Remove' ); ?></a> <span class="meta-sep hide-if-no-js"> | </span> <a class="item-cancel submitcancel hide-if-no-js" id="cancel-<?php echo $item_id; ?>" href="<?php echo esc_url( add_query_arg( array( 'edit-menu-item' => $item_id, 'cancel' => time() ), admin_url( 'nav-menus.php' ) ) );
1163
- ?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e( 'Cancel' ); ?></a>
1164
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1165
 
1166
- <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
1167
- <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
1168
- <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
1169
- <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_item_parent ); ?>" />
1170
- <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
1171
- <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
1172
- </div><!-- .menu-item-settings-->
1173
- <ul class="menu-item-transport"></ul>
1174
- <?php
1175
- $output .= ob_get_clean();
1176
- }
1177
  }
 
 
 
1
  <?php
2
+
3
  /**
4
  * @package Menu_Image
5
+ * @version 3.0
6
  * @licence GPLv2
7
  */
 
8
  /*
9
  Plugin Name: Menu Image
10
+ Plugin URI: https://www.wpmenuimage.com
11
  Description: Improve your navigation menu items with images, logos, icons, buttons.
12
  Author: Rui Guerreiro
13
+ Version: 3.0
14
+ Author URI: https://www.wpmenuimage.com
15
+ * License: GPLv2
16
  */
17
+ if ( !defined( 'ABSPATH' ) ) {
18
+ die;
19
+ }
20
+ define( 'MENU_IMAGE_VERSION', '3.0' );
21
+ define( 'MENU_IMAGE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
22
+ define( 'MENU_IMAGE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
23
  /**
24
  * Provide attaching images to menu items.
25
  *
26
  * @package Menu_Image
27
  */
28
+ class WP_Menu_Image
29
+ {
30
+ private $image_size_1 = '' ;
31
+ private $image_size_2 = '' ;
32
+ private $image_size_3 = '' ;
33
+ /**
34
+ * Self provided image sizes for most menu usage.
35
+ *
36
+ * @var array
37
+ */
38
+ protected $image_sizes = array() ;
39
+ public $mi_fs ;
40
+ /**
41
+ * List of used attachment ids grouped by size.
42
+ *
43
+ * Need to list all ids to prevent Jetpack Phonon in image_downsize filter.
44
+ *
45
+ * @var array
46
+ */
47
+ private $used_attachments = array() ;
48
+ /**
49
+ * List of file extensions that allowed to resize and display as image.
50
+ *
51
+ * @var array
52
+ */
53
+ private $additionalDisplayableImageExtensions = array( 'ico' ) ;
54
+ /**
55
+ * List of processed menu item ids.
56
+ *
57
+ * Mark item id as processed for new core version, 'cause old themes
58
+ * doesn't supports filters like `nav_menu_link_attributes` and the only
59
+ * way is to override whole element in filter `walker_nav_menu_start_el`.
60
+ *
61
+ * @var array
62
+ */
63
+ private $processed = array() ;
64
+ /**
65
+ * Plugin constructor.
66
+ */
67
+ public function __construct()
68
+ {
69
+ }
70
+
71
+ /**
72
+ * Build the menu image item settings HTML.
73
+ */
74
+ public function get_menu_image_item_settings()
75
+ {
76
+ $menu_title = '';
77
+ if ( isset( $_POST['menu_item_id'] ) ) {
78
+ $menu_item_id = absint( $_POST['menu_item_id'] );
79
+ }
80
+ if ( isset( $_POST['menu_id'] ) ) {
81
+ $menu_id = absint( $_POST['menu_id'] );
82
+ }
83
+ if ( isset( $_POST['menu_title'] ) ) {
84
+ $menu_title = sanitize_text_field( $_POST['menu_title'] );
85
+ }
86
+ $output = '<div class="menu-image-item-settings-content" data-menu-id="' . $menu_id . '" data-menu-item-id="' . $menu_item_id . '">';
87
+ $output .= '<div id="menu-image-modal-header"><h2 class="active" data-target="menu-image-icon-settings">' . __( 'Image & Icon', 'menu-image' ) . '</h2><h2 data-target="menu-image-button-settings">' . __( 'Buttons', 'menu-image' ) . '</h2><h2 data-target="menu-image-notifications-settings">' . __( 'Badges & Bubbles', 'menu-image' ) . '</h2><div class="menu-image-close-overlay"><span class="close-text">' . __( 'Close', 'menu-image' ) . '</span><span class="dashicons dashicons-no-alt"></span></div>';
88
+ $output .= '</div><div id="menu-image-modal-body">';
89
+ $output .= $this->wp_post_thumbnail_html( $menu_item_id, $menu_title );
90
+ $output .= '</div></div></div>';
91
+ echo $output ;
92
+ wp_die();
93
+ }
94
+
95
+ /**
96
+ * Init Menu Image.
97
+ */
98
+ public function init_menu_image()
99
+ {
100
+ $this->add_image_sizes();
101
+ // Add new admin menu options page for Menu image.
102
+ add_action( 'admin_menu', array( $this, 'create_menu_image_options_page' ) );
103
+ // Register Menu Image settings.
104
+ add_action( 'admin_init', array( $this, 'register_menu_image_settings' ) );
105
+ // Init Freemius.
106
+ $this->mi_fs = $this->mi_fs();
107
+ // Uninstall Action.
108
+ $this->mi_fs->add_action( 'after_uninstall', array( $this, 'mm_fs_uninstall_cleanup' ) );
109
+ // Freemius is loaded.
110
+ do_action( 'mi_fs_loaded' );
111
+ // Actions.
112
+ add_action( 'init', array( $this, 'menu_image_init' ) );
113
+ add_action(
114
+ 'wp_ajax_set-menu-item-settings',
115
+ array( $this, 'menu_image_save_post_action' ),
116
+ 10,
117
+ 3
118
+ );
119
+ add_action( 'admin_head-nav-menus.php', array( $this, 'menu_image_admin_head_nav_menus_action' ) );
120
+ add_action( 'toplevel_page_menu-image-options', array( $this, 'menu_image_admin_head_nav_menus_action' ) );
121
+ add_action( 'wp_enqueue_scripts', array( $this, 'menu_image_add_inline_style_action' ) );
122
+ add_action( 'admin_action_delete-menu-item-image', array( $this, 'menu_image_delete_menu_item_image_action' ) );
123
+ add_action( 'wp_ajax_set-menu-item-thumbnail', array( $this, 'wp_ajax_set_menu_item_thumbnail' ) );
124
+ add_action( 'wp_ajax_get_menu_image_item_settings', array( $this, 'get_menu_image_item_settings' ) );
125
+ // Add support of WPML menus sync.
126
+ add_action(
127
+ 'wp_update_nav_menu_item',
128
+ array( $this, 'wp_update_nav_menu_item_action' ),
129
+ 10,
130
+ 2
131
+ );
132
+ add_action( 'admin_init', array( $this, 'admin_init' ), 99 );
133
+ // Add support for additional image types.
134
+ add_filter(
135
+ 'file_is_displayable_image',
136
+ array( $this, 'file_is_displayable_image' ),
137
+ 10,
138
+ 2
139
+ );
140
+ add_filter(
141
+ 'jetpack_photon_override_image_downsize',
142
+ array( $this, 'jetpack_photon_override_image_downsize_filter' ),
143
+ 10,
144
+ 2
145
+ );
146
+ add_filter(
147
+ 'wp_get_attachment_image_attributes',
148
+ array( $this, 'wp_get_attachment_image_attributes' ),
149
+ 99,
150
+ 3
151
+ );
152
+ // Add support for Max Megamenu.
153
+
154
+ if ( function_exists( 'max_mega_menu_is_enabled' ) ) {
155
+ add_filter(
156
+ 'megamenu_nav_menu_link_attributes',
157
+ array( $this, 'menu_image_nav_menu_link_attributes_filter' ),
158
+ 10,
159
+ 3
160
+ );
161
+ add_filter(
162
+ 'megamenu_the_title',
163
+ array( $this, 'menu_image_nav_menu_item_title_filter' ),
164
+ 10,
165
+ 2
166
+ );
167
+ }
168
+
169
+
170
+ if ( !get_option( 'menu_image_disable_mobile' ) || get_option( 'menu_image_disable_mobile' ) && !wp_is_mobile() ) {
171
+ // Filters.
172
+ add_filter( 'wp_setup_nav_menu_item', array( $this, 'menu_image_wp_setup_nav_menu_item' ) );
173
+ add_filter(
174
+ 'nav_menu_link_attributes',
175
+ array( $this, 'menu_image_nav_menu_link_attributes_filter' ),
176
+ 10,
177
+ 4
178
+ );
179
+ add_filter( 'manage_nav-menus_columns', array( $this, 'menu_image_nav_menu_manage_columns' ), 11 );
180
+ add_filter(
181
+ 'nav_menu_item_title',
182
+ array( $this, 'menu_image_nav_menu_item_title_filter' ),
183
+ 10,
184
+ 4
185
+ );
186
+ add_filter(
187
+ 'the_title',
188
+ array( $this, 'menu_image_nav_menu_item_title_filter' ),
189
+ 10,
190
+ 4
191
+ );
192
+ }
193
+
194
+ // Menu image requires FontAwesome plugin notice.
195
+ add_action( 'wp_ajax_dismiss_wp_menu_image_fa', array( $this, 'dismiss_wp_menu_image_fa_notice' ) );
196
+ }
197
+
198
+ /**
199
+ * Admin init action with lowest execution priority
200
+ */
201
+ public function admin_init()
202
+ {
203
+ // Admin Scripts.
204
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
205
+ }
206
+
207
+ /**
208
+ * Add Image sizes
209
+ */
210
+ public function add_image_sizes()
211
+ {
212
+ $this->image_size_1 = get_option( 'menu_image_size_1', '24x24' );
213
+ $this->image_size_2 = get_option( 'menu_image_size_2', '36x36' );
214
+ $this->image_size_3 = get_option( 'menu_image_size_3', '48x48' );
215
+ $image_parts_1 = explode( 'x', $this->image_size_1 );
216
+ $image_parts_2 = explode( 'x', $this->image_size_2 );
217
+ $image_parts_3 = explode( 'x', $this->image_size_3 );
218
+ /**
219
+ * Self provided image sizes for most menu usage.
220
+ *
221
+ * @var array
222
+ */
223
+ $this->image_sizes = array(
224
+ 'menu-' . $this->image_size_1 => array( $image_parts_1[0], $image_parts_1[1], false ),
225
+ 'menu-' . $this->image_size_2 => array( $image_parts_2[0], $image_parts_2[1], false ),
226
+ 'menu-' . $this->image_size_3 => array( $image_parts_3[0], $image_parts_3[1], false ),
227
+ );
228
+ }
229
+
230
+ /*
231
+ * Create a helper function for easy SDK access.
232
+ */
233
+ public function mi_fs()
234
+ {
235
+ global $mi_fs ;
236
+
237
+ if ( !isset( $mi_fs ) ) {
238
+ // Activate multisite network integration.
239
+ if ( !defined( 'WP_FS__PRODUCT_4123_MULTISITE' ) ) {
240
+ define( 'WP_FS__PRODUCT_4123_MULTISITE', true );
241
+ }
242
+ // Include Freemius SDK.
243
+ require_once dirname( __FILE__ ) . '/freemius/start.php';
244
+ $mi_fs = fs_dynamic_init( array(
245
+ 'id' => '4123',
246
+ 'slug' => 'menu-image',
247
+ 'type' => 'plugin',
248
+ 'public_key' => 'pk_1a1cac31f5af1ba3d31bd86fe0e8b',
249
+ 'is_premium' => false,
250
+ 'premium_suffix' => 'Premium',
251
+ 'has_addons' => false,
252
+ 'has_paid_plans' => true,
253
+ 'has_affiliation' => 'selected',
254
+ 'trial' => array(
255
+ 'days' => 7,
256
+ 'is_require_payment' => true,
257
+ ),
258
+ 'menu' => array(
259
+ 'slug' => 'menu-image-options',
260
+ ),
261
+ 'is_live' => true,
262
+ ) );
263
+ }
264
+
265
+ return $mi_fs;
266
+ }
267
+
268
+ /**
269
+ * Filter adds additional validation for image type
270
+ *
271
+ * @param bool $result
272
+ * @param string $path
273
+ *
274
+ * @return bool
275
+ */
276
+ public function file_is_displayable_image( $result, $path )
277
+ {
278
+ if ( $result ) {
279
+ return true;
280
+ }
281
+ $fileExtension = pathinfo( $path, PATHINFO_EXTENSION );
282
+ return in_array( $fileExtension, $this->additionalDisplayableImageExtensions );
283
+ }
284
+
285
+ /**
286
+ * Create the Menu Image options page
287
+ */
288
+ public function create_menu_image_options_page()
289
+ {
290
+ add_menu_page(
291
+ 'Menu Image',
292
+ 'Menu Image',
293
+ 'manage_options',
294
+ 'menu-image-options',
295
+ array( $this, 'menu_image_options_page_html' ),
296
+ 'dashicons-menu',
297
+ 150
298
+ );
299
+ }
300
+
301
+ /**
302
+ * Validate Options of the submission form.
303
+ */
304
+ public function handle_options_form()
305
+ {
306
+
307
+ if ( !isset( $_POST['menu_image_form'] ) || !wp_verify_nonce( $_POST['menu_image_form'], 'menu_image_options_update' ) ) {
308
+ ?>
309
  <div class="error">
310
+ <p><?php
311
+ _e( 'Sorry, your nonce was not correct. Please try again.', 'menu-image' );
312
+ ?></p>
313
  </div>
314
+ <?php
315
+ } else {
316
+ // Handle our form data.
317
+ $enable_menu_image_hover = '0';
318
+ $disable_in_mobile = '0';
319
+ // If the value of the Menu Image Hover is set.
320
+ if ( isset( $_POST['menu_image_hover'] ) ) {
321
+ $enable_menu_image_hover = $_POST['menu_image_hover'];
322
+ }
323
+ // If the value of the Disable in Mobile Devices is set.
324
+ if ( isset( $_POST['menu_image_disable_mobile'] ) ) {
325
+ $disable_in_mobile = $_POST['menu_image_disable_mobile'];
326
+ }
327
+ $menu_image_size_1 = $_POST['menu_image_size_1'];
328
+ $menu_image_size_2 = $_POST['menu_image_size_2'];
329
+ $menu_image_size_3 = $_POST['menu_image_size_3'];
330
+ $image_parts_1 = explode( 'x', $menu_image_size_1 );
331
+ $image_parts_2 = explode( 'x', $menu_image_size_2 );
332
+ $image_parts_3 = explode( 'x', $menu_image_size_3 );
333
+ // Validate the menu image size format.
334
+
335
+ if ( 2 === count( $image_parts_1 ) && 2 === count( $image_parts_2 ) && 2 === count( $image_parts_3 ) ) {
336
+ update_option( 'menu_image_size_1', $menu_image_size_1 );
337
+ update_option( 'menu_image_size_2', $menu_image_size_2 );
338
+ update_option( 'menu_image_size_3', $menu_image_size_3 );
339
+ update_option( 'menu_image_disable_mobile', $disable_in_mobile );
340
+ update_option( 'menu_image_hover', $enable_menu_image_hover );
341
+ ?>
342
  <div class="updated">
343
+ <p><?php
344
+ _e( 'Your Menu Image settings were saved!', 'menu-image' );
345
+ ?></p>
346
  </div>
347
+ <?php
348
+ } else {
349
+ ?>
350
  <div class="error">
351
+ <p><?php
352
+ _e( 'Sorry, your image size format is not correct. Please try again.', 'menu-image' );
353
+ ?></p>
354
  </div>
355
+ <?php
356
+ }
357
+
358
+ }
359
+
360
+ }
361
+
362
+ /**
363
+ * Create the Menu Image options page HTML
364
+ */
365
+ public function menu_image_options_page_html()
366
+ {
367
+ // check user capabilities.
368
+ if ( !current_user_can( 'manage_options' ) ) {
369
+ return;
370
+ }
371
+ // check if we are updating the options.
372
+ if ( isset( $_POST['updated'] ) && 'true' === $_POST['updated'] ) {
373
+ $this->handle_options_form();
374
+ }
375
+ ?>
376
+ <style>
377
+ .menu-image-settings-header .fs-notice {
378
+ margin-top: 90px!important;
379
+ margin-right: 20px!important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  }
381
+ .menu-image-settings-wrapper {
382
+ background: #fff;
383
+ padding: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  }
385
+ .menu-image-settings-wrapper h2 {
386
+ color: #094c68;
387
+ border: 1px solid #DDD;
388
+ padding: 10px;
389
+ background: #fbfbfb;
390
+ font-weight: 400;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  }
392
+ .menu-image-settings-wrapper .form-table th {
393
+ font-weight: 500;
 
394
  }
395
+ .menu-image-settings-wrapper span.helper {
396
+ padding-left: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  }
398
+ span.menu-image-settings-h1 {
399
+ padding: 15px;
400
+ float: left;
401
+ font-size: 2em;
402
+ color: #fff;
 
 
 
 
 
 
 
 
 
403
  }
404
+ .menu-image-logo-admin {
405
+ float: left;
406
+ width: 60px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  }
408
+ .menu-image-settings-header {
409
+ padding: 10px 0px 10px 20px;
410
+ background: #1283da;
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  }
412
+ .toplevel_page_menu-image-options .wrap {
413
+ display: grid;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  }
415
+ </style>
416
+ <div class="wrap">
417
+ <h1><?php
418
+ _e( 'Menu Image Settings', 'menu-image' );
419
+ ?></h1>
420
+ <div class='menu-image-settings-header'>
421
+ <img src='<?php
422
+ echo MENU_IMAGE_PLUGIN_URL ;
423
+ ?>includes/assets/img/menu-image-60.png' class="menu-image-logo-admin">
424
+ <span class="menu-image-settings-h1"><?php
425
+ _e( 'Menu Image - v' . MENU_IMAGE_VERSION, 'menu-image' );
426
+ ?></span>
427
+ </div>
428
+ <div class="menu-image-settings-wrapper">
429
+ <form method="POST">
430
+ <?php
431
+ wp_nonce_field( 'menu_image_options_update', 'menu_image_form' );
432
+ ?>
433
+ <?php
434
+ do_settings_sections( 'menu-image-general-settings-group' );
435
+ ?>
436
+ <?php
437
+ do_settings_sections( 'menu-image-settings-group' );
438
+ ?>
439
+ <?php
440
+ settings_fields( 'menu-image-settings-group' );
441
+ ?>
442
+ <input type="hidden" name="updated" value="true" />
443
+ <?php
444
+ submit_button();
445
+ ?>
446
+ </form>
447
+ </div>
448
+ </div>
449
+ <?php
450
+ }
451
 
452
+ /*
453
+ * Render the HTML of menu_image_size_1 option.
454
+ */
455
+ function menu_image_size_1_render()
456
+ {
457
+ ?>
458
+ <input name="menu_image_size_1" type="text" value="<?php
459
+ echo get_option( 'menu_image_size_1', '24x24' ) ;
460
+ ?>" /><span class="helper"><?php
461
+ _e( 'Use this format (24x24), width and height.', 'menu-image' );
462
+ ?></span>
463
+ <?php
464
+ }
465
+
466
+ /*
467
+ * Render the HTML of menu_image_size_2 option.
468
+ */
469
+ function menu_image_size_2_render()
470
+ {
471
+ ?>
472
+ <input name="menu_image_size_2" type="text" value="<?php
473
+ echo get_option( 'menu_image_size_2', '36x36' ) ;
474
+ ?>" /><span class="helper"><?php
475
+ _e( 'Use this format (36x36), width and height.', 'menu-image' );
476
+ ?></span>
477
+ <?php
478
+ }
479
+
480
+ /*
481
+ * Render the HTML of menu_image_size_3 option.
482
+ */
483
+ function menu_image_size_3_render()
484
+ {
485
+ ?>
486
+ <input name="menu_image_size_3" type="text" value="<?php
487
+ echo get_option( 'menu_image_size_3', '48x48' ) ;
488
+ ?>" /><span class="helper"><?php
489
+ _e( 'Use this format (48x48), width and height.', 'menu-image' );
490
+ ?></span>
491
+ </br></br><span class="helper"> If you change the image sizes after uploading the images you will need to regenerate all thumbnails using this </span><a href="https://wordpress.org/plugins/regenerate-thumbnails/" target="_blank">plugin</a>.<p>It will also be necessary to select the icon image again in the menu items if you replaced any of the used custom image sizes.</p>
492
+ <?php
493
+ }
494
+
495
+ /*
496
+ * Render the HTML of menu_image_hover option.
497
+ */
498
+ function menu_image_hover_render()
499
+ {
500
+ ?>
501
+ <input name="menu_image_hover" type="checkbox" value="1" <?php
502
+ checked( '1', get_option( 'menu_image_hover', '1' ) );
503
+ ?> /><span class="helper"><?php
504
+ _e( 'Enable the image on hover field', 'menu-image' );
505
+ ?></span>
506
+ <?php
507
+ }
508
+
509
+ /*
510
+ * Register Menu Image settings
511
+ */
512
+ public function register_menu_image_settings()
513
+ {
514
+ add_settings_section(
515
+ 'menu_image_general_options_section',
516
+ __( 'General options', 'menu-image' ),
517
+ '',
518
+ 'menu-image-general-settings-group'
519
+ );
520
+ add_settings_field(
521
+ 'menu_image_hover',
522
+ __( 'Menu image Hover', 'menu-image' ),
523
+ array( $this, 'menu_image_hover_render' ),
524
+ 'menu-image-general-settings-group',
525
+ 'menu_image_general_options_section'
526
+ );
527
+ add_settings_section(
528
+ 'menu_image_sizes_section',
529
+ __( 'Image Sizes', 'menu-image' ),
530
+ '',
531
+ 'menu-image-settings-group'
532
+ );
533
+ add_settings_field(
534
+ 'menu_image_size_1',
535
+ __( '1st Menu Image size', 'menu-image' ),
536
+ array( $this, 'menu_image_size_1_render' ),
537
+ 'menu-image-settings-group',
538
+ 'menu_image_sizes_section'
539
+ );
540
+ add_settings_field(
541
+ 'menu_image_size_2',
542
+ __( '2nd Menu Image size', 'menu-image' ),
543
+ array( $this, 'menu_image_size_2_render' ),
544
+ 'menu-image-settings-group',
545
+ 'menu_image_sizes_section'
546
+ );
547
+ add_settings_field(
548
+ 'menu_image_size_3',
549
+ __( '3rd Menu Image size', 'menu-image' ),
550
+ array( $this, 'menu_image_size_3_render' ),
551
+ 'menu-image-settings-group',
552
+ 'menu_image_sizes_section'
553
+ );
554
+ }
555
+
556
+ /**
557
+ * Initialization action.
558
+ *
559
+ * Adding image sizes for most popular menu icon sizes. Adding thumbnail
560
+ * support to menu post type.
561
+ */
562
+ public function menu_image_init()
563
+ {
564
+ add_post_type_support( 'nav_menu_item', array( 'thumbnail' ) );
565
+ $this->image_sizes = apply_filters( 'menu_image_default_sizes', $this->image_sizes );
566
+ if ( is_array( $this->image_sizes ) ) {
567
+ foreach ( $this->image_sizes as $name => $params ) {
568
+ add_image_size(
569
+ $name,
570
+ $params[0],
571
+ $params[1],
572
+ ( array_key_exists( 2, $params ) ? $params[2] : false )
573
+ );
574
+ }
575
+ }
576
+ load_plugin_textdomain( 'menu-image', false, basename( dirname( __FILE__ ) ) . '/languages' );
577
+ }
578
+
579
+ /**
580
+ * Adding images as screen options.
581
+ *
582
+ * If not checked screen option 'image', uploading form not showed.
583
+ *
584
+ * @param array $columns
585
+ *
586
+ * @return array
587
+ */
588
+ public function menu_image_nav_menu_manage_columns( $columns )
589
+ {
590
+ return $columns + array(
591
+ 'image' => __( 'Image', 'menu-image' ),
592
+ );
593
+ }
594
+
595
+ /**
596
+ * Saving post action.
597
+ *
598
+ * Saving uploaded images and attach/detach to image post type.
599
+ *
600
+ * @param int $post_id
601
+ * @param WP_Post $post
602
+ */
603
+ public function menu_image_save_post_action( $post_id )
604
+ {
605
+ $menu_image_settings = array(
606
+ 'menu_item_image_title_position',
607
+ 'menu_item_image_button',
608
+ 'menu_image_icon',
609
+ 'menu_item_image_type',
610
+ 'menu_item_image_notification'
611
+ );
612
+
613
+ if ( isset( $_POST['menu_item_id'] ) ) {
614
+ $post_id = $_POST['menu_item_id'];
615
+ } else {
616
+ return '';
617
+ }
618
+
619
+ foreach ( $menu_image_settings as $setting_name ) {
620
+ if ( isset( $_POST[$setting_name] ) ) {
621
+ // Save the button option fields.
622
+ switch ( $setting_name ) {
623
+ case 'menu_item_image_button':
624
+ $menu_image_button = array();
625
+ // Update if set has a button.
626
+
627
+ if ( $_POST[$setting_name] == 'true' ) {
628
+ $menu_image_button['button_enabled'] = 'yes';
629
+ } else {
630
+ $menu_image_button['button_enabled'] = 'no';
631
+ }
632
+
633
+ $menu_image_button['border_radius'] = $_POST['menu_item_button_border_radius'];
634
+ $menu_image_button['color'] = $_POST['menu_image_button_color'];
635
+ $menu_image_button['bg_color'] = $_POST['menu_image_button_bg_color'];
636
+ $menu_image_button['button_style'] = $_POST['menu_image_button_style'];
637
+ $menu_image_button['padding_top'] = $_POST['menu_image_button_pd_top'];
638
+ $menu_image_button['padding_left'] = $_POST['menu_image_button_pd_left'];
639
+ $menu_image_button['padding_right'] = $_POST['menu_image_button_pd_right'];
640
+ $menu_image_button['padding_bottom'] = $_POST['menu_image_button_pd_bottom'];
641
+ update_post_meta( $post_id, '_menu_item_image_button', array_map( 'sanitize_text_field', $menu_image_button ) );
642
+ break;
643
+ case 'menu_item_image_notification':
644
+ $menu_image_notification = array();
645
+ switch ( $_POST[$setting_name] ) {
646
+ case 'bubble':
647
+ $menu_image_notification['type'] = 'bubble';
648
+ $menu_image_notification['bubble_color'] = $_POST['bubble_color'];
649
+ $menu_image_notification['bubble_func'] = $_POST['bubble_func'];
650
+ break;
651
+ case 'badge':
652
+ $menu_image_notification['type'] = 'badge';
653
+ $menu_image_notification['badge_color'] = $_POST['badge_color'];
654
+ $menu_image_notification['badge_text'] = $_POST['badge_text'];
655
+ break;
656
+ default:
657
+ $menu_image_notification['type'] = 'none';
658
+ }
659
+ update_post_meta( $post_id, '_menu_item_image_notification', array_map( 'sanitize_text_field', $menu_image_notification ) );
660
+ break;
661
+ default:
662
+ update_post_meta( $post_id, "_{$setting_name}", esc_sql( $_POST[$setting_name] ) );
663
+ break;
664
+ }
665
+ }
666
+ }
667
+ }
668
+
669
+ /**
670
+ * Save item settings while WPML sync menus.
671
+ *
672
+ * @param $item_menu_id
673
+ * @param $menu_item_db_id
674
+ */
675
+ public function wp_update_nav_menu_item_action( $item_menu_id, $menu_item_db_id )
676
+ {
677
+ global $sitepress, $icl_menus_sync ;
678
+
679
+ if ( class_exists( 'SitePress' ) && $sitepress instanceof SitePress && class_exists( 'ICLMenusSync' ) && $icl_menus_sync instanceof ICLMenusSync ) {
680
+ static $run_times = array() ;
681
+ $menu_image_settings = array(
682
+ 'menu_item_image_size',
683
+ 'menu_item_image_title_position',
684
+ 'thumbnail_id',
685
+ 'thumbnail_hover_id'
686
+ );
687
+ // iterate synchronized menus.
688
+ foreach ( $icl_menus_sync->menus as $menu_id => $menu_data ) {
689
+ if ( !isset( $_POST['sync']['add'][$menu_id] ) ) {
690
+ continue;
691
+ }
692
+ // remove cache and get language current item menu.
693
+ $cache_key = md5( serialize( array( $item_menu_id, 'tax_nav_menu' ) ) );
694
+ $cache_group = 'get_language_for_element';
695
+ wp_cache_delete( $cache_key, $cache_group );
696
+ $lang = $sitepress->get_language_for_element( $item_menu_id, 'tax_nav_menu' );
697
+ if ( !isset( $run_times[$menu_id][$lang] ) ) {
698
+ $run_times[$menu_id][$lang] = 0;
699
+ }
700
+ // Count static var for each menu id and saved item language
701
+ // and get original item id from counted position of synchronized
702
+ // items from POST data. That's all magic.
703
+ $post_item_ids = array();
704
+ foreach ( $_POST['sync']['add'][$menu_id] as $id => $lang_array ) {
705
+ if ( array_key_exists( $lang, $lang_array ) ) {
706
+ $post_item_ids[] = $id;
707
+ }
708
+ }
709
+ if ( !array_key_exists( $run_times[$menu_id][$lang], $post_item_ids ) ) {
710
+ continue;
711
+ }
712
+ $orig_item_id = $post_item_ids[$run_times[$menu_id][$lang]];
713
+ // iterate all item settings and save it for new item.
714
+ $orig_item_meta = get_metadata( 'post', $orig_item_id );
715
+ foreach ( $menu_image_settings as $meta ) {
716
+ if ( isset( $orig_item_meta["_{$meta}"] ) && isset( $orig_item_meta["_{$meta}"][0] ) ) {
717
+ update_post_meta( $menu_item_db_id, "_{$meta}", $orig_item_meta["_{$meta}"][0] );
718
+ }
719
+ }
720
+ $run_times[$menu_id][$lang]++;
721
+ break;
722
+ }
723
+ }
724
+
725
+ }
726
+
727
+ /**
728
+ * Load menu image meta for each menu item.
729
+ *
730
+ * @since 2.0
731
+ */
732
+ public function menu_image_wp_setup_nav_menu_item( $item )
733
+ {
734
+ // Get Thumbnail ID.
735
+ if ( !isset( $item->thumbnail_id ) ) {
736
+ $item->thumbnail_id = get_post_thumbnail_id( $item->ID );
737
+ }
738
+ // Get Thumbnail Hover id.
739
+ if ( !isset( $item->thumbnail_hover_id ) ) {
740
+ $item->thumbnail_hover_id = get_post_meta( $item->ID, '_thumbnail_hover_id', true );
741
+ }
742
+ // Get Image Size.
743
+ if ( !isset( $item->image_size ) ) {
744
+ $item->image_size = get_post_meta( $item->ID, '_menu_item_image_size', true );
745
+ }
746
+ // Get Title Position.
747
+ if ( !isset( $item->title_position ) ) {
748
+ $item->title_position = get_post_meta( $item->ID, '_menu_item_image_title_position', true );
749
+ }
750
+ $menu_image_button = get_post_meta( $item->ID, '_menu_item_image_button', true );
751
+ $menu_item_type = get_post_meta( $item->ID, '_menu_item_image_type', true );
752
+ $item->menu_image_icon_type = $menu_item_type;
753
+ // Button settings.
754
+
755
+ if ( isset( $menu_image_button['button_enabled'] ) && $menu_image_button['button_enabled'] == 'yes' ) {
756
+ $item->button_color = $menu_image_button['color'];
757
+ $item->button_bg_color = $menu_image_button['bg_color'];
758
+ $item->button_style = $menu_image_button['button_style'];
759
+ $item->button_border_radius = $menu_image_button['border_radius'];
760
+ }
761
+
762
+ // Get the Notification type.
763
+ $image_notification = get_post_meta( $item->ID, '_menu_item_image_notification', true );
764
+
765
+ if ( $image_notification ) {
766
+ // Bubble data.
767
+
768
+ if ( $image_notification['type'] == 'bubble' ) {
769
+ $item->bubble_color = $image_notification['bubble_color'];
770
+ $item->bubble_number_func = $image_notification['bubble_func'];
771
+ }
772
+
773
+ // Badge data.
774
+
775
+ if ( $image_notification['type'] == 'badge' ) {
776
+ $item->badge_color = $image_notification['badge_color'];
777
+ $item->badge_text = $image_notification['badge_text'];
778
+ }
779
+
780
+ }
781
+
782
+ return $item;
783
+ }
784
+
785
+ /**
786
+ * Filters the HTML attributes applied to a menu item's anchor element.
787
+ *
788
+ * @param array $atts {
789
+ * The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
790
+ *
791
+ * @type string $title Title attribute.
792
+ * @type string $target Target attribute.
793
+ * @type string $rel The rel attribute.
794
+ * @type string $href The href attribute.
795
+ * }
796
+ * @param WP_Post $item The current menu item.
797
+ * @param stdClass $args An object of wp_nav_menu() arguments.
798
+ * @param int $depth Depth of menu item. Used for padding.
799
+ *
800
+ * @return array Link attributes.
801
+ */
802
+ public function menu_image_nav_menu_link_attributes_filter(
803
+ $atts,
804
+ $item,
805
+ $args,
806
+ $depth = null
807
+ )
808
+ {
809
+
810
+ if ( isset( $item->thumbnail_id ) && '' !== $item->thumbnail_id ) {
811
+ $this->setProcessed( $item->ID );
812
+ $position = ( $item->title_position ? $item->title_position : apply_filters( 'menu_image_default_title_position', 'after' ) );
813
+ $class = ( !empty($atts['class']) ? $atts['class'] : '' );
814
+ $class .= " menu-image-title-{$position}";
815
+
816
+ if ( $item->thumbnail_hover_id ) {
817
+ $class .= ' menu-image-hovered';
818
+ } elseif ( $item->thumbnail_id ) {
819
+ $class .= ' menu-image-not-hovered';
820
+ }
821
+
822
+ // Fix dropdown menu for Flatsome theme.
823
+ if ( !empty($args->walker) && class_exists( 'FlatsomeNavDropdown' ) && $args->walker instanceof FlatsomeNavDropdown && !is_null( $depth ) && $depth === 0 ) {
824
+ $class .= ' nav-top-link';
825
+ }
826
+ $atts['class'] = trim( $class );
827
+ }
828
+
829
+ return $atts;
830
+ }
831
+
832
+ /**
833
+ * Replacement default menu item output.
834
+ *
835
+ * @param string $title Default item output
836
+ * @param object $item Menu item data object.
837
+ * @param int $depth Depth of menu item. Used for padding.
838
+ * @param object $args
839
+ *
840
+ * @return string
841
+ */
842
+ public function menu_image_nav_menu_item_title_filter(
843
+ $title,
844
+ $item = null,
845
+ $depth = null,
846
+ $args = null
847
+ )
848
+ {
849
+ if ( strpos( $title, 'menu-image' ) > 0 || !is_nav_menu_item( $item ) || !isset( $item ) ) {
850
+ return $title;
851
+ }
852
+ if ( is_numeric( $item ) && $item < 0 ) {
853
+ return $title;
854
+ }
855
+ if ( is_numeric( $item ) && $item > 0 ) {
856
+ $item = wp_setup_nav_menu_item( get_post( $item ) );
857
+ }
858
+ // Check if we will add an icon or image to the menu item.
859
+
860
+ if ( $item->menu_image_icon_type != 'icon' ) {
861
+
862
+ if ( isset( $item->thumbnail_id ) && '' !== $item->thumbnail_id ) {
863
+ $image_size = ( $item->image_size ? $item->image_size : apply_filters( 'menu_image_default_size', 'menu-36x36' ) );
864
+ $position = ( $item->title_position ? $item->title_position : apply_filters( 'menu_image_default_title_position', 'after' ) );
865
+ $class = "menu-image-title-{$position}";
866
+ $this->setUsedAttachments( $image_size, $item->thumbnail_id );
867
+ $image = '';
868
+
869
+ if ( $item->thumbnail_hover_id ) {
870
+ $this->setUsedAttachments( $image_size, $item->thumbnail_hover_id );
871
+ $hover_image_src = wp_get_attachment_image_src( $item->thumbnail_hover_id, $image_size );
872
+ $margin_size = $hover_image_src[1];
873
+ $image = "<span class='menu-image-hover-wrapper'>";
874
+ $image .= wp_get_attachment_image(
875
+ $item->thumbnail_id,
876
+ $image_size,
877
+ false,
878
+ "class=menu-image {$class}"
879
+ );
880
+ $image .= wp_get_attachment_image(
881
+ $item->thumbnail_hover_id,
882
+ $image_size,
883
+ false,
884
+ array(
885
+ 'class' => "hovered-image {$class}",
886
+ 'style' => "margin-left: -{$margin_size}px;",
887
+ )
888
+ );
889
+ $image .= '</span>';
890
+ } elseif ( $item->thumbnail_id ) {
891
+ $image = wp_get_attachment_image(
892
+ $item->thumbnail_id,
893
+ $image_size,
894
+ false,
895
+ "class=menu-image {$class}"
896
+ );
897
+ }
898
+
899
+ }
900
+
901
+ } else {
902
+ $selected_icon = get_post_meta( $item->ID, '_menu_image_icon', true );
903
+ $position = ( $item->title_position ? $item->title_position : apply_filters( 'menu_image_default_title_position', 'after' ) );
904
+ $class = "menu-image-title-{$position}";
905
+ $image = '<span class="dashicons ' . $selected_icon . ' ' . $position . '-menu-image-icons"></span>';
906
+ }
907
+
908
+ $none = '';
909
+ // Sugar.
910
+ $image = apply_filters( 'menu_image_img_html', $image );
911
+ $class .= ' menu-image-title';
912
+ switch ( $position ) {
913
+ case 'hide':
914
+ case 'before':
915
+ case 'above':
916
+ $item_args = array(
917
+ $none,
918
+ $class,
919
+ $title,
920
+ $image
921
+ );
922
+ break;
923
+ case 'after':
924
+ default:
925
+ $item_args = array(
926
+ $image,
927
+ $class,
928
+ $title,
929
+ $none
930
+ );
931
+ break;
932
+ }
933
+ $title = vsprintf( '%s<span class="%s">%s</span>%s', $item_args );
934
+ return $title;
935
+ }
936
+
937
+ /**
938
+ * Replacement default menu item output.
939
+ *
940
+ * @param string $item_output Default item output.
941
+ * @param object $item Menu item data object.
942
+ * @param int $depth Depth of menu item. Used for padding.
943
+ * @param object $args
944
+ *
945
+ * @return string
946
+ */
947
+ public function menu_image_nav_menu_item_filter(
948
+ $item_output,
949
+ $item,
950
+ $depth,
951
+ $args
952
+ )
953
+ {
954
+ if ( $this->isProcessed( $item->ID ) ) {
955
+ return $item_output;
956
+ }
957
+ $attributes = ( !empty($item->attr_title) ? ' title="' . esc_attr( $item->attr_title ) . '"' : '' );
958
+ $attributes .= ( !empty($item->target) ? ' target="' . esc_attr( $item->target ) . '"' : '' );
959
+ $attributes .= ( !empty($item->xfn) ? ' rel="' . esc_attr( $item->xfn ) . '"' : '' );
960
+ $attributes .= ( !empty($item->url) ? ' href="' . esc_attr( $item->url ) . '"' : '' );
961
+ $attributes_array = shortcode_parse_atts( $attributes );
962
+ $image_size = ( $item->image_size ? $item->image_size : apply_filters( 'menu_image_default_size', 'menu-36x36' ) );
963
+ $position = ( $item->title_position ? $item->title_position : apply_filters( 'menu_image_default_title_position', 'after' ) );
964
+ $class = "menu-image-title-{$position}";
965
+ $this->setUsedAttachments( $image_size, $item->thumbnail_id );
966
+ $image = '';
967
+
968
+ if ( $item->thumbnail_hover_id ) {
969
+ $this->setUsedAttachments( $image_size, $item->thumbnail_hover_id );
970
+ $hover_image_src = wp_get_attachment_image_src( $item->thumbnail_hover_id, $image_size );
971
+ $margin_size = $hover_image_src[1];
972
+ $image = "<span class='menu-image-hover-wrapper'>";
973
+ $image .= wp_get_attachment_image(
974
+ $item->thumbnail_id,
975
+ $image_size,
976
+ false,
977
+ "class=menu-image {$class}"
978
+ );
979
+ $image .= wp_get_attachment_image(
980
+ $item->thumbnail_hover_id,
981
+ $image_size,
982
+ false,
983
+ array(
984
+ 'class' => "hovered-image {$class}",
985
+ 'style' => "margin-left: -{$margin_size}px;",
986
+ )
987
+ );
988
+ $image .= '</span>';
989
+ $class .= ' menu-image-hovered';
990
+ } elseif ( $item->thumbnail_id ) {
991
+ $image = wp_get_attachment_image(
992
+ $item->thumbnail_id,
993
+ $image_size,
994
+ false,
995
+ "class=menu-image {$class}"
996
+ );
997
+ $class .= ' menu-image-not-hovered';
998
+ }
999
+
1000
+ $attributes_array['class'] = $class;
1001
+ /**
1002
+ * Filter the menu link attributes.
1003
+ *
1004
+ * @since 2.6.7
1005
+ *
1006
+ * @param array $attributes An array of attributes.
1007
+ * @param object $item Menu item data object.
1008
+ * @param int $depth Depth of menu item. Used for padding.
1009
+ * @param object $args
1010
+ */
1011
+ $attributes_array = apply_filters(
1012
+ 'menu_image_link_attributes',
1013
+ $attributes_array,
1014
+ $item,
1015
+ $depth,
1016
+ $args
1017
+ );
1018
+ $attributes = '';
1019
+ foreach ( $attributes_array as $attr_name => $attr_value ) {
1020
+ $attributes .= "{$attr_name}=\"{$attr_value}\" ";
1021
+ }
1022
+ $attributes = trim( $attributes );
1023
+ $item_output = "{$args->before}<a {$attributes}>";
1024
+ $link = $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
1025
+ $none = '';
1026
+ // Sugar.
1027
+ $image = apply_filters( 'menu_image_img_html', $image );
1028
+ switch ( $position ) {
1029
+ case 'hide':
1030
+ case 'before':
1031
+ case 'above':
1032
+ $item_args = array( $none, $link, $image );
1033
+ break;
1034
+ case 'after':
1035
+ default:
1036
+ $item_args = array( $image, $link, $none );
1037
+ break;
1038
+ }
1039
+ $item_output .= vsprintf( '%s<span class="menu-image-title">%s</span>%s', $item_args );
1040
+ $item_output .= "</a>{$args->after}";
1041
+ return $item_output;
1042
+ }
1043
+
1044
+ /**
1045
+ * Loading additional stylesheet.
1046
+ *
1047
+ * Loading custom stylesheet to fix images positioning in match themes
1048
+ */
1049
+ public function menu_image_add_inline_style_action()
1050
+ {
1051
+ wp_register_style(
1052
+ 'menu-image',
1053
+ plugins_url( '', __FILE__ ) . '/includes/css/menu-image.css',
1054
+ array(),
1055
+ MENU_IMAGE_VERSION
1056
+ );
1057
+ wp_enqueue_style( 'menu-image' );
1058
+
1059
+ if ( !wp_style_is( 'fontawesome', 'enqueued' ) ) {
1060
+ wp_register_script( 'font-awesome', 'https://kit.fontawesome.com/7873a4d9d1.js', array( 'jquery' ) );
1061
+ wp_enqueue_script( 'font-awesome' );
1062
+ }
1063
+
1064
+ }
1065
+
1066
+ public function wp_menu_image_fontawesome_admin_notice()
1067
+ {
1068
+ ?>
1069
+
1070
+ <div class="wp-menu-image-notice notice notice-success is-dismissible" data-ajax-nonce="<?php
1071
+ echo wp_create_nonce( 'menu-image-fa-security-nonce' ) ;
1072
+ ?>">
1073
+ <span class="dashicons dashicons-warning"></span>
1074
+
1075
+ <?php
1076
+ _e( '<strong>Menu Image - In order to use the FontAwesome icons you need to install the official FontAwesome plugin and select the SVG tecnhonoly. Check <a href="https://www.wpmenuimage.com/knowledgebase/general-options/add-icons-to-menu-items/?utm_source=menu-image-settings&utm_medium=user%20website&utm_campaign=install-fontawesome#fontawesome" target="_blank" >here</a> how to do it.</strong>', 'mobile-menu' );
1077
+ ?>
1078
+ </div>
1079
 
1080
+ <?php
1081
+ }
1082
+
1083
+ /**
1084
+ * Dismiss the Menu Image Fontawesome Notice.
1085
+ */
1086
+ public function dismiss_wp_menu_image_fa_notice()
1087
+ {
1088
+ if ( check_ajax_referer( 'menu-image-fa-security-nonce', 'security' ) ) {
1089
+ update_option( 'wp_menu_image_fa_dismissed', 'yes' );
1090
+ }
1091
+ wp_die();
1092
+ }
1093
+
1094
+ /**
1095
+ * Load Admin scripts
1096
+ */
1097
+ public function admin_enqueue_scripts( $hook )
1098
+ {
1099
+ //TODO: Add banner in Menu Image screen options
1100
+ if ( 'toplevel_page_menu-image-options' === $hook ) {
1101
+ // Check if FontAwesome.
1102
+ if ( !in_array( 'font-awesome/index.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) && get_option( 'wp_menu_image_fa_dismissed', 'no' ) != 'yes' ) {
1103
+ add_action( 'admin_notices', array( $this, 'wp_menu_image_fontawesome_admin_notice' ) );
1104
+ }
1105
+ }
1106
+
1107
+ if ( 'nav-menus.php' === $hook ) {
1108
+ wp_enqueue_style( 'wp-color-picker' );
1109
+ wp_enqueue_script( 'wp-color-picker' );
1110
+ }
1111
+
1112
+ if ( 'nav-menus.php' === $hook || 'toplevel_page_menu-image-options' === $hook ) {
1113
+ wp_enqueue_style( 'menu-image-admin-css', plugins_url( 'includes/css/menu-image-admin.css', __FILE__ ) );
1114
+ }
1115
+ }
1116
+
1117
+ /**
1118
+ * Loading media-editor script ot nav-menus page.
1119
+ *
1120
+ * @since 2.0
1121
+ */
1122
+ public function menu_image_admin_head_nav_menus_action()
1123
+ {
1124
+ wp_enqueue_script(
1125
+ 'menu-image-admin',
1126
+ plugins_url( '/includes/js/menu-image-admin.js', __FILE__ ),
1127
+ array( 'jquery' ),
1128
+ MENU_IMAGE_VERSION
1129
+ );
1130
+ wp_localize_script( 'menu-image-admin', 'menuImage', array(
1131
+ 'l10n' => array(
1132
+ 'uploaderTitle' => __( 'Chose menu image', 'menu-image' ),
1133
+ 'uploaderButtonText' => __( 'Select', 'menu-image' ),
1134
+ ),
1135
+ 'settings' => array(
1136
+ 'nonce' => wp_create_nonce( 'update-menu-item' ),
1137
+ ),
1138
+ ) );
1139
+ wp_enqueue_media();
1140
+ wp_enqueue_style( 'editor-buttons' );
1141
+ }
1142
+
1143
+ /**
1144
+ * When menu item removed remove menu image metadata.
1145
+ */
1146
+ public function menu_image_delete_menu_item_image_action()
1147
+ {
1148
+ $menu_item_id = (int) $_REQUEST['menu-item'];
1149
+ check_admin_referer( 'delete-menu_item_image_' . $menu_item_id );
1150
+
1151
+ if ( is_nav_menu_item( $menu_item_id ) && has_post_thumbnail( $menu_item_id ) ) {
1152
+ delete_post_thumbnail( $menu_item_id );
1153
+ delete_post_meta( $menu_item_id, '_thumbnail_hover_id' );
1154
+ delete_post_meta( $menu_item_id, '_menu_item_image_size' );
1155
+ delete_post_meta( $menu_item_id, '_menu_item_image_title_position' );
1156
+ //TODO include other postmeta
1157
+ }
1158
+
1159
+ }
1160
+
1161
+ /**
1162
+ * Output HTML for the menu item images.
1163
+ *
1164
+ * @since 2.0
1165
+ *
1166
+ * @param int $item_id The post ID or object associated with the thumbnail, defaults to global $post.
1167
+ *
1168
+ * @return string html
1169
+ */
1170
+ public function wp_post_thumbnail_only_html( $item_id )
1171
+ {
1172
+ $default_size = apply_filters( 'menu_image_default_size', 'menu-24x24' );
1173
+ $markup = '<p class="description description-half" ><label>%s</label><a title="%s" href="#" class="set-post-thumbnail button%s" data-item-id="%s" style="height: auto;">%s</a>%s</p>';
1174
+ $thumbnail_id = get_post_thumbnail_id( $item_id );
1175
+ $content = sprintf(
1176
+ $markup,
1177
+ esc_html__( 'Image', 'menu-image' ),
1178
+ ( $thumbnail_id ? esc_attr__( 'Change menu item image', 'menu-image' ) : esc_attr__( 'Set menu item image', 'menu-image' ) ),
1179
+ '',
1180
+ $item_id,
1181
+ ( $thumbnail_id ? wp_get_attachment_image(
1182
+ $thumbnail_id,
1183
+ $default_size,
1184
+ '',
1185
+ array(
1186
+ 'class' => 'menu-img-normal',
1187
+ )
1188
+ ) : esc_html__( 'Set image', 'menu-image' ) ),
1189
+ ( $thumbnail_id ? '<a href="#" class="remove-post-thumbnail">' . __( 'Remove', 'menu-image' ) . '</a>' : '' )
1190
+ );
1191
+ // Menu image on hover if enabled.
1192
+
1193
+ if ( '1' == get_option( 'menu_image_hover', '1' ) ) {
1194
+ $hover_id = get_post_meta( $item_id, '_thumbnail_hover_id', true );
1195
+ $content .= sprintf(
1196
+ $markup,
1197
+ esc_html__( 'Image on hover', 'menu-image' ),
1198
+ ( $hover_id ? esc_attr__( 'Change menu item image on hover', 'menu-image' ) : esc_attr__( 'Set menu item image on hover', 'menu-image' ) ),
1199
+ ' hover-image',
1200
+ $item_id,
1201
+ ( $hover_id ? wp_get_attachment_image(
1202
+ $hover_id,
1203
+ $default_size,
1204
+ '',
1205
+ array(
1206
+ 'class' => 'menu-img-hover',
1207
+ )
1208
+ ) : esc_html__( 'Set image on hover', 'menu-image' ) ),
1209
+ ( $hover_id ? '<a href="#" class="remove-post-thumbnail hover-image">' . __( 'Remove', 'menu-image' ) . '</a>' : '' )
1210
+ );
1211
+ }
1212
+
1213
+ return $content;
1214
+ }
1215
+
1216
+ public function menu_image_build_dashicons_list( $item_id )
1217
+ {
1218
+ $dashicons = [];
1219
+ $dashicons = explode( ',', 'dashicons-menu,
1220
+ dashicons-menu-alt,
1221
+ dashicons-menu-alt2,
1222
+ dashicons-menu-alt3,
1223
+ dashicons-admin-site,
1224
+ dashicons-admin-site-alt,
1225
+ dashicons-admin-site-alt2,
1226
+ dashicons-admin-site-alt3,
1227
+ dashicons-admin-site-alt2,
1228
+ dashicons-admin-site-alt3,
1229
+ dashicons-admin-site-alt3,
1230
+ dashicons-dashboard,
1231
+ dashicons-admin-post,
1232
+ dashicons-admin-media,
1233
+ dashicons-admin-links,
1234
+ dashicons-admin-page,
1235
+ dashicons-admin-comments,
1236
+ dashicons-admin-appearance,
1237
+ dashicons-admin-plugins,
1238
+ dashicons-plugins-checked,
1239
+ dashicons-admin-users,
1240
+ dashicons-admin-tools,
1241
+ dashicons-admin-settings,
1242
+ dashicons-admin-network,
1243
+ dashicons-admin-home,
1244
+ dashicons-admin-generic,
1245
+ dashicons-admin-collapse,
1246
+ dashicons-filter,
1247
+ dashicons-admin-customizer,
1248
+ dashicons-admin-multisite,
1249
+ dashicons-welcome-write-blog,
1250
+ dashicons-welcome-add-page,
1251
+ dashicons-welcome-view-site,
1252
+ dashicons-welcome-widgets-menus,
1253
+ dashicons-welcome-comments,
1254
+ dashicons-welcome-learn-more,
1255
+ dashicons-format-aside,
1256
+ dashicons-format-image,
1257
+ dashicons-format-gallery,
1258
+ dashicons-format-video,
1259
+ dashicons-format-status,
1260
+ dashicons-format-quote,
1261
+ dashicons-format-chat,
1262
+ dashicons-format-audio,
1263
+ dashicons-camera,
1264
+ dashicons-camera-alt,
1265
+ dashicons-images-alt,
1266
+ dashicons-images-alt2,
1267
+ dashicons-video-alt,
1268
+ dashicons-video-alt2,
1269
+ dashicons-video-alt3,
1270
+ dashicons-media-archive,
1271
+ dashicons-media-audio,
1272
+ dashicons-media-code,
1273
+ dashicons-media-default,
1274
+ dashicons-media-document,
1275
+ dashicons-media-interactive,
1276
+ dashicons-media-spreadsheet,
1277
+ dashicons-media-text,
1278
+ dashicons-media-video,
1279
+ dashicons-playlist-audio,
1280
+ dashicons-playlist-video,
1281
+ dashicons-controls-play,
1282
+ dashicons-controls-pause,
1283
+ dashicons-controls-forward,
1284
+ dashicons-controls-skipforward,
1285
+ dashicons-controls-back,
1286
+ dashicons-controls-skipback,
1287
+ dashicons-controls-repeat,
1288
+ dashicons-controls-volumeon,
1289
+ dashicons-controls-volumeoff,
1290
+ dashicons-image-crop,
1291
+ dashicons-image-rotate,
1292
+ dashicons-image-rotate-left,
1293
+ dashicons-image-rotate-right,
1294
+ dashicons-image-flip-vertical,
1295
+ dashicons-image-flip-horizontal,
1296
+ dashicons-image-filter,
1297
+ dashicons-undo,
1298
+ dashicons-redo,
1299
+ dashicons-database-add,
1300
+ dashicons-database,
1301
+ dashicons-database-export,
1302
+ dashicons-database-import,
1303
+ dashicons-database-remove,
1304
+ dashicons-database-view,
1305
+ dashicons-align-full-width,
1306
+ dashicons-align-pull-left,
1307
+ dashicons-align-pull-right,
1308
+ dashicons-align-wide,
1309
+ dashicons-block-default,
1310
+ dashicons-button,
1311
+ dashicons-cloud-saved,
1312
+ dashicons-cloud-upload,
1313
+ dashicons-columns,
1314
+ dashicons-cover-image,
1315
+ dashicons-ellipsis,
1316
+ dashicons-embed-audio,
1317
+ dashicons-embed-generic,
1318
+ dashicons-embed-photo,
1319
+ dashicons-embed-post,
1320
+ dashicons-embed-video,
1321
+ dashicons-exit,
1322
+ dashicons-heading,
1323
+ dashicons-html,
1324
+ dashicons-info-outline,
1325
+ dashicons-insert,
1326
+ dashicons-insert-after,
1327
+ dashicons-insert-before,
1328
+ dashicons-remove,
1329
+ dashicons-saved,
1330
+ dashicons-shortcode,
1331
+ dashicons-table-col-after,
1332
+ dashicons-table-col-before,
1333
+ dashicons-table-col-delete,
1334
+ dashicons-table-row-after,
1335
+ dashicons-table-row-before,
1336
+ dashicons-table-row-delete,
1337
+ dashicons-editor-bold,
1338
+ dashicons-editor-italic,
1339
+ dashicons-editor-ul,
1340
+ dashicons-editor-ol,
1341
+ dashicons-editor-ol-rtl,
1342
+ dashicons-editor-quote,
1343
+ dashicons-editor-alignleft,
1344
+ dashicons-editor-aligncenter,
1345
+ dashicons-editor-alignright,
1346
+ dashicons-editor-insertmore,
1347
+ dashicons-editor-spellcheck,
1348
+ dashicons-editor-expand,
1349
+ dashicons-editor-contract,
1350
+ dashicons-editor-kitchensink,
1351
+ dashicons-editor-underline,
1352
+ dashicons-editor-justify,
1353
+ dashicons-editor-textcolor,
1354
+ dashicons-editor-paste-word,
1355
+ dashicons-editor-paste-text,
1356
+ dashicons-editor-removeformatting,
1357
+ dashicons-editor-video,
1358
+ dashicons-editor-customchar,
1359
+ dashicons-editor-outdent,
1360
+ dashicons-editor-indent,
1361
+ dashicons-editor-help,
1362
+ dashicons-editor-strikethrough,
1363
+ dashicons-editor-unlink,
1364
+ dashicons-editor-rtl,
1365
+ dashicons-editor-ltr,
1366
+ dashicons-editor-break,
1367
+ dashicons-editor-code,
1368
+ dashicons-editor-paragraph,
1369
+ dashicons-editor-table,
1370
+ dashicons-align-left,
1371
+ dashicons-align-right,
1372
+ dashicons-align-center,
1373
+ dashicons-align-none,
1374
+ dashicons-lock,
1375
+ dashicons-unlock,
1376
+ dashicons-calendar,
1377
+ dashicons-calendar-alt,
1378
+ dashicons-visibility,
1379
+ dashicons-hidden,
1380
+ dashicons-post-status,
1381
+ dashicons-edit,
1382
+ dashicons-trash,
1383
+ dashicons-sticky,
1384
+ dashicons-external,
1385
+ dashicons-arrow-up,
1386
+ dashicons-arrow-down,
1387
+ dashicons-arrow-right,
1388
+ dashicons-arrow-left,
1389
+ dashicons-arrow-up-alt,
1390
+ dashicons-arrow-down-alt,
1391
+ dashicons-arrow-right-alt,
1392
+ dashicons-arrow-left-alt,
1393
+ dashicons-arrow-up-alt2,
1394
+ dashicons-arrow-down-alt2,
1395
+ dashicons-arrow-right-alt,
1396
+ dashicons-arrow-left-alt2,
1397
+ dashicons-sort,
1398
+ dashicons-leftright,
1399
+ dashicons-randomize,
1400
+ dashicons-list-view,
1401
+ dashicons-excerpt-view,
1402
+ dashicons-grid-view,
1403
+ dashicons-move,
1404
+ dashicons-share,
1405
+ dashicons-share-alt,
1406
+ dashicons-share-alt2,
1407
+ dashicons-rss,
1408
+ dashicons-email,
1409
+ dashicons-email-alt,
1410
+ dashicons-email-alt2,
1411
+ dashicons-networking,
1412
+ dashicons-amazon,
1413
+ dashicons-facebook,
1414
+ dashicons-facebook-alt,
1415
+ dashicons-google,
1416
+ dashicons-googleplus,
1417
+ dashicons-instagram,
1418
+ dashicons-linkedin,
1419
+ dashicons-pinterest,
1420
+ dashicons-podio,
1421
+ dashicons-reddit,
1422
+ dashicons-spotify,
1423
+ dashicons-twitch,
1424
+ dashicons-twitter,
1425
+ dashicons-twitter-alt,
1426
+ dashicons-whatsapp,
1427
+ dashicons-xing,
1428
+ dashicons-youtube,
1429
+ dashicons-hammer,
1430
+ dashicons-art,
1431
+ dashicons-migrate,
1432
+ dashicons-performance,
1433
+ dashicons-universal-access,
1434
+ dashicons-universal-access-alt,
1435
+ dashicons-tickets,
1436
+ dashicons-nametag,
1437
+ dashicons-clipboard,
1438
+ dashicons-heart,
1439
+ dashicons-megaphone,
1440
+ dashicons-schedule,
1441
+ dashicons-tide,
1442
+ dashicons-rest-api,
1443
+ dashicons-code-standards,
1444
+ dashicons-buddicons-activity,
1445
+ dashicons-buddicons-bbpress-logo,
1446
+ dashicons-buddicons-buddypress-logo,
1447
+ dashicons-buddicons-community,
1448
+ dashicons-buddicons-forums,
1449
+ dashicons-buddicons-friends,
1450
+ dashicons-buddicons-groups,
1451
+ dashicons-buddicons-pm,
1452
+ dashicons-buddicons-replies,
1453
+ dashicons-buddicons-topics,
1454
+ dashicons-buddicons-tracking,
1455
+ dashicons-wordpress,
1456
+ dashicons-wordpress-alt,
1457
+ dashicons-pressthis,
1458
+ dashicons-update,
1459
+ dashicons-update-alt,
1460
+ dashicons-screenoptions,
1461
+ dashicons-info,
1462
+ dashicons-cart,
1463
+ dashicons-feedback,
1464
+ dashicons-cloud,
1465
+ dashicons-translation,
1466
+ dashicons-tag,
1467
+ dashicons-category,
1468
+ dashicons-archive,
1469
+ dashicons-tagcloud,
1470
+ dashicons-text,
1471
+ dashicons-bell,
1472
+ dashicons-yes,
1473
+ dashicons-yes-alt,
1474
+ dashicons-no,
1475
+ dashicons-no-alt,
1476
+ dashicons-plus,
1477
+ dashicons-plus-alt,
1478
+ dashicons-plus-alt2,
1479
+ dashicons-minus,
1480
+ dashicons-dismiss,
1481
+ dashicons-marker,
1482
+ dashicons-star-filled,
1483
+ dashicons-star-half,
1484
+ dashicons-star-empty,
1485
+ dashicons-flag,
1486
+ dashicons-warning,
1487
+ dashicons-location,
1488
+ dashicons-location-alt,
1489
+ dashicons-vault,
1490
+ dashicons-shield,
1491
+ dashicons-shield-alt,
1492
+ dashicons-sos,
1493
+ dashicons-search,
1494
+ dashicons-slides,
1495
+ dashicons-text-page,
1496
+ dashicons-analytics,
1497
+ dashicons-chart-pie,
1498
+ dashicons-chart-bar,
1499
+ dashicons-chart-line,
1500
+ dashicons-chart-area,
1501
+ dashicons-groups,
1502
+ dashicons-businessman,
1503
+ dashicons-businesswoman,
1504
+ dashicons-businessperson,
1505
+ dashicons-id,
1506
+ dashicons-id-alt,
1507
+ dashicons-products,
1508
+ dashicons-awards,
1509
+ dashicons-forms,
1510
+ dashicons-testimonial,
1511
+ dashicons-portfolio,
1512
+ dashicons-book,
1513
+ dashicons-book-alt,
1514
+ dashicons-download,
1515
+ dashicons-upload,
1516
+ dashicons-backup,
1517
+ dashicons-clock,
1518
+ dashicons-lightbulb,
1519
+ dashicons-microphone,
1520
+ dashicons-desktop,
1521
+ dashicons-laptop,
1522
+ dashicons-tablet,
1523
+ dashicons-smartphone,
1524
+ dashicons-phone,
1525
+ dashicons-index-card,
1526
+ dashicons-carrot,
1527
+ dashicons-building,
1528
+ dashicons-store,
1529
+ dashicons-album,
1530
+ dashicons-palmtree,
1531
+ dashicons-tickets-alt,
1532
+ dashicons-money,
1533
+ dashicons-money-alt,
1534
+ dashicons-smiley,
1535
+ dashicons-thumbs-up,
1536
+ dashicons-thumbs-down,
1537
+ dashicons-layout,
1538
+ dashicons-paperclip,
1539
+ dashicons-color-picker,
1540
+ dashicons-edit-large,
1541
+ dashicons-edit-page,
1542
+ dashicons-airplane,
1543
+ dashicons-bank,
1544
+ dashicons-beer,
1545
+ dashicons-calculator,
1546
+ dashicons-car,
1547
+ dashicons-coffee,
1548
+ dashicons-drumstick,
1549
+ dashicons-food,
1550
+ dashicons-fullscreen-alt,
1551
+ dashicons-fullscreen-exit-alt,
1552
+ dashicons-games,
1553
+ dashicons-hourglass,
1554
+ dashicons-open-folder,
1555
+ dashicons-pdf,
1556
+ dashicons-pets,
1557
+ dashicons-printer,
1558
+ dashicons-privacy,
1559
+ dashicons-superhero,
1560
+ dashicons-superhero-alt' );
1561
+ // Get the selected icon if it exists.
1562
+ $selected_icon = get_post_meta( $item_id, '_menu_image_icon', true );
1563
+ // Dashicons Icons List.
1564
+
1565
+ if ( strpos( $selected_icon, 'dashicons' ) !== false || $selected_icon == '' ) {
1566
+ echo '<div class="menu-image-dashicons-list active">' ;
1567
+ } else {
1568
+ echo '<div class="menu-image-dashicons-list">' ;
1569
+ }
1570
+
1571
+ // Loop through the list of icons.
1572
+ foreach ( $dashicons as $icon ) {
1573
+ $icon = preg_replace( '/\\s+/', '', $icon );
1574
+
1575
+ if ( $icon == $selected_icon ) {
1576
+ echo '<span class="dashicons ' . $icon . ' menu-item-icon-selected"></span>' ;
1577
+ } else {
1578
+ echo '<span class="dashicons ' . $icon . '"></span>' ;
1579
+ }
1580
+
1581
+ }
1582
+ echo '</div>' ;
1583
+ }
1584
+
1585
+ public function menu_image_build_fa_list( $item_id )
1586
+ {
1587
+ $icons_brand = [];
1588
+ $icons_solid = [];
1589
+ $icons_regular = [];
1590
+ $fa_solid = explode( ',', 'fas fa-ad,fas fa-address-book,fas fa-address-card,fas fa-adjust,fas fa-air-freshener,fas fa-align-center,fas fa-align-justify,fas fa-align-left,fas fa-align-right,fas fa-allergies,fas fa-ambulance,fas fa-american-sign-language-interpreting,fas fa-anchor,fas fa-angle-double-down,fas fa-angle-double-left,fas fa-angle-double-right,fas fa-angle-double-up,fas fa-angle-down,fas fa-angle-left,fas fa-angle-right,fas fa-angle-up,fas fa-angry,fas fa-ankh,fas fa-apple-alt,fas fa-archive,fas fa-archway,fas fa-arrow-alt-circle-down,fas fa-arrow-alt-circle-left,fas fa-arrow-alt-circle-right,fas fa-arrow-alt-circle-up,fas fa-arrow-circle-down,fas fa-arrow-circle-left,fas fa-arrow-circle-right,fas fa-arrow-circle-up,fas fa-arrow-down,fas fa-arrow-left,fas fa-arrow-right,fas fa-arrow-up,fas fa-arrows-alt,fas fa-arrows-alt-h,fas fa-arrows-alt-v,fas fa-assistive-listening-systems,fas fa-asterisk,fas fa-at,fas fa-atlas,fas fa-atom,fas fa-audio-description,fas fa-award,fas fa-baby,fas fa-baby-carriage,fas fa-backspace,fas fa-backward,fas fa-bacon,fas fa-bacteria,fas fa-bacterium,fas fa-bahai,fas fa-balance-scale,fas fa-balance-scale-left,fas fa-balance-scale-right,fas fa-ban,fas fa-band-aid,fas fa-barcode,fas fa-bars,fas fa-baseball-ball,fas fa-basketball-ball,fas fa-bath,fas fa-battery-empty,fas fa-battery-full,fas fa-battery-half,fas fa-battery-quarter,fas fa-battery-three-quarters,fas fa-bed,fas fa-beer,fas fa-bell,fas fa-bell-slash,fas fa-bezier-curve,fas fa-bible,fas fa-bicycle,fas fa-biking,fas fa-binoculars,fas fa-biohazard,fas fa-birthday-cake,fas fa-blender,fas fa-blender-phone,fas fa-blind,fas fa-blog,fas fa-bold,fas fa-bolt,fas fa-bomb,fas fa-bone,fas fa-bong,fas fa-book,fas fa-book-dead,fas fa-book-medical,fas fa-book-open,fas fa-book-reader,fas fa-bookmark,fas fa-border-all,fas fa-border-none,fas fa-border-style,fas fa-bowling-ball,fas fa-box,fas fa-box-open,fas fa-box-tissue,fas fa-boxes,fas fa-braille,fas fa-brain,fas fa-bread-slice,fas fa-briefcase,fas fa-briefcase-medical,fas fa-broadcast-tower,fas fa-broom,fas fa-brush,fas fa-bug,fas fa-building,fas fa-bullhorn,fas fa-bullseye,fas fa-burn,fas fa-bus,fas fa-bus-alt,fas fa-business-time,fas fa-calculator,fas fa-calendar,fas fa-calendar-alt,fas fa-calendar-check,fas fa-calendar-day,fas fa-calendar-minus,fas fa-calendar-plus,fas fa-calendar-times,fas fa-calendar-week,fas fa-camera,fas fa-camera-retro,fas fa-campground,fas fa-candy-cane,fas fa-cannabis,fas fa-capsules,fas fa-car,fas fa-car-alt,fas fa-car-battery,fas fa-car-crash,fas fa-car-side,fas fa-caravan,fas fa-caret-down,fas fa-caret-left,fas fa-caret-right,fas fa-caret-square-down,fas fa-caret-square-left,fas fa-caret-square-right,fas fa-caret-square-up,fas fa-caret-up,fas fa-carrot,fas fa-cart-arrow-down,fas fa-cart-plus,fas fa-cash-register,fas fa-cat,fas fa-certificate,fas fa-chair,fas fa-chalkboard,fas fa-chalkboard-teacher,fas fa-charging-station,fas fa-chart-area,fas fa-chart-bar,fas fa-chart-line,fas fa-chart-pie,fas fa-check,fas fa-check-circle,fas fa-check-double,fas fa-check-square,fas fa-cheese,fas fa-chess,fas fa-chess-bishop,fas fa-chess-board,fas fa-chess-king,fas fa-chess-knight,fas fa-chess-pawn,fas fa-chess-queen,fas fa-chess-rook,fas fa-chevron-circle-down,fas fa-chevron-circle-left,fas fa-chevron-circle-right,fas fa-chevron-circle-up,fas fa-chevron-down,fas fa-chevron-left,fas fa-chevron-right,fas fa-chevron-up,fas fa-child,fas fa-church,fas fa-circle,fas fa-circle-notch,fas fa-city,fas fa-clinic-medical,fas fa-clipboard,fas fa-clipboard-check,fas fa-clipboard-list,fas fa-clock,fas fa-clone,fas fa-closed-captioning,fas fa-cloud,fas fa-cloud-download-alt,fas fa-cloud-meatball,fas fa-cloud-moon,fas fa-cloud-moon-rain,fas fa-cloud-rain,fas fa-cloud-showers-heavy,fas fa-cloud-sun,fas fa-cloud-sun-rain,fas fa-cloud-upload-alt,fas fa-cocktail,fas fa-code,fas fa-code-branch,fas fa-coffee,fas fa-cog,fas fa-cogs,fas fa-coins,fas fa-columns,fas fa-comment,fas fa-comment-alt,fas fa-comment-dollar,fas fa-comment-dots,fas fa-comment-medical,fas fa-comment-slash,fas fa-comments,fas fa-comments-dollar,fas fa-compact-disc,fas fa-compass,fas fa-compress,fas fa-compress-alt,fas fa-compress-arrows-alt,fas fa-concierge-bell,fas fa-cookie,fas fa-cookie-bite,fas fa-copy,fas fa-copyright,fas fa-couch,fas fa-credit-card,fas fa-crop,fas fa-crop-alt,fas fa-cross,fas fa-crosshairs,fas fa-crow,fas fa-crown,fas fa-crutch,fas fa-cube,fas fa-cubes,fas fa-cut,fas fa-database,fas fa-deaf,fas fa-democrat,fas fa-desktop,fas fa-dharmachakra,fas fa-diagnoses,fas fa-dice,fas fa-dice-d20,fas fa-dice-d6,fas fa-dice-five,fas fa-dice-four,fas fa-dice-one,fas fa-dice-six,fas fa-dice-three,fas fa-dice-two,fas fa-digital-tachograph,fas fa-directions,fas fa-disease,fas fa-divide,fas fa-dizzy,fas fa-dna,fas fa-dog,fas fa-dollar-sign,fas fa-dolly,fas fa-dolly-flatbed,fas fa-donate,fas fa-door-closed,fas fa-door-open,fas fa-dot-circle,fas fa-dove,fas fa-download,fas fa-drafting-compass,fas fa-dragon,fas fa-draw-polygon,fas fa-drum,fas fa-drum-steelpan,fas fa-drumstick-bite,fas fa-dumbbell,fas fa-dumpster,fas fa-dumpster-fire,fas fa-dungeon,fas fa-edit,fas fa-egg,fas fa-eject,fas fa-ellipsis-h,fas fa-ellipsis-v,fas fa-envelope,fas fa-envelope-open,fas fa-envelope-open-text,fas fa-envelope-square,fas fa-equals,fas fa-eraser,fas fa-ethernet,fas fa-euro-sign,fas fa-exchange-alt,fas fa-exclamation,fas fa-exclamation-circle,fas fa-exclamation-triangle,fas fa-expand,fas fa-expand-alt,fas fa-expand-arrows-alt,fas fa-external-link-alt,fas fa-external-link-square-alt,fas fa-eye,fas fa-eye-dropper,fas fa-eye-slash,fas fa-fan,fas fa-fast-backward,fas fa-fast-forward,fas fa-faucet,fas fa-fax,fas fa-feather,fas fa-feather-alt,fas fa-female,fas fa-fighter-jet,fas fa-file,fas fa-file-alt,fas fa-file-archive,fas fa-file-audio,fas fa-file-code,fas fa-file-contract,fas fa-file-csv,fas fa-file-download,fas fa-file-excel,fas fa-file-export,fas fa-file-image,fas fa-file-import,fas fa-file-invoice,fas fa-file-invoice-dollar,fas fa-file-medical,fas fa-file-medical-alt,fas fa-file-pdf,fas fa-file-powerpoint,fas fa-file-prescription,fas fa-file-signature,fas fa-file-upload,fas fa-file-video,fas fa-file-word,fas fa-fill,fas fa-fill-drip,fas fa-film,fas fa-filter,fas fa-fingerprint,fas fa-fire,fas fa-fire-alt,fas fa-fire-extinguisher,fas fa-first-aid,fas fa-fish,fas fa-fist-raised,fas fa-flag,fas fa-flag-checkered,fas fa-flag-usa,fas fa-flask,fas fa-flushed,fas fa-folder,fas fa-folder-minus,fas fa-folder-open,fas fa-folder-plus,fas fa-font,fas fa-font-awesome-logo-full,fas fa-football-ball,fas fa-forward,fas fa-frog,fas fa-frown,fas fa-frown-open,fas fa-funnel-dollar,fas fa-futbol,fas fa-gamepad,fas fa-gas-pump,fas fa-gavel,fas fa-gem,fas fa-genderless,fas fa-ghost,fas fa-gift,fas fa-gifts,fas fa-glass-cheers,fas fa-glass-martini,fas fa-glass-martini-alt,fas fa-glass-whiskey,fas fa-glasses,fas fa-globe,fas fa-globe-africa,fas fa-globe-americas,fas fa-globe-asia,fas fa-globe-europe,fas fa-golf-ball,fas fa-gopuram,fas fa-graduation-cap,fas fa-greater-than,fas fa-greater-than-equal,fas fa-grimace,fas fa-grin,fas fa-grin-alt,fas fa-grin-beam,fas fa-grin-beam-sweat,fas fa-grin-hearts,fas fa-grin-squint,fas fa-grin-squint-tears,fas fa-grin-stars,fas fa-grin-tears,fas fa-grin-tongue,fas fa-grin-tongue-squint,fas fa-grin-tongue-wink,fas fa-grin-wink,fas fa-grip-horizontal,fas fa-grip-lines,fas fa-grip-lines-vertical,fas fa-grip-vertical,fas fa-guitar,fas fa-h-square,fas fa-hamburger,fas fa-hammer,fas fa-hamsa,fas fa-hand-holding,fas fa-hand-holding-heart,fas fa-hand-holding-medical,fas fa-hand-holding-usd,fas fa-hand-holding-water,fas fa-hand-lizard,fas fa-hand-middle-finger,fas fa-hand-paper,fas fa-hand-peace,fas fa-hand-point-down,fas fa-hand-point-left,fas fa-hand-point-right,fas fa-hand-point-up,fas fa-hand-pointer,fas fa-hand-rock,fas fa-hand-scissors,fas fa-hand-sparkles,fas fa-hand-spock,fas fa-hands,fas fa-hands-helping,fas fa-hands-wash,fas fa-handshake,fas fa-handshake-alt-slash,fas fa-handshake-slash,fas fa-hanukiah,fas fa-hard-hat,fas fa-hashtag,fas fa-hat-cowboy,fas fa-hat-cowboy-side,fas fa-hat-wizard,fas fa-hdd,fas fa-head-side-cough,fas fa-head-side-cough-slash,fas fa-head-side-mask,fas fa-head-side-virus,fas fa-heading,fas fa-headphones,fas fa-headphones-alt,fas fa-headset,fas fa-heart,fas fa-heart-broken,fas fa-heartbeat,fas fa-helicopter,fas fa-highlighter,fas fa-hiking,fas fa-hippo,fas fa-history,fas fa-hockey-puck,fas fa-holly-berry,fas fa-home,fas fa-horse,fas fa-horse-head,fas fa-hospital,fas fa-hospital-alt,fas fa-hospital-symbol,fas fa-hospital-user,fas fa-hot-tub,fas fa-hotdog,fas fa-hotel,fas fa-hourglass,fas fa-hourglass-end,fas fa-hourglass-half,fas fa-hourglass-start,fas fa-house-damage,fas fa-house-user,fas fa-hryvnia,fas fa-i-cursor,fas fa-ice-cream,fas fa-icicles,fas fa-icons,fas fa-id-badge,fas fa-id-card,fas fa-id-card-alt,fas fa-igloo,fas fa-image,fas fa-images,fas fa-inbox,fas fa-indent,fas fa-industry,fas fa-infinity,fas fa-info,fas fa-info-circle,fas fa-italic,fas fa-jedi,fas fa-joint,fas fa-journal-whills,fas fa-kaaba,fas fa-key,fas fa-keyboard,fas fa-khanda,fas fa-kiss,fas fa-kiss-beam,fas fa-kiss-wink-heart,fas fa-kiwi-bird,fas fa-landmark,fas fa-language,fas fa-laptop,fas fa-laptop-code,fas fa-laptop-house,fas fa-laptop-medical,fas fa-laugh,fas fa-laugh-beam,fas fa-laugh-squint,fas fa-laugh-wink,fas fa-layer-group,fas fa-leaf,fas fa-lemon,fas fa-less-than,fas fa-less-than-equal,fas fa-level-down-alt,fas fa-level-up-alt,fas fa-life-ring,fas fa-lightbulb,fas fa-link,fas fa-lira-sign,fas fa-list,fas fa-list-alt,fas fa-list-ol,fas fa-list-ul,fas fa-location-arrow,fas fa-lock,fas fa-lock-open,fas fa-long-arrow-alt-down,fas fa-long-arrow-alt-left,fas fa-long-arrow-alt-right,fas fa-long-arrow-alt-up,fas fa-low-vision,fas fa-luggage-cart,fas fa-lungs,fas fa-lungs-virus,fas fa-magic,fas fa-magnet,fas fa-mail-bulk,fas fa-male,fas fa-map,fas fa-map-marked,fas fa-map-marked-alt,fas fa-map-marker,fas fa-map-marker-alt,fas fa-map-pin,fas fa-map-signs,fas fa-marker,fas fa-mars,fas fa-mars-double,fas fa-mars-stroke,fas fa-mars-stroke-h,fas fa-mars-stroke-v,fas fa-mask,fas fa-medal,fas fa-medkit,fas fa-meh,fas fa-meh-blank,fas fa-meh-rolling-eyes,fas fa-memory,fas fa-menorah,fas fa-mercury,fas fa-meteor,fas fa-microchip,fas fa-microphone,fas fa-microphone-alt,fas fa-microphone-alt-slash,fas fa-microphone-slash,fas fa-microscope,fas fa-minus,fas fa-minus-circle,fas fa-minus-square,fas fa-mitten,fas fa-mobile,fas fa-mobile-alt,fas fa-money-bill,fas fa-money-bill-alt,fas fa-money-bill-wave,fas fa-money-bill-wave-alt,fas fa-money-check,fas fa-money-check-alt,fas fa-monument,fas fa-moon,fas fa-mortar-pestle,fas fa-mosque,fas fa-motorcycle,fas fa-mountain,fas fa-mouse,fas fa-mouse-pointer,fas fa-mug-hot,fas fa-music,fas fa-network-wired,fas fa-neuter,fas fa-newspaper,fas fa-not-equal,fas fa-notes-medical,fas fa-object-group,fas fa-object-ungroup,fas fa-oil-can,fas fa-om,fas fa-otter,fas fa-outdent,fas fa-pager,fas fa-paint-brush,fas fa-paint-roller,fas fa-palette,fas fa-pallet,fas fa-paper-plane,fas fa-paperclip,fas fa-parachute-box,fas fa-paragraph,fas fa-parking,fas fa-passport,fas fa-pastafarianism,fas fa-paste,fas fa-pause,fas fa-pause-circle,fas fa-paw,fas fa-peace,fas fa-pen,fas fa-pen-alt,fas fa-pen-fancy,fas fa-pen-nib,fas fa-pen-square,fas fa-pencil-alt,fas fa-pencil-ruler,fas fa-people-arrows,fas fa-people-carry,fas fa-pepper-hot,fas fa-percent,fas fa-percentage,fas fa-person-booth,fas fa-phone,fas fa-phone-alt,fas fa-phone-slash,fas fa-phone-square,fas fa-phone-square-alt,fas fa-phone-volume,fas fa-photo-video,fas fa-piggy-bank,fas fa-pills,fas fa-pizza-slice,fas fa-place-of-worship,fas fa-plane,fas fa-plane-arrival,fas fa-plane-departure,fas fa-plane-slash,fas fa-play,fas fa-play-circle,fas fa-plug,fas fa-plus,fas fa-plus-circle,fas fa-plus-square,fas fa-podcast,fas fa-poll,fas fa-poll-h,fas fa-poo,fas fa-poo-storm,fas fa-poop,fas fa-portrait,fas fa-pound-sign,fas fa-power-off,fas fa-pray,fas fa-praying-hands,fas fa-prescription,fas fa-prescription-bottle,fas fa-prescription-bottle-alt,fas fa-print,fas fa-procedures,fas fa-project-diagram,fas fa-pump-medical,fas fa-pump-soap,fas fa-puzzle-piece,fas fa-qrcode,fas fa-question,fas fa-question-circle,fas fa-quidditch,fas fa-quote-left,fas fa-quote-right,fas fa-quran,fas fa-radiation,fas fa-radiation-alt,fas fa-rainbow,fas fa-random,fas fa-receipt,fas fa-record-vinyl,fas fa-recycle,fas fa-redo,fas fa-redo-alt,fas fa-registered,fas fa-remove-format,fas fa-reply,fas fa-reply-all,fas fa-republican,fas fa-restroom,fas fa-retweet,fas fa-ribbon,fas fa-ring,fas fa-road,fas fa-robot,fas fa-rocket,fas fa-route,fas fa-rss,fas fa-rss-square,fas fa-ruble-sign,fas fa-ruler,fas fa-ruler-combined,fas fa-ruler-horizontal,fas fa-ruler-vertical,fas fa-running,fas fa-rupee-sign,fas fa-sad-cry,fas fa-sad-tear,fas fa-satellite,fas fa-satellite-dish,fas fa-save,fas fa-school,fas fa-screwdriver,fas fa-scroll,fas fa-sd-card,fas fa-search,fas fa-search-dollar,fas fa-search-location,fas fa-search-minus,fas fa-search-plus,fas fa-seedling,fas fa-server,fas fa-shapes,fas fa-share,fas fa-share-alt,fas fa-share-alt-square,fas fa-share-square,fas fa-shekel-sign,fas fa-shield-alt,fas fa-shield-virus,fas fa-ship,fas fa-shipping-fast,fas fa-shoe-prints,fas fa-shopping-bag,fas fa-shopping-basket,fas fa-shopping-cart,fas fa-shower,fas fa-shuttle-van,fas fa-sign,fas fa-sign-in-alt,fas fa-sign-language,fas fa-sign-out-alt,fas fa-signal,fas fa-signature,fas fa-sim-card,fas fa-sink,fas fa-sitemap,fas fa-skating,fas fa-skiing,fas fa-skiing-nordic,fas fa-skull,fas fa-skull-crossbones,fas fa-slash,fas fa-sleigh,fas fa-sliders-h,fas fa-smile,fas fa-smile-beam,fas fa-smile-wink,fas fa-smog,fas fa-smoking,fas fa-smoking-ban,fas fa-sms,fas fa-snowboarding,fas fa-snowflake,fas fa-snowman,fas fa-snowplow,fas fa-soap,fas fa-socks,fas fa-solar-panel,fas fa-sort,fas fa-sort-alpha-down,fas fa-sort-alpha-down-alt,fas fa-sort-alpha-up,fas fa-sort-alpha-up-alt,fas fa-sort-amount-down,fas fa-sort-amount-down-alt,fas fa-sort-amount-up,fas fa-sort-amount-up-alt,fas fa-sort-down,fas fa-sort-numeric-down,fas fa-sort-numeric-down-alt,fas fa-sort-numeric-up,fas fa-sort-numeric-up-alt,fas fa-sort-up,fas fa-spa,fas fa-space-shuttle,fas fa-spell-check,fas fa-spider,fas fa-spinner,fas fa-splotch,fas fa-spray-can,fas fa-square,fas fa-square-full,fas fa-square-root-alt,fas fa-stamp,fas fa-star,fas fa-star-and-crescent,fas fa-star-half,fas fa-star-half-alt,fas fa-star-of-david,fas fa-star-of-life,fas fa-step-backward,fas fa-step-forward,fas fa-stethoscope,fas fa-sticky-note,fas fa-stop,fas fa-stop-circle,fas fa-stopwatch,fas fa-stopwatch-20,fas fa-store,fas fa-store-alt,fas fa-store-alt-slash,fas fa-store-slash,fas fa-stream,fas fa-street-view,fas fa-strikethrough,fas fa-stroopwafel,fas fa-subscript,fas fa-subway,fas fa-suitcase,fas fa-suitcase-rolling,fas fa-sun,fas fa-superscript,fas fa-surprise,fas fa-swatchbook,fas fa-swimmer,fas fa-swimming-pool,fas fa-synagogue,fas fa-sync,fas fa-sync-alt,fas fa-syringe,fas fa-table,fas fa-table-tennis,fas fa-tablet,fas fa-tablet-alt,fas fa-tablets,fas fa-tachometer-alt,fas fa-tag,fas fa-tags,fas fa-tape,fas fa-tasks,fas fa-taxi,fas fa-teeth,fas fa-teeth-open,fas fa-temperature-high,fas fa-temperature-low,fas fa-tenge,fas fa-terminal,fas fa-text-height,fas fa-text-width,fas fa-th,fas fa-th-large,fas fa-th-list,fas fa-theater-masks,fas fa-thermometer,fas fa-thermometer-empty,fas fa-thermometer-full,fas fa-thermometer-half,fas fa-thermometer-quarter,fas fa-thermometer-three-quarters,fas fa-thumbs-down,fas fa-thumbs-up,fas fa-thumbtack,fas fa-ticket-alt,fas fa-times,fas fa-times-circle,fas fa-tint,fas fa-tint-slash,fas fa-tired,fas fa-toggle-off,fas fa-toggle-on,fas fa-toilet,fas fa-toilet-paper,fas fa-toilet-paper-slash,fas fa-toolbox,fas fa-tools,fas fa-tooth,fas fa-torah,fas fa-torii-gate,fas fa-tractor,fas fa-trademark,fas fa-traffic-light,fas fa-trailer,fas fa-train,fas fa-tram,fas fa-transgender,fas fa-transgender-alt,fas fa-trash,fas fa-trash-alt,fas fa-trash-restore,fas fa-trash-restore-alt,fas fa-tree,fas fa-trophy,fas fa-truck,fas fa-truck-loading,fas fa-truck-monster,fas fa-truck-moving,fas fa-truck-pickup,fas fa-tshirt,fas fa-tty,fas fa-tv,fas fa-umbrella,fas fa-umbrella-beach,fas fa-underline,fas fa-undo,fas fa-undo-alt,fas fa-universal-access,fas fa-university,fas fa-unlink,fas fa-unlock,fas fa-unlock-alt,fas fa-upload,fas fa-user,fas fa-user-alt,fas fa-user-alt-slash,fas fa-user-astronaut,fas fa-user-check,fas fa-user-circle,fas fa-user-clock,fas fa-user-cog,fas fa-user-edit,fas fa-user-friends,fas fa-user-graduate,fas fa-user-injured,fas fa-user-lock,fas fa-user-md,fas fa-user-minus,fas fa-user-ninja,fas fa-user-nurse,fas fa-user-plus,fas fa-user-secret,fas fa-user-shield,fas fa-user-slash,fas fa-user-tag,fas fa-user-tie,fas fa-user-times,fas fa-users,fas fa-users-cog,fas fa-users-slash,fas fa-utensil-spoon,fas fa-utensils,fas fa-vector-square,fas fa-venus,fas fa-venus-double,fas fa-venus-mars,fas fa-vest,fas fa-vest-patches,fas fa-vial,fas fa-vials,fas fa-video,fas fa-video-slash,fas fa-vihara,fas fa-virus,fas fa-virus-slash,fas fa-viruses,fas fa-voicemail,fas fa-volleyball-ball,fas fa-volume-down,fas fa-volume-mute,fas fa-volume-off,fas fa-volume-up,fas fa-vote-yea,fas fa-vr-cardboard,fas fa-walking,fas fa-wallet,fas fa-warehouse,fas fa-water,fas fa-wave-square,fas fa-weight,fas fa-weight-hanging,fas fa-wheelchair,fas fa-wifi,fas fa-wind,fas fa-window-close,fas fa-window-maximize,fas fa-window-minimize,fas fa-window-restore,fas fa-wine-bottle,fas fa-wine-glass,fas fa-wine-glass-alt,fas fa-won-sign,fas fa-wrench,fas fa-x-ray,fas fa-yen-sign,fas fa-yin-yang' );
1591
+ $fa_regular = explode( ',', 'far fa-address-book,far fa-address-card,far fa-angry,far fa-arrow-alt-circle-down,far fa-arrow-alt-circle-left,far fa-arrow-alt-circle-right,far fa-arrow-alt-circle-up,far fa-bell,far fa-bell-slash,far fa-bookmark,far fa-building,far fa-calendar,far fa-calendar-alt,far fa-calendar-check,far fa-calendar-minus,far fa-calendar-plus,far fa-calendar-times,far fa-caret-square-down,far fa-caret-square-left,far fa-caret-square-right,far fa-caret-square-up,far fa-chart-bar,far fa-check-circle,far fa-check-square,far fa-circle,far fa-clipboard,far fa-clock,far fa-clone,far fa-closed-captioning,far fa-comment,far fa-comment-alt,far fa-comment-dots,far fa-comments,far fa-compass,far fa-copy,far fa-copyright,far fa-credit-card,far fa-dizzy,far fa-dot-circle,far fa-edit,far fa-envelope,far fa-envelope-open,far fa-eye,far fa-eye-slash,far fa-file,far fa-file-alt,far fa-file-archive,far fa-file-audio,far fa-file-code,far fa-file-excel,far fa-file-image,far fa-file-pdf,far fa-file-powerpoint,far fa-file-video,far fa-file-word,far fa-flag,far fa-flushed,far fa-folder,far fa-folder-open,far fa-font-awesome-logo-full,far fa-frown,far fa-frown-open,far fa-futbol,far fa-gem,far fa-grimace,far fa-grin,far fa-grin-alt,far fa-grin-beam,far fa-grin-beam-sweat,far fa-grin-hearts,far fa-grin-squint,far fa-grin-squint-tears,far fa-grin-stars,far fa-grin-tears,far fa-grin-tongue,far fa-grin-tongue-squint,far fa-grin-tongue-wink,far fa-grin-wink,far fa-hand-lizard,far fa-hand-paper,far fa-hand-peace,far fa-hand-point-down,far fa-hand-point-left,far fa-hand-point-right,far fa-hand-point-up,far fa-hand-pointer,far fa-hand-rock,far fa-hand-scissors,far fa-hand-spock,far fa-handshake,far fa-hdd,far fa-heart,far fa-hospital,far fa-hourglass,far fa-id-badge,far fa-id-card,far fa-image,far fa-images,far fa-keyboard,far fa-kiss,far fa-kiss-beam,far fa-kiss-wink-heart,far fa-laugh,far fa-laugh-beam,far fa-laugh-squint,far fa-laugh-wink,far fa-lemon,far fa-life-ring,far fa-lightbulb,far fa-list-alt,far fa-map,far fa-meh,far fa-meh-blank,far fa-meh-rolling-eyes,far fa-minus-square,far fa-money-bill-alt,far fa-moon,far fa-newspaper,far fa-object-group,far fa-object-ungroup,far fa-paper-plane,far fa-pause-circle,far fa-play-circle,far fa-plus-square,far fa-question-circle,far fa-registered,far fa-sad-cry,far fa-sad-tear,far fa-save,far fa-share-square,far fa-smile,far fa-smile-beam,far fa-smile-wink,far fa-snowflake,far fa-square,far fa-star,far fa-star-half,far fa-sticky-note,far fa-stop-circle,far fa-sun,far fa-surprise,far fa-thumbs-down,far fa-thumbs-up,far fa-times-circle,far fa-tired,far fa-trash-alt,far fa-user,far fa-user-circle,far fa-window-close,far fa-window-maximize,far fa-window-minimize,far fa-window-restore' );
1592
+ $fa_brands = explode( ',', 'fab fa-500px,fab fa-accessible-icon,fab fa-accusoft,fab fa-acquisitions-incorporated,fab fa-adn,fab fa-adversal,fab fa-affiliatetheme,fab fa-airbnb,fab fa-algolia,fab fa-alipay,fab fa-amazon,fab fa-amazon-pay,fab fa-amilia,fab fa-android,fab fa-angellist,fab fa-angrycreative,fab fa-angular,fab fa-app-store,fab fa-app-store-ios,fab fa-apper,fab fa-apple,fab fa-apple-pay,fab fa-artstation,fab fa-asymmetrik,fab fa-atlassian,fab fa-audible,fab fa-autoprefixer,fab fa-avianex,fab fa-aviato,fab fa-aws,fab fa-bandcamp,fab fa-battle-net,fab fa-behance,fab fa-behance-square,fab fa-bimobject,fab fa-bitbucket,fab fa-bitcoin,fab fa-bity,fab fa-black-tie,fab fa-blackberry,fab fa-blogger,fab fa-blogger-b,fab fa-bluetooth,fab fa-bluetooth-b,fab fa-bootstrap,fab fa-btc,fab fa-buffer,fab fa-buromobelexperte,fab fa-buy-n-large,fab fa-buysellads,fab fa-canadian-maple-leaf,fab fa-cc-amazon-pay,fab fa-cc-amex,fab fa-cc-apple-pay,fab fa-cc-diners-club,fab fa-cc-discover,fab fa-cc-jcb,fab fa-cc-mastercard,fab fa-cc-paypal,fab fa-cc-stripe,fab fa-cc-visa,fab fa-centercode,fab fa-centos,fab fa-chrome,fab fa-chromecast,fab fa-cloudflare,fab fa-cloudscale,fab fa-cloudsmith,fab fa-cloudversify,fab fa-codepen,fab fa-codiepie,fab fa-confluence,fab fa-connectdevelop,fab fa-contao,fab fa-cotton-bureau,fab fa-cpanel,fab fa-creative-commons,fab fa-creative-commons-by,fab fa-creative-commons-nc,fab fa-creative-commons-nc-eu,fab fa-creative-commons-nc-jp,fab fa-creative-commons-nd,fab fa-creative-commons-pd,fab fa-creative-commons-pd-alt,fab fa-creative-commons-remix,fab fa-creative-commons-sa,fab fa-creative-commons-sampling,fab fa-creative-commons-sampling-plus,fab fa-creative-commons-share,fab fa-creative-commons-zero,fab fa-critical-role,fab fa-css3,fab fa-css3-alt,fab fa-cuttlefish,fab fa-d-and-d,fab fa-d-and-d-beyond,fab fa-dailymotion,fab fa-dashcube,fab fa-deezer,fab fa-delicious,fab fa-deploydog,fab fa-deskpro,fab fa-dev,fab fa-deviantart,fab fa-dhl,fab fa-diaspora,fab fa-digg,fab fa-digital-ocean,fab fa-discord,fab fa-discourse,fab fa-dochub,fab fa-docker,fab fa-draft2digital,fab fa-dribbble,fab fa-dribbble-square,fab fa-dropbox,fab fa-drupal,fab fa-dyalog,fab fa-earlybirds,fab fa-ebay,fab fa-edge,fab fa-edge-legacy,fab fa-elementor,fab fa-ello,fab fa-ember,fab fa-empire,fab fa-envira,fab fa-erlang,fab fa-ethereum,fab fa-etsy,fab fa-evernote,fab fa-expeditedssl,fab fa-facebook,fab fa-facebook-f,fab fa-facebook-messenger,fab fa-facebook-square,fab fa-fantasy-flight-games,fab fa-fedex,fab fa-fedora,fab fa-figma,fab fa-firefox,fab fa-firefox-browser,fab fa-first-order,fab fa-first-order-alt,fab fa-firstdraft,fab fa-flickr,fab fa-flipboard,fab fa-fly,fab fa-font-awesome,fab fa-font-awesome-alt,fab fa-font-awesome-flag,fab fa-font-awesome-logo-full,fab fa-fonticons,fab fa-fonticons-fi,fab fa-fort-awesome,fab fa-fort-awesome-alt,fab fa-forumbee,fab fa-foursquare,fab fa-free-code-camp,fab fa-freebsd,fab fa-fulcrum,fab fa-galactic-republic,fab fa-galactic-senate,fab fa-get-pocket,fab fa-gg,fab fa-gg-circle,fab fa-git,fab fa-git-alt,fab fa-git-square,fab fa-github,fab fa-github-alt,fab fa-github-square,fab fa-gitkraken,fab fa-gitlab,fab fa-gitter,fab fa-glide,fab fa-glide-g,fab fa-gofore,fab fa-goodreads,fab fa-goodreads-g,fab fa-google,fab fa-google-drive,fab fa-google-pay,fab fa-google-play,fab fa-google-plus,fab fa-google-plus-g,fab fa-google-plus-square,fab fa-google-wallet,fab fa-gratipay,fab fa-grav,fab fa-gripfire,fab fa-grunt,fab fa-guilded,fab fa-gulp,fab fa-hacker-news,fab fa-hacker-news-square,fab fa-hackerrank,fab fa-hips,fab fa-hire-a-helper,fab fa-hive,fab fa-hooli,fab fa-hornbill,fab fa-hotjar,fab fa-houzz,fab fa-html5,fab fa-hubspot,fab fa-ideal,fab fa-imdb,fab fa-innosoft,fab fa-instagram,fab fa-instagram-square,fab fa-instalod,fab fa-intercom,fab fa-internet-explorer,fab fa-invision,fab fa-ioxhost,fab fa-itch-io,fab fa-itunes,fab fa-itunes-note,fab fa-java,fab fa-jedi-order,fab fa-jenkins,fab fa-jira,fab fa-joget,fab fa-joomla,fab fa-js,fab fa-js-square,fab fa-jsfiddle,fab fa-kaggle,fab fa-keybase,fab fa-keycdn,fab fa-kickstarter,fab fa-kickstarter-k,fab fa-korvue,fab fa-laravel,fab fa-lastfm,fab fa-lastfm-square,fab fa-leanpub,fab fa-less,fab fa-line,fab fa-linkedin,fab fa-linkedin-in,fab fa-linode,fab fa-linux,fab fa-lyft,fab fa-magento,fab fa-mailchimp,fab fa-mandalorian,fab fa-markdown,fab fa-mastodon,fab fa-maxcdn,fab fa-mdb,fab fa-medapps,fab fa-medium,fab fa-medium-m,fab fa-medrt,fab fa-meetup,fab fa-megaport,fab fa-mendeley,fab fa-microblog,fab fa-microsoft,fab fa-mix,fab fa-mixcloud,fab fa-mixer,fab fa-mizuni,fab fa-modx,fab fa-monero,fab fa-napster,fab fa-neos,fab fa-nimblr,fab fa-node,fab fa-node-js,fab fa-npm,fab fa-ns8,fab fa-nutritionix,fab fa-octopus-deploy,fab fa-odnoklassniki,fab fa-odnoklassniki-square,fab fa-old-republic,fab fa-opencart,fab fa-openid,fab fa-opera,fab fa-optin-monster,fab fa-orcid,fab fa-osi,fab fa-page4,fab fa-pagelines,fab fa-palfed,fab fa-patreon,fab fa-paypal,fab fa-penny-arcade,fab fa-perbyte,fab fa-periscope,fab fa-phabricator,fab fa-phoenix-framework,fab fa-phoenix-squadron,fab fa-php,fab fa-pied-piper,fab fa-pied-piper-alt,fab fa-pied-piper-hat,fab fa-pied-piper-pp,fab fa-pied-piper-square,fab fa-pinterest,fab fa-pinterest-p,fab fa-pinterest-square,fab fa-playstation,fab fa-product-hunt,fab fa-pushed,fab fa-python,fab fa-qq,fab fa-quinscape,fab fa-quora,fab fa-r-project,fab fa-raspberry-pi,fab fa-ravelry,fab fa-react,fab fa-reacteurope,fab fa-readme,fab fa-rebel,fab fa-red-river,fab fa-reddit,fab fa-reddit-alien,fab fa-reddit-square,fab fa-redhat,fab fa-renren,fab fa-replyd,fab fa-researchgate,fab fa-resolving,fab fa-rev,fab fa-rocketchat,fab fa-rockrms,fab fa-rust,fab fa-safari,fab fa-salesforce,fab fa-sass,fab fa-schlix,fab fa-scribd,fab fa-searchengin,fab fa-sellcast,fab fa-sellsy,fab fa-servicestack,fab fa-shirtsinbulk,fab fa-shopify,fab fa-shopware,fab fa-simplybuilt,fab fa-sistrix,fab fa-sith,fab fa-sketch,fab fa-skyatlas,fab fa-skype,fab fa-slack,fab fa-slack-hash,fab fa-slideshare,fab fa-snapchat,fab fa-snapchat-ghost,fab fa-snapchat-square,fab fa-soundcloud,fab fa-sourcetree,fab fa-speakap,fab fa-speaker-deck,fab fa-spotify,fab fa-squarespace,fab fa-stack-exchange,fab fa-stack-overflow,fab fa-stackpath,fab fa-staylinked,fab fa-steam,fab fa-steam-square,fab fa-steam-symbol,fab fa-sticker-mule,fab fa-strava,fab fa-stripe,fab fa-stripe-s,fab fa-studiovinari,fab fa-stumbleupon,fab fa-stumbleupon-circle,fab fa-superpowers,fab fa-supple,fab fa-suse,fab fa-swift,fab fa-symfony,fab fa-teamspeak,fab fa-telegram,fab fa-telegram-plane,fab fa-tencent-weibo,fab fa-the-red-yeti,fab fa-themeco,fab fa-themeisle,fab fa-think-peaks,fab fa-tiktok,fab fa-trade-federation,fab fa-trello,fab fa-tripadvisor,fab fa-tumblr,fab fa-tumblr-square,fab fa-twitch,fab fa-twitter,fab fa-twitter-square,fab fa-typo3,fab fa-uber,fab fa-ubuntu,fab fa-uikit,fab fa-umbraco,fab fa-uncharted,fab fa-uniregistry,fab fa-unity,fab fa-unsplash,fab fa-untappd,fab fa-ups,fab fa-usb,fab fa-usps,fab fa-ussunnah,fab fa-vaadin,fab fa-viacoin,fab fa-viadeo,fab fa-viadeo-square,fab fa-viber,fab fa-vimeo,fab fa-vimeo-square,fab fa-vimeo-v,fab fa-vine,fab fa-vk,fab fa-vnv,fab fa-vuejs,fab fa-watchman-monitoring,fab fa-waze,fab fa-weebly,fab fa-weibo,fab fa-weixin,fab fa-whatsapp,fab fa-whatsapp-square,fab fa-whmcs,fab fa-wikipedia-w,fab fa-windows,fab fa-wix,fab fa-wizards-of-the-coast,fab fa-wodu,fab fa-wolf-pack-battalion,fab fa-wordpress,fab fa-wordpress-simple,fab fa-wpbeginner,fab fa-wpexplorer,fab fa-wpforms,fab fa-wpressr,fab fa-xbox,fab fa-xing,fab fa-xing-square,fab fa-y-combinator,fab fa-yahoo,fab fa-yammer,fab fa-yandex,fab fa-yandex-international,fab fa-yarn,fab fa-yelp,fab fa-yoast,fab fa-youtube,fab fa-youtube-square,fab fa-zhihu' );
1593
+ // Get the selected icon if it exists.
1594
+ $selected_icon = get_post_meta( $item_id, '_menu_image_icon', true );
1595
+ // Fontawesome Solid Icons List.
1596
+
1597
+ if ( strpos( $selected_icon, 'fa-' ) !== false ) {
1598
+ echo '<div class="menu-image-fontawesome-list active">' ;
1599
+ } else {
1600
+ echo '<div class="menu-image-fontawesome-list">' ;
1601
+ }
1602
+
1603
+
1604
+ if ( !in_array( 'font-awesome/index.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
1605
+ _e( '<br><br><span>In order to use the FontAwesome icons you need to install the official FontAwesome plugin and select the SVG tecnhonoly. Check <a href="https://www.wpmenuimage.com/knowledgebase/general-options/add-icons-to-menu-items/?utm_source=menu-image-settings&utm_medium=user%20website&utm_campaign=install-fontawesome#fontawesome" target="_blank" >here</a> how to do it.', 'mobile-menu' );
1606
+ } else {
1607
+ echo '<ul class="menu-image-icons-fa-list-header"><li data-tab-id="fa-brands-list" class="active">Brands</li><li data-tab-id="fa-solid-list">Solid</li><li data-tab-id="fa-regular-list">Regular</li></ul>' ;
1608
+ // Fontawesome Solid Icons List.
1609
+ echo '<div class="menu-image-fa-solid-list">' ;
1610
+ // Loop through the list of icons.
1611
+ foreach ( $fa_solid as $icon ) {
1612
+
1613
+ if ( $icon == $selected_icon ) {
1614
+ echo '<i class="' . $icon . ' fa-2x menu-item-icon-selected"></i>' ;
1615
+ } else {
1616
+ echo '<i class="' . $icon . ' fa-2x"></i>' ;
1617
+ }
1618
+
1619
+ }
1620
+ echo '</div>' ;
1621
+ // Fontawesome Regular Icons List.
1622
+ echo '<div class="menu-image-fa-regular-list">' ;
1623
+ foreach ( $fa_regular as $icon ) {
1624
+
1625
+ if ( $icon == $selected_icon ) {
1626
+ echo '<i class="' . $icon . ' fa-2x menu-item-icon-selected"></i>' ;
1627
+ } else {
1628
+ echo '<i class="' . $icon . ' fa-2x"></i>' ;
1629
+ }
1630
+
1631
+ }
1632
+ echo '</div>' ;
1633
+ // Fontawesome Brands Icons List.
1634
+ echo '<div class="active menu-image-fa-brands-list">' ;
1635
+ foreach ( $fa_brands as $icon ) {
1636
+
1637
+ if ( $icon == $selected_icon ) {
1638
+ echo '<i class="' . $icon . ' fa-2x menu-item-icon-selected"></i>' ;
1639
+ } else {
1640
+ echo '<i class="' . $icon . ' fa-2x"></i>' ;
1641
+ }
1642
+
1643
+ }
1644
+ echo '</div>' ;
1645
+ }
1646
+
1647
+ // Closing final div.
1648
+ echo '</div>' ;
1649
+ }
1650
+
1651
+ /**
1652
+ * Output HTML for the menu item images section.
1653
+ *
1654
+ * @since 2.0
1655
+ *
1656
+ * @param int $item_id The post ID or object associated with the thumbnail, defaults to global $post.
1657
+ *
1658
+ * @return string html
1659
+ */
1660
+ public function wp_post_thumbnail_html( $item_id, $menu_title )
1661
+ {
1662
+ $default_size = apply_filters( 'menu_image_default_size', 'menu-36x36' );
1663
+ $content = $this->wp_post_thumbnail_only_html( $item_id );
1664
+ // Get the Menu item image size.
1665
+ $image_size = get_post_meta( $item_id, '_menu_item_image_size', true );
1666
+ if ( !$image_size ) {
1667
+ $image_size = $default_size;
1668
+ }
1669
+ // Get the Menu Item action type(button, icon, image).
1670
+ $menu_item_type = get_post_meta( $item_id, '_menu_item_image_type', true );
1671
+ if ( !$menu_item_type ) {
1672
+ $menu_item_type = 'image';
1673
+ }
1674
+ // Get the title position.
1675
+ $title_position = get_post_meta( $item_id, '_menu_item_image_title_position', true );
1676
+ if ( !$title_position ) {
1677
+ $title_position = apply_filters( 'menu_image_default_title_position', 'after' );
1678
+ }
1679
+ ob_start();
1680
+ ?>
1681
 
1682
+ <div class="menu-item-image-options">
1683
+ <div class="menu-image-icon-settings menu-image-container">
1684
+ <!-- Title position -->
1685
+ <div class="menu-image-field-holder">
1686
+ <div class="menu-image-label">
1687
+ <label><?php
1688
+ _e( 'Title position', 'menu-image' );
1689
+ ?></label>
1690
+ </div>
1691
+ <div class="menu-image-field">
1692
+ <?php
1693
+ $positions = array(
1694
+ 'hide' => __( 'Hide', 'menu-image' ),
1695
+ 'above' => __( 'Above', 'menu-image' ),
1696
+ 'below' => __( 'Below', 'menu-image' ),
1697
+ 'before' => __( 'Before', 'menu-image' ),
1698
+ 'after' => __( 'After', 'menu-image' ),
1699
+ );
1700
+ foreach ( $positions as $position => $label ) {
1701
+ printf(
1702
+ "<input type='radio' name='menu_item_image_title_position' value='%s'%s/> %s%s",
1703
+ esc_attr( $position ),
1704
+ ( $title_position == $position ? ' checked="checked"' : '' ),
1705
+ $label,
1706
+ ( $position != 'after' ? ' | ' : '' )
1707
+ );
1708
+ }
1709
+ ?>
1710
+ <p class="description">Controls the position of the title reggarding the image or icon</p>
1711
+ </div>
1712
+ </div>
1713
 
1714
+ <!-- Icon/Image -->
1715
+ <div class="menu-image-field-holder">
1716
+ <div class="menu-image-label">
1717
+ <label><?php
1718
+ _e( 'Use Icon/image: ', 'menu-image' );
1719
+ ?></label>
1720
+ </div>
1721
+ <div class="menu-image-field">
1722
+
1723
+ <?php
1724
+ $types = array(
1725
+ 'image' => __( 'Image', 'menu-image' ),
1726
+ 'icon' => __( 'Icon', 'menu-image' ),
1727
+ );
1728
+ foreach ( $types as $type => $label ) {
1729
+ printf(
1730
+ "<input type='radio' name='menu_item_image_type' value='%s'%s/> %s",
1731
+ esc_attr( $type ),
1732
+ ( $menu_item_type == $type ? ' checked="checked"' : '' ),
1733
+ $label
1734
+ );
1735
+ }
1736
+ ?>
1737
+
1738
+ <p class="description">You can use an image or an Icon</p>
1739
+ </div>
1740
+ </div>
1741
 
1742
+ <!-- Image header -->
1743
+ <div class="menu-image-field-holder menu-item-images menu-item-image-type" style="min-height:70px">
1744
+ <?php
1745
+ echo $content ;
1746
+ ?>
1747
+ </div>
1748
 
1749
+ <!-- Icon/Image -->
1750
+ <div class="menu-image-field-holder menu-item-image-type">
1751
+ <div class="menu-image-label">
1752
+ <label for="edit-menu-item-image-size-<?php
1753
+ echo $item_id ;
1754
+ ?>">
1755
+ <?php
1756
+ _e( 'Image size', 'menu-image' );
1757
+ ?>
1758
+ </label>
1759
+ </div>
1760
+ <div class="menu-image-field">
1761
+ <select id="edit-menu-item-image-size-<?php
1762
+ echo $item_id ;
1763
+ ?>"
1764
  class="widefat edit-menu-item-image-size"
1765
+ name="menu_item_image_size[<?php
1766
+ echo $item_id ;
1767
+ ?>]">
1768
+ <option value='full' <?php
1769
+ echo ( $image_size == 'full' ? ' selected="selected"' : '' ) ;
1770
+ ?>><?php
1771
+ _e( 'Original Size', 'menu-image' );
1772
+ ?></option>
1773
  <?php
1774
+ foreach ( get_intermediate_image_sizes() as $size ) {
1775
+ printf(
1776
+ "<option value='%s'%s>%s</option>\n",
1777
+ esc_attr( $size ),
1778
+ ( $image_size == $size ? ' selected="selected"' : '' ),
1779
+ ucfirst( $size )
1780
+ );
1781
+ ?>
1782
+ <?php
1783
+ }
1784
+ ?>
1785
  </select>
1786
+ </div>
1787
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1788
 
1789
+ <!-- Icons List -->
1790
+ <div class="menu-image-icons-list menu-item-icon-type">
1791
+ <ul class="menu-image-icons-list-header">
1792
+ <li data-tab-id="dashicons-list">Dashicons</li>
1793
+ <li data-tab-id="fontawesome-list">Fontawesome</li>
1794
+ </ul>
1795
 
1796
+ <?php
1797
+ $this->menu_image_build_dashicons_list( $item_id );
1798
+ $this->menu_image_build_fa_list( $item_id );
1799
+ ?>
 
 
 
 
 
1800
 
1801
+ </div>
1802
+ </div>
1803
 
1804
+ <div class="menu-image-button-settings menu-image-container" style="display:none;">
1805
+
1806
+ <!-- Menu Image Premium button options -->
1807
+ <?php
1808
+ ?>
1809
+ <p>Improve your site marketing by creating Call to action buttons. This is available in the Professional version.</p>
1810
+ <div class="prodemo-imgs">
1811
+ <h4>Some examples:</h4>
1812
+ <img src='<?php
1813
+ echo MENU_IMAGE_PLUGIN_URL ;
1814
+ ?>includes/assets/img/pro-button-1.png'>
1815
+ <img src='<?php
1816
+ echo MENU_IMAGE_PLUGIN_URL ;
1817
+ ?>includes/assets/img/pro-button-2.png'>
1818
+ </div>
1819
+ <p style="font-weight: 600;font-size:16px;">You would like to have the same in your website?<a href="<?php
1820
+ echo $this->mi_fs->get_upgrade_url() ;
1821
+ ?>&cta=upsell-button-upgrade-cta" class="mi-button-professional-upgrade"><?php
1822
+ _e( 'Upgrade Now!', 'mobile-menu' );
1823
+ ?></a></p>
1824
+ <p>Not sure if it has the right features? <a href="<?php
1825
+ echo $this->mi_fs->get_trial_url() ;
1826
+ ?>"><?php
1827
+ echo esc_html( 'Start a Free trial', 'menu-image' ) ;
1828
+ ?></a></p>
1829
+ <?php
1830
+ // Close premium blok
1831
+ ?>
1832
+ </div>
1833
 
1834
+ <div class="menu-image-notifications-settings menu-image-container" style="display:none;">
1835
+ <!-- Menu Immage Premium badges and bubble options -->
1836
+ <?php
1837
+ ?>
1838
+ <p>Grab your user attention with those notifications and badges.This is available in the Professional version.</p>
1839
+ <div class="prodemo-imgs">
1840
+ <h4>Some examples:</h4>
1841
+ <img src='<?php
1842
+ echo MENU_IMAGE_PLUGIN_URL ;
1843
+ ?>includes/assets/img/pro-badge-1.png'>
1844
+ <img src='<?php
1845
+ echo MENU_IMAGE_PLUGIN_URL ;
1846
+ ?>includes/assets/img/pro-badge-2.png'>
1847
+ <img src='<?php
1848
+ echo MENU_IMAGE_PLUGIN_URL ;
1849
+ ?>includes/assets/img/pro-badge-3.png'>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1850
  </div>
1851
+ <p style="font-weight: 600;font-size:16px;">You would like to have the same in your website?<a href="<?php
1852
+ echo $this->mi_fs->get_upgrade_url() ;
1853
+ ?>&cta=upsell-badge-upgrade-cta" class="mi-button-professional-upgrade"><?php
1854
+ _e( 'Upgrade Now!', 'mobile-menu' );
1855
+ ?></a></p>
1856
+ <p>Not sure if it has the right features? <a href="<?php
1857
+ echo $this->mi_fs->get_trial_url() ;
1858
+ ?>"><?php
1859
+ echo esc_html( 'Start a Free trial', 'menu-image' ) ;
1860
+ ?></a></p>
1861
+ <?php
1862
+ // Close premium blok
1863
+ ?>
1864
  </div>
1865
+ <div class="menu-item-preview">
1866
+ <h4>Preview</h4>
1867
+ <span class="title-text"><?php
1868
+ echo $menu_title ;
1869
+ ?></span>
1870
 
1871
+ <?php
1872
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1873
 
1874
+ </div>
1875
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1876
 
1877
+ <?php
1878
+ submit_button();
1879
+ $content = ob_get_clean();
1880
+ /**
1881
+ * Filter the admin menu item thumbnail HTML markup to return.
1882
+ *
1883
+ * @since 2.0
1884
+ *
1885
+ * @param string $content Admin menu item images HTML markup.
1886
+ * @param int $item_id Post ID.
1887
+ */
1888
+ return apply_filters( 'admin_menu_item_thumbnail_html', $content, $item_id );
1889
+ }
1890
+
1891
+ /**
1892
+ * Update item thumbnail via ajax action.
1893
+ *
1894
+ * @since 2.0
1895
+ */
1896
+ public function wp_ajax_set_menu_item_thumbnail()
1897
+ {
1898
+ $json = !empty($_REQUEST['json']);
1899
+ $post_ID = intval( $_POST['post_id'] );
1900
+ if ( !current_user_can( 'edit_post', $post_ID ) ) {
1901
+ wp_die( -1 );
1902
+ }
1903
+ $thumbnail_id = intval( $_POST['thumbnail_id'] );
1904
+ $is_hovered = (bool) $_POST['is_hover'];
1905
+ check_ajax_referer( 'update-menu-item' );
1906
+
1907
+ if ( $thumbnail_id == '-1' ) {
1908
+
1909
+ if ( $is_hovered ) {
1910
+ $success = delete_post_meta( $post_ID, '_thumbnail_hover_id' );
1911
+ } else {
1912
+ $success = delete_post_thumbnail( $post_ID );
1913
+ }
1914
+
1915
+ } else {
1916
+
1917
+ if ( $is_hovered ) {
1918
+ $success = update_post_meta( $post_ID, '_thumbnail_hover_id', $thumbnail_id );
1919
+ } else {
1920
+ $success = set_post_thumbnail( $post_ID, $thumbnail_id );
1921
+ }
1922
+
1923
+ }
1924
+
1925
+
1926
+ if ( $success ) {
1927
+ $return = $this->wp_post_thumbnail_only_html( $post_ID );
1928
+ ( $json ? wp_send_json_success( $return ) : wp_die( $return ) );
1929
+ }
1930
+
1931
+ wp_die( 0 );
1932
+ }
1933
+
1934
+ /**
1935
+ * Prevent jetpack Phonon applied for menu item images.
1936
+ *
1937
+ * @param bool $prevent
1938
+ * @param array $data
1939
+ *
1940
+ * @return bool
1941
+ */
1942
+ public function jetpack_photon_override_image_downsize_filter( $prevent, $data )
1943
+ {
1944
+ return $this->isAttachmentUsed( $data['attachment_id'], $data['size'] );
1945
+ }
1946
+
1947
+ /**
1948
+ * Set used attachment ids.
1949
+ *
1950
+ * @param string $size
1951
+ * @param int $id
1952
+ */
1953
+ public function setUsedAttachments( $size, $id )
1954
+ {
1955
+ $this->used_attachments[$size][] = $id;
1956
+ }
1957
+
1958
+ /**
1959
+ * Check if attachment is used in menu items.
1960
+ *
1961
+ * @param int $id
1962
+ * @param string $size
1963
+ *
1964
+ * @return bool
1965
+ */
1966
+ public function isAttachmentUsed( $id, $size = null )
1967
+ {
1968
+
1969
+ if ( !is_null( $size ) ) {
1970
+ return is_string( $size ) && isset( $this->used_attachments[$size] ) && in_array( $id, $this->used_attachments[$size] );
1971
+ } else {
1972
+ foreach ( $this->used_attachments as $used_attachment ) {
1973
+ if ( in_array( $id, $used_attachment ) ) {
1974
+ return true;
1975
+ }
1976
+ }
1977
+ return false;
1978
+ }
1979
+
1980
+ }
1981
+
1982
+ /**
1983
+ * Filters the list of attachment image attributes.
1984
+ *
1985
+ * @since 2.8.0
1986
+ *
1987
+ * @param array $attr Attributes for the image markup.
1988
+ * @param WP_Post $attachment Image attachment post.
1989
+ * @param string|array $size Requested size. Image size or array of width and height values
1990
+ * (in that order). Default 'thumbnail'.
1991
+ *
1992
+ * @return array Valid array of image attributes.
1993
+ */
1994
+ public function wp_get_attachment_image_attributes( $attr, $attachment, $size )
1995
+ {
1996
+ if ( $this->isAttachmentUsed( $attachment->ID, $size ) ) {
1997
+ unset( $attr['sizes'], $attr['srcset'] );
1998
+ }
1999
+ return $attr;
2000
+ }
2001
+
2002
+ /**
2003
+ * Mark item as processed to prevent re-processing it again.
2004
+ *
2005
+ * @param int $id
2006
+ */
2007
+ protected function setProcessed( $id )
2008
+ {
2009
+ $this->processed[] = $id;
2010
+ }
2011
+
2012
+ /**
2013
+ * Check if was already processed.
2014
+ *
2015
+ * @param int $id
2016
+ *
2017
+ * @return bool
2018
+ */
2019
+ protected function isProcessed( $id )
2020
+ {
2021
+ return in_array( $id, $this->processed );
2022
+ }
2023
 
 
 
 
 
 
 
 
 
 
 
 
2024
  }
2025
+ $menu_image = new WP_Menu_Image();
2026
+ $menu_image->init_menu_image();
2027
+ //require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: takanakui, freemius
3
  Tags: menu, navigation, image, icons, nav menu
4
  Donate link: https://www.buymeacoffee.com/ruiguerreiro
5
  Requires at least: 4.4.0
6
- Tested up to: 5.5
7
- Stable tag: 2.9.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -18,28 +18,41 @@ Control the position of the image or icon and also it's size.
18
 
19
  With Menu Image plugin you can do more, check some of the features:
20
 
21
-
22
- - Hide Title.
 
23
  - Add Image / Icon on the Left of the menu item title.
24
  - Add Image / Icon on the Right of the menu item title.
25
  - Add Image / Icon on the Above of the menu item title.
26
  - Add Image / Icon on the Below of the menu item title.
27
  - Switch images / icons on mouse over the menu item.
 
 
 
 
 
 
 
 
28
 
29
- It's compatible with WPML and no coding knowledge is required.
 
 
30
 
31
  = Related Plugins =
32
  * [Mobile Menu](https://www.wpmobilemenu.com/?utm_source=wordpressorg&utm_medium=menu-image&utm_campaign=plugin-description): WP Mobile Menu is the best WordPress responsive mobile menu. Provide to your mobile visitor an easy access to your site content using any device smartphone/tablet/desktop.
33
 
 
34
 
35
- ###I need help or I have a doubt, check our Support
36
- * Great Support, our free support is above the average.
37
 
38
- <a target="_blank" href="https://wordpress.org/support/plugin/menu-image">Menu Image Support</a>
39
-
40
- Bug reports for Menu Image are [welcomed on GitHub](https://github.com/ruiguerreiro79/menu-image). Please note GitHub is not a support forum, and issues that aren’t properly qualified as bugs will be closed.
41
 
 
 
42
 
 
43
  == Installation ==
44
 
45
  1. Upload `menu-image` to the `/wp-content/plugins/` directory
@@ -51,67 +64,42 @@ Bug reports for Menu Image are [welcomed on GitHub](https://github.com/ruiguerre
51
 
52
  == Frequently Asked Questions ==
53
 
54
- = How to add custom attributes to menu item link (useful for integration with dropdown menus) =
55
-
56
- Use core `nav_menu_link_attributes` and `nav_menu_item_title` filters.
57
-
58
- = How to wrap menu link text in `span` html element =
59
-
60
- Menu link text is already wrapped in `span.menu-image-title`.
61
-
62
- = How to add another size for the image? =
63
-
64
- To add a new size (or remove an old one) add a function to the `menu_image_default_sizes` filter. For example
65
-
66
- `
67
- <?php
68
- add_filter( 'menu_image_default_sizes', function($sizes) {
69
 
70
- // remove the default 36x36 size
71
- unset($sizes['menu-36x36']);
72
 
73
- // add a new size
74
- $sizes['menu-50x50'] = array(50,50);
75
 
76
- // return $sizes (required)
77
- return $sizes;
78
 
79
- });
80
- ?>
81
- `
82
 
83
- = How to make hovered image visible on current page of menu item? =
84
 
85
- Add this link to style.css
86
- `
87
- .menu-item.current-menu-item > a.menu-image-hovered img.hovered-image {
88
- opacity: 1;
89
- }
90
- `
91
 
92
- = If you have problem with srcset image problem on Wordpress version >= 4.4 and Azure hosting =
93
 
94
- If you srcset property look like this:
95
- `<img width="36" height="36" src="http://static.mywebsite.com/website/myaction_express_menu_icon-36x36.png" class="attachment-menu-36x36 size-menu-36x36" alt="myaction_express_menu_icon" srcset="http://www.mywebsite.com/wp-content/uploads/D:homesitewwwroot/wp-content/uploads/myaction_express_menu_icon-50x50.png 50w, http://www.mywebsite.com/wp-content/uploads/D:homesitewwwroot/wp-content/uploads/myaction_express_menu_icon-75x75.png 75w, http://www.mywebsite.com/wp-content/uploads/D:homesitewwwroot/wp-content/uploads/myaction_express_menu_icon-24x24.png 24w, http://www.mywebsite.com/wp-content/uploads/D:homesitewwwroot/wp-content/uploads/myaction_express_menu_icon-36x36.png 36w, http://www.mywebsite.com/wp-content/uploads/D:homesitewwwroot/wp-content/uploads/myaction_express_menu_icon-48x48.png 48w, http://www.mywebsite.com/wp-content/uploads/D:homesitewwwroot/wp-content/uploads/myaction_express_menu_icon.png 80w" sizes="(max-width: 36px) 100vw, 36px">`
96
- Then you can disable srcset (add it to your function.php):
97
- `
98
- /**
99
- * Fix for broken images on azure & wordpress 4.4
100
- * @see https://wordpress.org/support/topic/wordpress-adding-absolute-paths
101
- */
102
- add_filter( 'wp_calculate_image_srcset', '__return_false' );
103
- `
104
 
105
  == Screenshots ==
106
 
107
- 1. Admin screen
108
- 2. Menu preview in standard twenty-thirteen theme
 
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
112
  ### 2.9.7 ###
113
  * Fix - Fix Issue with display title above and below
114
- * Improvment - Update Freemius SDK to 2.4.0.1
115
 
116
  ### 2.9.6 ###
117
  * Fix - Fix compatibility issue with WordPress 5.4.
@@ -151,94 +139,3 @@ add_filter( 'wp_calculate_image_srcset', '__return_false' );
151
  * Use core `nav_menu_link_attributes`, `nav_menu_item_title` filters to add image and class instead of `walker_nav_menu_start_el` filter.
152
  * Drop support of core version < 4.4.0.
153
 
154
- = 2.7.0 =
155
- * Remove notification plugin. It was not a good idea btw.
156
-
157
- = 2.6.9 =
158
- * Revert back php <=5.2 support, https://wordpress.org/support/topic/upgrade-to-wp-453-and-268-and-got-this-error. Reported by @itmnetcom and @cjg79
159
-
160
- = 2.6.8 =
161
- * Fix `wp_nav_menu_item_custom_fields` filter usage https://wordpress.org/support/topic/blocked-on-36x36-image. Reported by @vladimir-slonska
162
- * Fix php warning in notifier component https://wordpress.org/support/topic/invalid-argument-supplied-for-foreach-in-4. Reported by @susanmarshallva
163
-
164
- = 2.6.7 =
165
- * Add `menu_image_link_attributes` filter, fix bug with menu dropdown in Flatsome theme https://wordpress.org/support/topic/bug-image-menu-dropdown. Reported by @apardo
166
-
167
- = 2.6.6 =
168
- * Fix various php errors.
169
-
170
- = 2.6.5 =
171
- * Add notification plugin.
172
-
173
- = 2.6.4 =
174
- * Fixing a clearing bug for WordPress 4.5+. Thanx @kau-boy
175
-
176
- = 2.6.3 =
177
- * Fix php warning 'Invalid Argument foreach()' https://wordpress.org/support/topic/invalid-argument-foreach-in-menu-imagephp-line-126. Thanx @majancart
178
-
179
- = 2.6.2 =
180
- * Update FAQ to dial with srcset and Azure hosting https://wordpress.org/support/topic/wordpress-adding-absolute-paths. Thanx @GeertvanHorrik
181
-
182
- = 2.6.1 =
183
- * Fix php warning https://wordpress.org/support/topic/bug-fix-error-in-the-file-menu-imagephp
184
-
185
- = 2.6 =
186
- * Fix bug on attachment page.
187
- * Add french translation. Thanx @CreativeJuiz
188
-
189
- = 2.5 =
190
- * Add above and below title. Thanx @alhoseany
191
- * Add original image size. Thanx @alhoseany
192
- * Fix the loss of choices on size and title when updating image by ajax. Thanx @alhoseany
193
- * Fix hidden title on responsive select menu.
194
-
195
- = 2.4 =
196
- * Fix compatibility with some modules and themes to according to [this topic](http://shazdeh.me/2014/06/25/custom-fields-nav-menu-items/)
197
- * Fix Jetpack Phonon frontend bug
198
-
199
- = 2.3 =
200
- * WPML menus sync support. Thanx @pabois for [feature request](http://wordpress.org/support/topic/very-good-wpml-compliant)
201
-
202
- = 2.2 =
203
- * Added grunt-wp-readme-to-markdown npm package for converting readme to markdown for github users.
204
-
205
- = 2.1 =
206
- * Fix [set-image-button-not-working](http://wordpress.org/support/topic/set-image-button-not-working)
207
- * Fix [vertical-align-when-using-mouseover-image](ttp://wordpress.org/support/topic/vertical-align-when-using-mouseover-image)
208
-
209
- = 2.0 =
210
- * Added support of media uploader.
211
- * Fixed php strict warnings.
212
- * Added .ico image support, thanks to [ivol84](https://github.com/ivol84)
213
-
214
- = 1.3 =
215
- * Added ability to set title position, an example: before, after image or hide
216
-
217
- = 1.2 =
218
- * Fix styles for hovered image
219
-
220
- = 1.1 =
221
- * Added style file with vertical align of menu image item by default
222
- * Added ability to upload image that which will be replaced on hover
223
- * Added default image sizes for menu items: 24x24, 36x36 and 48x48
224
-
225
- == Upgrade Notice ==
226
-
227
- = 2.5 =
228
- Now you can set link title below and above image, thanx @alhoseany.
229
-
230
- = 2.4 =
231
- If your are using Jetpack Phonon module now menu icons will be look good.
232
-
233
- = 2.3 =
234
- If your are using WPML plugin, now when you sync menus, images will synced too.
235
-
236
- = 2.0 =
237
- WARNING! You need to re-select the images! Now, with media uploader support, it's easy peasy.
238
- Media uploader support. Upload once, use many times!
239
-
240
- = 1.2 =
241
- Now you can change title text position
242
-
243
- = 1.1 =
244
- Now you can upload image that replaced default on mouse hover
3
  Tags: menu, navigation, image, icons, nav menu
4
  Donate link: https://www.buymeacoffee.com/ruiguerreiro
5
  Requires at least: 4.4.0
6
+ Tested up to: 5.6
7
+ Stable tag: 3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
18
 
19
  With Menu Image plugin you can do more, check some of the features:
20
 
21
+ - [New] FontAwesome Icons
22
+ - [New] DashIcons Icons
23
+ - Hide Title and show only image or icon.
24
  - Add Image / Icon on the Left of the menu item title.
25
  - Add Image / Icon on the Right of the menu item title.
26
  - Add Image / Icon on the Above of the menu item title.
27
  - Add Image / Icon on the Below of the menu item title.
28
  - Switch images / icons on mouse over the menu item.
29
+ - [PREMIUM] Convert menu items into Call to action buttons.
30
+ - [PREMIUM] Convert menu items into Call to action buttons.
31
+ - [PREMIUM] Add count bubble to menu items (Cart total, category total, custom function) menu items.
32
+ - [PREMIUM] Notification badges on the menu items (New, Sale, Hiring, etc).
33
+ - [PREMIUM] Color customization of the buttons, badges and bubbles.
34
+
35
+
36
+ = Links =
37
 
38
+ * [Menu Image Premium](https://www.wpmenuimage.com/?utm_source=wprepo-readme&utm_medium=user%20website&utm_campaign=readme_link)
39
+ * [Documentation](https://www.wpmenuimage.com/knowledgebase/?utm_source=wprepo-readme&utm_medium=user%20website&utm_campaign=readme_link)
40
+ * [Creat support ticket](https://www.wpmenuimage.com/support-contact/?utm_source=wprepo-readme&utm_medium=user%20website&utm_campaign=readme_link)
41
 
42
  = Related Plugins =
43
  * [Mobile Menu](https://www.wpmobilemenu.com/?utm_source=wordpressorg&utm_medium=menu-image&utm_campaign=plugin-description): WP Mobile Menu is the best WordPress responsive mobile menu. Provide to your mobile visitor an easy access to your site content using any device smartphone/tablet/desktop.
44
 
45
+ What people is saying!
46
 
47
+ > `Easy to use and good author support`
48
+ > This plugin is a good solution to easily include an image in a menu. Excellent support from plugin author!
49
 
50
+ > @dwoolworth824
 
 
51
 
52
+ > `Best plugin for adding a logo to your navigation`
53
+ > I'd definitely recommend this plugin if you need to add a logo to your navigation in WordPress. The support provided is so 5 stars!
54
 
55
+ > @dwoolworth824
56
  == Installation ==
57
 
58
  1. Upload `menu-image` to the `/wp-content/plugins/` directory
64
 
65
  == Frequently Asked Questions ==
66
 
67
+ = How to install Menu Image? =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
+ Check this article in the following [link](https://www.wpmenuimage.com/knowledgebase/getting-started/how-to-install-menu-image/?utm_source=wprepo-readme&utm_medium=user%20website&utm_campaign=readme_faqs_2)
 
70
 
71
+ = How to enable Menu Image? =
 
72
 
73
+ Check this article in the following [link](https://www.wpmenuimage.com/knowledgebase/general-options/how-to-enable-menu-image/?utm_source=wprepo-readme&utm_medium=user%20website&utm_campaign=readme_faqs_2)
 
74
 
75
+ = How to add Icons to Menu Items? =
 
 
76
 
77
+ Check this article in the following [link](https://www.wpmenuimage.com/knowledgebase/general-options/add-icons-to-menu-items/?utm_source=wprepo-readme&utm_medium=user%20website&utm_campaign=readme_faqs_2)
78
 
79
+ = How to add custom CSS to Menu Image? =
 
 
 
 
 
80
 
81
+ Check this article in the following [link](https://www.wpmenuimage.com/knowledgebase/general-options/how-to-add-custom-css-to-menu-image/?utm_source=wprepo-readme&utm_medium=user%20website&utm_campaign=readme_faqs_2)
82
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  == Screenshots ==
85
 
86
+ 1. Add FontAwesome Icons to menu item
87
+ 2. Add DashIcons Icons to menu item
88
+ 3. Add images to menu item
89
 
90
  == Changelog ==
91
 
92
+ ### 3.0 ###
93
+ * New - New Settings redesign
94
+ * New - Menu item preview in the settings
95
+ * New - Possible to add FontAwesome Icons
96
+ * New - Possible to add DashIcons Icons
97
+ * Improvment – Update Freemius SDK
98
+ * Improvment – Code clean up
99
+
100
  ### 2.9.7 ###
101
  * Fix - Fix Issue with display title above and below
102
+ * Improvment Update Freemius SDK to 2.4.0.1
103
 
104
  ### 2.9.6 ###
105
  * Fix - Fix compatibility issue with WordPress 5.4.
139
  * Use core `nav_menu_link_attributes`, `nav_menu_item_title` filters to add image and class instead of `walker_nav_menu_start_el` filter.
140
  * Drop support of core version < 4.4.0.
141