Business Profile - Version 1.1.4

Version Description

This update adds a new image setting, which Google now requires for local businesses. You're strongly encouraged to add an image for your business.

Download this release

Release Info

Developer NateWr
Plugin Icon 128x128 Business Profile
Version 1.1.4
Comparing to
See all releases

Code changes from version 1.1.3 to 1.1.4

Files changed (31) hide show
  1. Gruntfile.js +22 -0
  2. business-profile.php +2 -2
  3. includes/class-custom-post-types.php +2 -0
  4. includes/class-sap-scheduler-meta.php +2 -2
  5. includes/class-settings.php +36 -11
  6. languages/business-profile.pot +103 -83
  7. lib/simple-admin-pages/README.md +6 -2
  8. lib/simple-admin-pages/classes/AdminPage.Menu.class.php +1 -1
  9. lib/simple-admin-pages/classes/AdminPage.Submenu.class.php +1 -1
  10. lib/simple-admin-pages/classes/AdminPage.Themes.class.php +1 -1
  11. lib/simple-admin-pages/classes/AdminPage.class.php +1 -1
  12. lib/simple-admin-pages/classes/AdminPageSection.class.php +1 -1
  13. lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php +1 -1
  14. lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php +1 -1
  15. lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php +5 -5
  16. lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php +62 -0
  17. lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php +1 -1
  18. lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php +1 -1
  19. lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php +1 -1
  20. lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php +1 -1
  21. lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php +1 -1
  22. lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php +1 -1
  23. lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php +1 -1
  24. lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php +1 -1
  25. lib/simple-admin-pages/classes/AdminPageSetting.class.php +1 -1
  26. lib/simple-admin-pages/classes/Library.class.php +8 -3
  27. lib/simple-admin-pages/css/admin.css +19 -0
  28. lib/simple-admin-pages/js/image.js +53 -0
  29. package.json +2 -1
  30. readme.txt +8 -2
  31. templates/contact-card.php +3 -0
Gruntfile.js CHANGED
@@ -35,16 +35,38 @@ module.exports = function(grunt) {
35
  type: 'wp-plugin',
36
  }
37
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  });
41
 
42
  // Load tasks
 
43
  grunt.loadNpmTasks('grunt-contrib-jshint');
44
  grunt.loadNpmTasks('grunt-contrib-watch');
45
  grunt.loadNpmTasks('grunt-wp-i18n');
46
 
47
  // Default task(s).
48
  grunt.registerTask('default', ['watch']);
 
49
 
50
  };
35
  type: 'wp-plugin',
36
  }
37
  }
38
+ },
39
+
40
+ // Build a package for distribution
41
+ compress: {
42
+ main: {
43
+ options: {
44
+ archive: 'business-profile-<%= pkg.version %>.zip'
45
+ },
46
+ files: [
47
+ {
48
+ src: [
49
+ '*', '**/*',
50
+ '!business-profile-<%= pkg.version %>.zip',
51
+ '!.*', '!Gruntfile.js', '!package.json', '!node_modules', '!node_modules/**/*',
52
+ '!**/.*', '!**/Gruntfile.js', '!**/package.json', '!**/node_modules', '!**/node_modules/**/*',
53
+ ],
54
+ dest: 'business-profile/',
55
+ }
56
+ ]
57
+ }
58
  }
59
 
60
  });
61
 
62
  // Load tasks
63
+ grunt.loadNpmTasks('grunt-contrib-compress');
64
  grunt.loadNpmTasks('grunt-contrib-jshint');
65
  grunt.loadNpmTasks('grunt-contrib-watch');
66
  grunt.loadNpmTasks('grunt-wp-i18n');
67
 
68
  // Default task(s).
69
  grunt.registerTask('default', ['watch']);
70
+ grunt.registerTask('package', ['makepot', 'compress']);
71
 
72
  };
business-profile.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Business Profile
4
  * Plugin URI: http://themeofthecrop.com
5
  * Description: Contact information, Google Maps and opening hours made easy for businesses.
6
- * Version: 1.1.3
7
  * Author: Theme of the Crop
8
  * Author URI: http://themeofthecrop.com
9
  * License: GNU General Public License v2.0 or later
@@ -89,7 +89,7 @@ if ( ! class_exists( 'bpfwpInit', false ) ) :
89
  define( 'BPFWP_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
90
  define( 'BPFWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
91
  define( 'BPFWP_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
92
- define( 'BPFWP_VERSION', '1.1.3' );
93
  }
94
 
95
  /**
3
  * Plugin Name: Business Profile
4
  * Plugin URI: http://themeofthecrop.com
5
  * Description: Contact information, Google Maps and opening hours made easy for businesses.
6
+ * Version: 1.1.4
7
  * Author: Theme of the Crop
8
  * Author URI: http://themeofthecrop.com
9
  * License: GNU General Public License v2.0 or later
89
  define( 'BPFWP_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
90
  define( 'BPFWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
91
  define( 'BPFWP_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
92
+ define( 'BPFWP_VERSION', '1.1.4' );
93
  }
94
 
95
  /**
includes/class-custom-post-types.php CHANGED
@@ -65,6 +65,7 @@ if ( ! class_exists( 'bpfwpCustomPostTypes', false ) ) :
65
  'edit_item' => __( 'Edit Location', 'business-profile' ),
66
  'new_item' => __( 'New Location', 'business-profile' ),
67
  'view_item' => __( 'View Location', 'business-profile' ),
 
68
  'search_items' => __( 'Search Locations', 'business-profile' ),
69
  'not_found' => __( 'No locations found', 'business-profile' ),
70
  'not_found_in_trash' => __( 'No locations found in trash', 'business-profile' ),
@@ -73,6 +74,7 @@ if ( ! class_exists( 'bpfwpCustomPostTypes', false ) ) :
73
  'public' => true,
74
  'show_in_menu' => 'bpfwp-locations',
75
  'has_archive' => true,
 
76
  );
77
 
78
  $this->location_cpt_slug = apply_filters( 'bpfwp_location_cpt_slug', $this->location_cpt_slug );
65
  'edit_item' => __( 'Edit Location', 'business-profile' ),
66
  'new_item' => __( 'New Location', 'business-profile' ),
67
  'view_item' => __( 'View Location', 'business-profile' ),
68
+ 'view_items' => __( 'View Locations', 'business-profile' ),
69
  'search_items' => __( 'Search Locations', 'business-profile' ),
70
  'not_found' => __( 'No locations found', 'business-profile' ),
71
  'not_found_in_trash' => __( 'No locations found in trash', 'business-profile' ),
74
  'public' => true,
75
  'show_in_menu' => 'bpfwp-locations',
76
  'has_archive' => true,
77
+ 'supports' => array( 'title', 'editor', 'thumbnail' ),
78
  );
79
 
80
  $this->location_cpt_slug = apply_filters( 'bpfwp_location_cpt_slug', $this->location_cpt_slug );
includes/class-sap-scheduler-meta.php CHANGED
@@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
15
 
16
  require_once BPFWP_PLUGIN_DIR . '/lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php';
17
 
18
- if ( ! class_exists( 'bpfwpSAPSchedulerMeta', false ) && class_exists( 'sapAdminPageSettingScheduler_2_0_1' ) ) :
19
 
20
  /**
21
  * Class to extend the Simple Admin Pages Scheduler component for use on
@@ -23,7 +23,7 @@ if ( ! class_exists( 'bpfwpSAPSchedulerMeta', false ) && class_exists( 'sapAdmin
23
  *
24
  * @since 1.1
25
  */
26
- class bpfwpSAPSchedulerMeta extends sapAdminPageSettingScheduler_2_0_1{
27
 
28
  /**
29
  * Generate an option input field name. The default component appends
15
 
16
  require_once BPFWP_PLUGIN_DIR . '/lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php';
17
 
18
+ if ( ! class_exists( 'bpfwpSAPSchedulerMeta', false ) && class_exists( 'sapAdminPageSettingScheduler_2_1_0' ) ) :
19
 
20
  /**
21
  * Class to extend the Simple Admin Pages Scheduler component for use on
23
  *
24
  * @since 1.1
25
  */
26
+ class bpfwpSAPSchedulerMeta extends sapAdminPageSettingScheduler_2_1_0 {
27
 
28
  /**
29
  * Generate an option input field name. The default component appends
includes/class-settings.php CHANGED
@@ -99,14 +99,15 @@ if ( ! class_exists( 'bpfwpSettings' ) ) :
99
  'bpfwp_default_display_settings',
100
  array(
101
  'location' => false,
102
- 'show_name' => true,
103
- 'show_address' => true,
104
- 'show_get_directions' => true,
105
- 'show_phone' => true,
106
- 'show_contact' => true,
107
- 'show_opening_hours' => true,
108
- 'show_opening_hours_brief' => false,
109
- 'show_map' => true,
 
110
  )
111
  );
112
 
@@ -151,6 +152,9 @@ if ( ! class_exists( 'bpfwpSettings' ) ) :
151
  case 'schema_type' :
152
  return get_post_meta( $location, 'schema_type', true );
153
 
 
 
 
154
  case 'name' :
155
  return get_the_title( $location );
156
 
@@ -193,7 +197,7 @@ if ( ! class_exists( 'bpfwpSettings' ) ) :
193
  require_once BPFWP_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php';
194
  $sap = sap_initialize_library(
195
  $args = array(
196
- 'version' => '2.0.1',
197
  'lib_url' => BPFWP_PLUGIN_URL . '/lib/simple-admin-pages/',
198
  )
199
  );
@@ -223,7 +227,8 @@ if ( ! class_exists( 'bpfwpSettings' ) ) :
223
  'capability' => 'manage_options',
224
  )
225
  );
226
- // Single location mode.
 
227
  } else {
228
 
229
  $sap->add_page(
@@ -255,7 +260,7 @@ if ( ! class_exists( 'bpfwpSettings' ) ) :
255
  array(
256
  'id' => 'schema_type',
257
  'title' => __( 'Schema Type', 'business-profile' ),
258
- 'description' => __( 'Select the option that best describes your business to improve how search engines understand your website', 'business-profile' ) . ' <a href="http://schema.org/" target="_blank">Schema.org</a>',
259
  'blank_option' => false,
260
  'options' => $this->get_schema_types(),
261
  'args' => array(
@@ -265,6 +270,26 @@ if ( ! class_exists( 'bpfwpSettings' ) ) :
265
  )
266
  );
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  $sap->add_section(
269
  'bpfwp-settings',
270
  array(
99
  'bpfwp_default_display_settings',
100
  array(
101
  'location' => false,
102
+ 'show_name' => true,
103
+ 'show_address' => true,
104
+ 'show_get_directions' => true,
105
+ 'show_phone' => true,
106
+ 'show_contact' => true,
107
+ 'show_opening_hours' => true,
108
+ 'show_opening_hours_brief' => false,
109
+ 'show_map' => true,
110
+ 'show_image' => false,
111
  )
112
  );
113
 
152
  case 'schema_type' :
153
  return get_post_meta( $location, 'schema_type', true );
154
 
155
+ case 'image' :
156
+ return has_post_thumbnail( $location ) ? get_post_thumbnail_id( $location ) : $this->get_setting( $setting );
157
+
158
  case 'name' :
159
  return get_the_title( $location );
160
 
197
  require_once BPFWP_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php';
198
  $sap = sap_initialize_library(
199
  $args = array(
200
+ 'version' => '2.1.0',
201
  'lib_url' => BPFWP_PLUGIN_URL . '/lib/simple-admin-pages/',
202
  )
203
  );
227
  'capability' => 'manage_options',
228
  )
229
  );
230
+
231
+ // Single location mode.
232
  } else {
233
 
234
  $sap->add_page(
260
  array(
261
  'id' => 'schema_type',
262
  'title' => __( 'Schema Type', 'business-profile' ),
263
+ 'description' => __( 'Select the option that best describes your business to improve how search engines understand your website.', 'business-profile' ) . ' <a href="http://schema.org/" target="_blank">Schema.org</a>',
264
  'blank_option' => false,
265
  'options' => $this->get_schema_types(),
266
  'args' => array(
270
  )
271
  );
272
 
273
+ $sap->add_setting(
274
+ 'bpfwp-settings',
275
+ 'bpfwp-seo',
276
+ 'image',
277
+ array(
278
+ 'id' => 'image',
279
+ 'title' => __( 'Image', 'business-profile' ),
280
+ 'description' => __( 'Google requires you provide an image to display with your local business search profile.', 'business-profile' ),
281
+ 'strings' => array(
282
+ 'add_image' => __( 'Add Image', 'textdomain' ),
283
+ 'change_image' => __( 'Change Image', 'textdomain' ),
284
+ 'remove_image' => __( 'Remove Image', 'textdomain' ),
285
+ ),
286
+ 'args' => array(
287
+ 'label_for' => 'image',
288
+ 'class' => 'bpfwp-image'
289
+ ),
290
+ )
291
+ );
292
+
293
  $sap->add_section(
294
  'bpfwp-settings',
295
  array(
languages/business-profile.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GNU General Public License v2.0 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Business Profile 1.1.3\n"
6
  "Report-Msgid-Bugs-To: https://themeofthecrop.com\n"
7
- "POT-Creation-Date: 2017-03-21 14:22:12+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -78,8 +78,8 @@ msgstr ""
78
 
79
  #: includes/class-custom-post-types.php:59
80
  #: includes/class-custom-post-types.php:61
81
- #: includes/class-custom-post-types.php:62 includes/class-settings.php:208
82
- #: includes/class-settings.php:209
83
  msgid "Locations"
84
  msgstr ""
85
 
@@ -104,114 +104,118 @@ msgid "View Location"
104
  msgstr ""
105
 
106
  #: includes/class-custom-post-types.php:68
107
- msgid "Search Locations"
108
  msgstr ""
109
 
110
  #: includes/class-custom-post-types.php:69
111
- msgid "No locations found"
112
  msgstr ""
113
 
114
  #: includes/class-custom-post-types.php:70
115
- msgid "No locations found in trash"
116
  msgstr ""
117
 
118
  #: includes/class-custom-post-types.php:71
 
 
 
 
119
  msgid "All Locations"
120
  msgstr ""
121
 
122
- #: includes/class-custom-post-types.php:146 includes/class-settings.php:257
123
  msgid "Schema Type"
124
  msgstr ""
125
 
126
- #: includes/class-custom-post-types.php:157
127
  msgid "Contact Details"
128
  msgstr ""
129
 
130
- #: includes/class-custom-post-types.php:167
131
- #: includes/class-custom-post-types.php:407 includes/class-settings.php:406
132
  #: templates/opening-hours.php:21
133
  msgid "Opening Hours"
134
  msgstr ""
135
 
136
- #: includes/class-custom-post-types.php:228
137
  msgid "Schema type"
138
  msgstr ""
139
 
140
- #: includes/class-custom-post-types.php:238
141
  msgid ""
142
  "Select the option that best describes your business to improve how search "
143
  "engines understand your website."
144
  msgstr ""
145
 
146
- #: includes/class-custom-post-types.php:264
147
- #: includes/class-custom-post-types.php:288 includes/class-settings.php:303
148
  msgid "No map coordinates set."
149
  msgstr ""
150
 
151
- #: includes/class-custom-post-types.php:266 includes/class-settings.php:304
152
  msgid "Requesting new coordinates"
153
  msgstr ""
154
 
155
- #: includes/class-custom-post-types.php:267 includes/class-settings.php:305
156
  msgid "Select a match below"
157
  msgstr ""
158
 
159
- #: includes/class-custom-post-types.php:268
160
- #: includes/class-custom-post-types.php:291 includes/class-settings.php:306
161
  msgid "View"
162
  msgstr ""
163
 
164
- #: includes/class-custom-post-types.php:269 includes/class-settings.php:310
165
  msgid "Error"
166
  msgstr ""
167
 
168
- #: includes/class-custom-post-types.php:270 includes/class-settings.php:311
169
  msgid ""
170
  "Invalid request. Be sure to fill out the address field before retrieving "
171
  "coordinates."
172
  msgstr ""
173
 
174
- #: includes/class-custom-post-types.php:271 includes/class-settings.php:312
175
  msgid "Request denied."
176
  msgstr ""
177
 
178
- #: includes/class-custom-post-types.php:272 includes/class-settings.php:313
179
  msgid "Request denied because you are over your request quota."
180
  msgstr ""
181
 
182
- #: includes/class-custom-post-types.php:273
183
  msgid "Nothing was found at that address."
184
  msgstr ""
185
 
186
- #: includes/class-custom-post-types.php:298 includes/class-settings.php:307
187
  msgid "Retrieve map coordinates"
188
  msgstr ""
189
 
190
- #: includes/class-custom-post-types.php:302 includes/class-settings.php:308
191
  msgid "Remove map coordinates"
192
  msgstr ""
193
 
194
- #: includes/class-custom-post-types.php:330 includes/class-settings.php:364
195
  msgid "Contact Page"
196
  msgstr ""
197
 
198
- #: includes/class-custom-post-types.php:344 includes/class-settings.php:383
199
  msgid "Email Address (optional)"
200
  msgstr ""
201
 
202
- #: includes/class-custom-post-types.php:351
203
  msgid "Phone Number"
204
  msgstr ""
205
 
206
- #: includes/class-custom-post-types.php:408 includes/class-settings.php:407
207
  msgid "Define your weekly opening hours by adding scheduling rules."
208
  msgstr ""
209
 
210
- #: includes/class-custom-post-types.php:423 includes/class-settings.php:422
211
  msgid "Add another opening time"
212
  msgstr ""
213
 
214
- #: includes/class-custom-post-types.php:437 includes/class-settings.php:436
215
  msgid "Delete scheduling rule"
216
  msgstr ""
217
 
@@ -219,75 +223,91 @@ msgstr ""
219
  msgid "Business Profile"
220
  msgstr ""
221
 
222
- #: includes/class-settings.php:247
223
  msgid "Search Engine Optimization"
224
  msgstr ""
225
 
226
- #: includes/class-settings.php:258
 
 
 
 
227
  msgid ""
228
- "Select the option that best describes your business to improve how search "
229
- "engines understand your website"
230
  msgstr ""
231
 
232
- #: includes/class-settings.php:272
 
 
 
 
 
 
 
 
 
 
 
 
233
  msgid "Contact Information"
234
  msgstr ""
235
 
236
- #: includes/class-settings.php:282
237
  msgid "Name"
238
  msgstr ""
239
 
240
- #: includes/class-settings.php:283
241
  msgid "Enter the name of your business if it is different than the website name."
242
  msgstr ""
243
 
244
- #: includes/class-settings.php:299
245
  msgid "Address"
246
  msgstr ""
247
 
248
- #: includes/class-settings.php:309
249
  msgid "Try again?"
250
  msgstr ""
251
 
252
- #: includes/class-settings.php:314
253
  msgid "Nothing was found at that address"
254
  msgstr ""
255
 
256
- #: includes/class-settings.php:329
257
  msgid "Google Maps API Key"
258
  msgstr ""
259
 
260
- #: includes/class-settings.php:331
261
  msgid ""
262
  "Google requires an API key to use their maps. %sGet an API key%s. A full "
263
  "walk-through is available in the %sdocumentiaton%s."
264
  msgstr ""
265
 
266
- #: includes/class-settings.php:350
267
  msgid "Phone"
268
  msgstr ""
269
 
270
- #: includes/class-settings.php:365
271
  msgid ""
272
  "Select a page on your site where users can reach you, such as a contact "
273
  "form."
274
  msgstr ""
275
 
276
- #: includes/class-settings.php:384
277
  msgid ""
278
  "Enter an email address only if you want to display this publicly. Showing "
279
  "your email address on your site may cause you to receive excessive spam."
280
  msgstr ""
281
 
282
- #: includes/class-settings.php:396
283
  msgid "Schedule"
284
  msgstr ""
285
 
286
- #: includes/class-settings.php:456 includes/class-settings.php:466
287
  msgid "Multiple Locations"
288
  msgstr ""
289
 
290
- #: includes/class-settings.php:467
291
  msgid "Enable support for multiple business locations."
292
  msgstr ""
293
 
@@ -400,53 +420,53 @@ msgstr ""
400
  msgid "Theme of the Crop"
401
  msgstr ""
402
 
403
- #: includes/class-custom-post-types.php:265
404
- #: includes/class-custom-post-types.php:290 includes/class-settings.php:302
405
  msgctxt "separates latitude and longitude"
406
  msgid ", "
407
  msgstr ""
408
 
409
- #: includes/class-custom-post-types.php:300 includes/class-settings.php:301
410
  msgctxt "separator between admin action links in address component"
411
  msgid " | "
412
  msgstr ""
413
 
414
- #: includes/class-custom-post-types.php:410 includes/class-settings.php:409
415
  msgctxt "Monday abbreviation"
416
  msgid "Mo"
417
  msgstr ""
418
 
419
- #: includes/class-custom-post-types.php:411 includes/class-settings.php:410
420
  msgctxt "Tuesday abbreviation"
421
  msgid "Tu"
422
  msgstr ""
423
 
424
- #: includes/class-custom-post-types.php:412 includes/class-settings.php:411
425
  msgctxt "Wednesday abbreviation"
426
  msgid "We"
427
  msgstr ""
428
 
429
- #: includes/class-custom-post-types.php:413 includes/class-settings.php:412
430
  msgctxt "Thursday abbreviation"
431
  msgid "Th"
432
  msgstr ""
433
 
434
- #: includes/class-custom-post-types.php:414 includes/class-settings.php:413
435
  msgctxt "Friday abbreviation"
436
  msgid "Fr"
437
  msgstr ""
438
 
439
- #: includes/class-custom-post-types.php:415 includes/class-settings.php:414
440
  msgctxt "Saturday abbreviation"
441
  msgid "Sa"
442
  msgstr ""
443
 
444
- #: includes/class-custom-post-types.php:416 includes/class-settings.php:415
445
  msgctxt "Sunday abbreviation"
446
  msgid "Su"
447
  msgstr ""
448
 
449
- #: includes/class-custom-post-types.php:418 includes/class-settings.php:417
450
  msgctxt ""
451
  "Time format displayed in the opening hours setting panel in your admin "
452
  "area. Must match formatting rules at "
@@ -454,7 +474,7 @@ msgctxt ""
454
  msgid "h:i A"
455
  msgstr ""
456
 
457
- #: includes/class-custom-post-types.php:419 includes/class-settings.php:418
458
  msgctxt ""
459
  "Date format displayed in the opening hours setting panel in your admin "
460
  "area. Must match formatting rules at "
@@ -462,86 +482,86 @@ msgctxt ""
462
  msgid "mmmm d, yyyy"
463
  msgstr ""
464
 
465
- #: includes/class-custom-post-types.php:424 includes/class-settings.php:423
466
  msgctxt "Format of a scheduling rule"
467
  msgid "Weekly"
468
  msgstr ""
469
 
470
- #: includes/class-custom-post-types.php:425 includes/class-settings.php:424
471
  msgctxt "Format of a scheduling rule"
472
  msgid "Monthly"
473
  msgstr ""
474
 
475
- #: includes/class-custom-post-types.php:426 includes/class-settings.php:425
476
  msgctxt "Format of a scheduling rule"
477
  msgid "Date"
478
  msgstr ""
479
 
480
- #: includes/class-custom-post-types.php:427 includes/class-settings.php:426
481
  msgctxt "Label for selecting days of the week in a scheduling rule"
482
  msgid "Days of the week"
483
  msgstr ""
484
 
485
- #: includes/class-custom-post-types.php:428 includes/class-settings.php:427
486
  msgctxt "Label for selecting weeks of the month in a scheduling rule"
487
  msgid "Weeks of the month"
488
  msgstr ""
489
 
490
- #: includes/class-custom-post-types.php:429 includes/class-settings.php:428
491
  msgctxt "Label to select a date for a scheduling rule"
492
  msgid "Date"
493
  msgstr ""
494
 
495
- #: includes/class-custom-post-types.php:430 includes/class-settings.php:429
496
  msgctxt "Label to select a time slot for a scheduling rule"
497
  msgid "Time"
498
  msgstr ""
499
 
500
- #: includes/class-custom-post-types.php:431 includes/class-settings.php:430
501
  msgctxt "Label to set a scheduling rule to last all day"
502
  msgid "All day"
503
  msgstr ""
504
 
505
- #: includes/class-custom-post-types.php:432 includes/class-settings.php:431
506
  msgctxt "Label for the starting time of a scheduling rule"
507
  msgid "Start"
508
  msgstr ""
509
 
510
- #: includes/class-custom-post-types.php:433 includes/class-settings.php:432
511
  msgctxt "Label for the ending time of a scheduling rule"
512
  msgid "End"
513
  msgstr ""
514
 
515
- #: includes/class-custom-post-types.php:434 includes/class-settings.php:433
516
  msgctxt "Prompt displayed when a scheduling rule is set without any time restrictions"
517
  msgid "All day long. Want to %sset a time slot%s?"
518
  msgstr ""
519
 
520
- #: includes/class-custom-post-types.php:435 includes/class-settings.php:434
521
  msgctxt "Toggle a scheduling rule open and closed"
522
  msgid "Open and close this rule"
523
  msgstr ""
524
 
525
- #: includes/class-custom-post-types.php:436 includes/class-settings.php:435
526
  msgctxt "Delete a scheduling rule"
527
  msgid "Delete rule"
528
  msgstr ""
529
 
530
- #: includes/class-custom-post-types.php:438 includes/class-settings.php:437
531
  msgctxt ""
532
  "Brief default description of a scheduling rule when no weekdays or weeks "
533
  "are included in the rule"
534
  msgid "Never"
535
  msgstr ""
536
 
537
- #: includes/class-custom-post-types.php:439 includes/class-settings.php:438
538
  msgctxt ""
539
  "Brief default description of a scheduling rule when all the weekdays/weeks "
540
  "are included in the rule"
541
  msgid "Every day"
542
  msgstr ""
543
 
544
- #: includes/class-custom-post-types.php:440 includes/class-settings.php:439
545
  msgctxt ""
546
  "Brief default description of a scheduling rule when some weekdays are "
547
  "included on only some weeks of the month. %s should be left alone and will "
@@ -550,7 +570,7 @@ msgctxt ""
550
  msgid "%s on the %s week of the month"
551
  msgstr ""
552
 
553
- #: includes/class-custom-post-types.php:441 includes/class-settings.php:440
554
  msgctxt ""
555
  "Brief default description of a scheduling rule when some weeks of the month "
556
  "are included but all or no weekdays are selected. %s should be left alone "
@@ -559,26 +579,26 @@ msgctxt ""
559
  msgid "%s week of the month"
560
  msgstr ""
561
 
562
- #: includes/class-custom-post-types.php:442 includes/class-settings.php:441
563
  msgctxt "Brief default description of a scheduling rule when no times are set"
564
  msgid "All day"
565
  msgstr ""
566
 
567
- #: includes/class-custom-post-types.php:443 includes/class-settings.php:442
568
  msgctxt ""
569
  "Brief default description of a scheduling rule when an end time is set but "
570
  "no start time. If the end time is 6pm, it will read: Ends at 6pm"
571
  msgid "Ends at"
572
  msgstr ""
573
 
574
- #: includes/class-custom-post-types.php:444 includes/class-settings.php:443
575
  msgctxt ""
576
  "Brief default description of a scheduling rule when a start time is set but "
577
  "no end time. If the start time is 6pm, it will read: Starts at 6pm"
578
  msgid "Starts at"
579
  msgstr ""
580
 
581
- #: includes/class-custom-post-types.php:445 includes/class-settings.php:444
582
  msgctxt "Separator between times of a scheduling rule"
583
  msgid "&mdash;"
584
  msgstr ""
2
  # This file is distributed under the GNU General Public License v2.0 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Business Profile 1.1.4\n"
6
  "Report-Msgid-Bugs-To: https://themeofthecrop.com\n"
7
+ "POT-Creation-Date: 2017-04-21 14:50:58+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
78
 
79
  #: includes/class-custom-post-types.php:59
80
  #: includes/class-custom-post-types.php:61
81
+ #: includes/class-custom-post-types.php:62 includes/class-settings.php:212
82
+ #: includes/class-settings.php:213
83
  msgid "Locations"
84
  msgstr ""
85
 
104
  msgstr ""
105
 
106
  #: includes/class-custom-post-types.php:68
107
+ msgid "View Locations"
108
  msgstr ""
109
 
110
  #: includes/class-custom-post-types.php:69
111
+ msgid "Search Locations"
112
  msgstr ""
113
 
114
  #: includes/class-custom-post-types.php:70
115
+ msgid "No locations found"
116
  msgstr ""
117
 
118
  #: includes/class-custom-post-types.php:71
119
+ msgid "No locations found in trash"
120
+ msgstr ""
121
+
122
+ #: includes/class-custom-post-types.php:72
123
  msgid "All Locations"
124
  msgstr ""
125
 
126
+ #: includes/class-custom-post-types.php:148 includes/class-settings.php:262
127
  msgid "Schema Type"
128
  msgstr ""
129
 
130
+ #: includes/class-custom-post-types.php:159
131
  msgid "Contact Details"
132
  msgstr ""
133
 
134
+ #: includes/class-custom-post-types.php:169
135
+ #: includes/class-custom-post-types.php:409 includes/class-settings.php:431
136
  #: templates/opening-hours.php:21
137
  msgid "Opening Hours"
138
  msgstr ""
139
 
140
+ #: includes/class-custom-post-types.php:230
141
  msgid "Schema type"
142
  msgstr ""
143
 
144
+ #: includes/class-custom-post-types.php:240 includes/class-settings.php:263
145
  msgid ""
146
  "Select the option that best describes your business to improve how search "
147
  "engines understand your website."
148
  msgstr ""
149
 
150
+ #: includes/class-custom-post-types.php:266
151
+ #: includes/class-custom-post-types.php:290 includes/class-settings.php:328
152
  msgid "No map coordinates set."
153
  msgstr ""
154
 
155
+ #: includes/class-custom-post-types.php:268 includes/class-settings.php:329
156
  msgid "Requesting new coordinates"
157
  msgstr ""
158
 
159
+ #: includes/class-custom-post-types.php:269 includes/class-settings.php:330
160
  msgid "Select a match below"
161
  msgstr ""
162
 
163
+ #: includes/class-custom-post-types.php:270
164
+ #: includes/class-custom-post-types.php:293 includes/class-settings.php:331
165
  msgid "View"
166
  msgstr ""
167
 
168
+ #: includes/class-custom-post-types.php:271 includes/class-settings.php:335
169
  msgid "Error"
170
  msgstr ""
171
 
172
+ #: includes/class-custom-post-types.php:272 includes/class-settings.php:336
173
  msgid ""
174
  "Invalid request. Be sure to fill out the address field before retrieving "
175
  "coordinates."
176
  msgstr ""
177
 
178
+ #: includes/class-custom-post-types.php:273 includes/class-settings.php:337
179
  msgid "Request denied."
180
  msgstr ""
181
 
182
+ #: includes/class-custom-post-types.php:274 includes/class-settings.php:338
183
  msgid "Request denied because you are over your request quota."
184
  msgstr ""
185
 
186
+ #: includes/class-custom-post-types.php:275
187
  msgid "Nothing was found at that address."
188
  msgstr ""
189
 
190
+ #: includes/class-custom-post-types.php:300 includes/class-settings.php:332
191
  msgid "Retrieve map coordinates"
192
  msgstr ""
193
 
194
+ #: includes/class-custom-post-types.php:304 includes/class-settings.php:333
195
  msgid "Remove map coordinates"
196
  msgstr ""
197
 
198
+ #: includes/class-custom-post-types.php:332 includes/class-settings.php:389
199
  msgid "Contact Page"
200
  msgstr ""
201
 
202
+ #: includes/class-custom-post-types.php:346 includes/class-settings.php:408
203
  msgid "Email Address (optional)"
204
  msgstr ""
205
 
206
+ #: includes/class-custom-post-types.php:353
207
  msgid "Phone Number"
208
  msgstr ""
209
 
210
+ #: includes/class-custom-post-types.php:410 includes/class-settings.php:432
211
  msgid "Define your weekly opening hours by adding scheduling rules."
212
  msgstr ""
213
 
214
+ #: includes/class-custom-post-types.php:425 includes/class-settings.php:447
215
  msgid "Add another opening time"
216
  msgstr ""
217
 
218
+ #: includes/class-custom-post-types.php:439 includes/class-settings.php:461
219
  msgid "Delete scheduling rule"
220
  msgstr ""
221
 
223
  msgid "Business Profile"
224
  msgstr ""
225
 
226
+ #: includes/class-settings.php:252
227
  msgid "Search Engine Optimization"
228
  msgstr ""
229
 
230
+ #: includes/class-settings.php:279
231
+ msgid "Image"
232
+ msgstr ""
233
+
234
+ #: includes/class-settings.php:280
235
  msgid ""
236
+ "Google requires you provide an image to display with your local business "
237
+ "search profile."
238
  msgstr ""
239
 
240
+ #: includes/class-settings.php:282
241
+ msgid "Add Image"
242
+ msgstr ""
243
+
244
+ #: includes/class-settings.php:283
245
+ msgid "Change Image"
246
+ msgstr ""
247
+
248
+ #: includes/class-settings.php:284
249
+ msgid "Remove Image"
250
+ msgstr ""
251
+
252
+ #: includes/class-settings.php:297
253
  msgid "Contact Information"
254
  msgstr ""
255
 
256
+ #: includes/class-settings.php:307
257
  msgid "Name"
258
  msgstr ""
259
 
260
+ #: includes/class-settings.php:308
261
  msgid "Enter the name of your business if it is different than the website name."
262
  msgstr ""
263
 
264
+ #: includes/class-settings.php:324
265
  msgid "Address"
266
  msgstr ""
267
 
268
+ #: includes/class-settings.php:334
269
  msgid "Try again?"
270
  msgstr ""
271
 
272
+ #: includes/class-settings.php:339
273
  msgid "Nothing was found at that address"
274
  msgstr ""
275
 
276
+ #: includes/class-settings.php:354
277
  msgid "Google Maps API Key"
278
  msgstr ""
279
 
280
+ #: includes/class-settings.php:356
281
  msgid ""
282
  "Google requires an API key to use their maps. %sGet an API key%s. A full "
283
  "walk-through is available in the %sdocumentiaton%s."
284
  msgstr ""
285
 
286
+ #: includes/class-settings.php:375
287
  msgid "Phone"
288
  msgstr ""
289
 
290
+ #: includes/class-settings.php:390
291
  msgid ""
292
  "Select a page on your site where users can reach you, such as a contact "
293
  "form."
294
  msgstr ""
295
 
296
+ #: includes/class-settings.php:409
297
  msgid ""
298
  "Enter an email address only if you want to display this publicly. Showing "
299
  "your email address on your site may cause you to receive excessive spam."
300
  msgstr ""
301
 
302
+ #: includes/class-settings.php:421
303
  msgid "Schedule"
304
  msgstr ""
305
 
306
+ #: includes/class-settings.php:481 includes/class-settings.php:491
307
  msgid "Multiple Locations"
308
  msgstr ""
309
 
310
+ #: includes/class-settings.php:492
311
  msgid "Enable support for multiple business locations."
312
  msgstr ""
313
 
420
  msgid "Theme of the Crop"
421
  msgstr ""
422
 
423
+ #: includes/class-custom-post-types.php:267
424
+ #: includes/class-custom-post-types.php:292 includes/class-settings.php:327
425
  msgctxt "separates latitude and longitude"
426
  msgid ", "
427
  msgstr ""
428
 
429
+ #: includes/class-custom-post-types.php:302 includes/class-settings.php:326
430
  msgctxt "separator between admin action links in address component"
431
  msgid " | "
432
  msgstr ""
433
 
434
+ #: includes/class-custom-post-types.php:412 includes/class-settings.php:434
435
  msgctxt "Monday abbreviation"
436
  msgid "Mo"
437
  msgstr ""
438
 
439
+ #: includes/class-custom-post-types.php:413 includes/class-settings.php:435
440
  msgctxt "Tuesday abbreviation"
441
  msgid "Tu"
442
  msgstr ""
443
 
444
+ #: includes/class-custom-post-types.php:414 includes/class-settings.php:436
445
  msgctxt "Wednesday abbreviation"
446
  msgid "We"
447
  msgstr ""
448
 
449
+ #: includes/class-custom-post-types.php:415 includes/class-settings.php:437
450
  msgctxt "Thursday abbreviation"
451
  msgid "Th"
452
  msgstr ""
453
 
454
+ #: includes/class-custom-post-types.php:416 includes/class-settings.php:438
455
  msgctxt "Friday abbreviation"
456
  msgid "Fr"
457
  msgstr ""
458
 
459
+ #: includes/class-custom-post-types.php:417 includes/class-settings.php:439
460
  msgctxt "Saturday abbreviation"
461
  msgid "Sa"
462
  msgstr ""
463
 
464
+ #: includes/class-custom-post-types.php:418 includes/class-settings.php:440
465
  msgctxt "Sunday abbreviation"
466
  msgid "Su"
467
  msgstr ""
468
 
469
+ #: includes/class-custom-post-types.php:420 includes/class-settings.php:442
470
  msgctxt ""
471
  "Time format displayed in the opening hours setting panel in your admin "
472
  "area. Must match formatting rules at "
474
  msgid "h:i A"
475
  msgstr ""
476
 
477
+ #: includes/class-custom-post-types.php:421 includes/class-settings.php:443
478
  msgctxt ""
479
  "Date format displayed in the opening hours setting panel in your admin "
480
  "area. Must match formatting rules at "
482
  msgid "mmmm d, yyyy"
483
  msgstr ""
484
 
485
+ #: includes/class-custom-post-types.php:426 includes/class-settings.php:448
486
  msgctxt "Format of a scheduling rule"
487
  msgid "Weekly"
488
  msgstr ""
489
 
490
+ #: includes/class-custom-post-types.php:427 includes/class-settings.php:449
491
  msgctxt "Format of a scheduling rule"
492
  msgid "Monthly"
493
  msgstr ""
494
 
495
+ #: includes/class-custom-post-types.php:428 includes/class-settings.php:450
496
  msgctxt "Format of a scheduling rule"
497
  msgid "Date"
498
  msgstr ""
499
 
500
+ #: includes/class-custom-post-types.php:429 includes/class-settings.php:451
501
  msgctxt "Label for selecting days of the week in a scheduling rule"
502
  msgid "Days of the week"
503
  msgstr ""
504
 
505
+ #: includes/class-custom-post-types.php:430 includes/class-settings.php:452
506
  msgctxt "Label for selecting weeks of the month in a scheduling rule"
507
  msgid "Weeks of the month"
508
  msgstr ""
509
 
510
+ #: includes/class-custom-post-types.php:431 includes/class-settings.php:453
511
  msgctxt "Label to select a date for a scheduling rule"
512
  msgid "Date"
513
  msgstr ""
514
 
515
+ #: includes/class-custom-post-types.php:432 includes/class-settings.php:454
516
  msgctxt "Label to select a time slot for a scheduling rule"
517
  msgid "Time"
518
  msgstr ""
519
 
520
+ #: includes/class-custom-post-types.php:433 includes/class-settings.php:455
521
  msgctxt "Label to set a scheduling rule to last all day"
522
  msgid "All day"
523
  msgstr ""
524
 
525
+ #: includes/class-custom-post-types.php:434 includes/class-settings.php:456
526
  msgctxt "Label for the starting time of a scheduling rule"
527
  msgid "Start"
528
  msgstr ""
529
 
530
+ #: includes/class-custom-post-types.php:435 includes/class-settings.php:457
531
  msgctxt "Label for the ending time of a scheduling rule"
532
  msgid "End"
533
  msgstr ""
534
 
535
+ #: includes/class-custom-post-types.php:436 includes/class-settings.php:458
536
  msgctxt "Prompt displayed when a scheduling rule is set without any time restrictions"
537
  msgid "All day long. Want to %sset a time slot%s?"
538
  msgstr ""
539
 
540
+ #: includes/class-custom-post-types.php:437 includes/class-settings.php:459
541
  msgctxt "Toggle a scheduling rule open and closed"
542
  msgid "Open and close this rule"
543
  msgstr ""
544
 
545
+ #: includes/class-custom-post-types.php:438 includes/class-settings.php:460
546
  msgctxt "Delete a scheduling rule"
547
  msgid "Delete rule"
548
  msgstr ""
549
 
550
+ #: includes/class-custom-post-types.php:440 includes/class-settings.php:462
551
  msgctxt ""
552
  "Brief default description of a scheduling rule when no weekdays or weeks "
553
  "are included in the rule"
554
  msgid "Never"
555
  msgstr ""
556
 
557
+ #: includes/class-custom-post-types.php:441 includes/class-settings.php:463
558
  msgctxt ""
559
  "Brief default description of a scheduling rule when all the weekdays/weeks "
560
  "are included in the rule"
561
  msgid "Every day"
562
  msgstr ""
563
 
564
+ #: includes/class-custom-post-types.php:442 includes/class-settings.php:464
565
  msgctxt ""
566
  "Brief default description of a scheduling rule when some weekdays are "
567
  "included on only some weeks of the month. %s should be left alone and will "
570
  msgid "%s on the %s week of the month"
571
  msgstr ""
572
 
573
+ #: includes/class-custom-post-types.php:443 includes/class-settings.php:465
574
  msgctxt ""
575
  "Brief default description of a scheduling rule when some weeks of the month "
576
  "are included but all or no weekdays are selected. %s should be left alone "
579
  msgid "%s week of the month"
580
  msgstr ""
581
 
582
+ #: includes/class-custom-post-types.php:444 includes/class-settings.php:466
583
  msgctxt "Brief default description of a scheduling rule when no times are set"
584
  msgid "All day"
585
  msgstr ""
586
 
587
+ #: includes/class-custom-post-types.php:445 includes/class-settings.php:467
588
  msgctxt ""
589
  "Brief default description of a scheduling rule when an end time is set but "
590
  "no start time. If the end time is 6pm, it will read: Ends at 6pm"
591
  msgid "Ends at"
592
  msgstr ""
593
 
594
+ #: includes/class-custom-post-types.php:446 includes/class-settings.php:468
595
  msgctxt ""
596
  "Brief default description of a scheduling rule when a start time is set but "
597
  "no end time. If the start time is 6pm, it will read: Starts at 6pm"
598
  msgid "Starts at"
599
  msgstr ""
600
 
601
+ #: includes/class-custom-post-types.php:447 includes/class-settings.php:469
602
  msgctxt "Separator between times of a scheduling rule"
603
  msgid "&mdash;"
604
  msgstr ""
lib/simple-admin-pages/README.md CHANGED
@@ -16,6 +16,7 @@ Settings API into reuseable classes and implements a set of simple controls.
16
 
17
  - Text field
18
  - Textarea field
 
19
  - Toggle (checkbox to enable/disable setting)
20
  - Select dropdown with custom options
21
  - Select dropdown of any post type
@@ -38,7 +39,7 @@ Here's an example of how you can use this library to create an admin page.
38
  require_once( 'path/to/simple-admin-pages/simple-admin-pages.php' );
39
  $sap = sap_initialize_library(
40
  array(
41
- 'version' => '2.0.1', // Version of the library
42
  'lib_url' => PLUGIN_URL . '/lib/simple-admin-pages/', // URL path to sap library
43
  )
44
  );
@@ -127,7 +128,7 @@ The lib_url is used to print stylesheets or scripts attached to the library.
127
  require_once( 'path/to/simple-admin-pages/simple-admin-pages.php' );
128
  $sap = sap_initialize_library(
129
  $args = array(
130
- 'version' => '2.0.1', // Version of the library
131
  'lib_url' => PLUGIN_URL . '/lib/simple-admin-pages/', // URL path to sap library
132
  )
133
  );
@@ -368,6 +369,9 @@ $all_page_settings[ $my_setting_id ];
368
 
369
  ## Changelog
370
 
 
 
 
371
  - 2.0.1 - 2017-03-14
372
  - Allow settings to receive $args passed to add_settings_field
373
 
16
 
17
  - Text field
18
  - Textarea field
19
+ - Image field
20
  - Toggle (checkbox to enable/disable setting)
21
  - Select dropdown with custom options
22
  - Select dropdown of any post type
39
  require_once( 'path/to/simple-admin-pages/simple-admin-pages.php' );
40
  $sap = sap_initialize_library(
41
  array(
42
+ 'version' => '2.1.0', // Version of the library
43
  'lib_url' => PLUGIN_URL . '/lib/simple-admin-pages/', // URL path to sap library
44
  )
45
  );
128
  require_once( 'path/to/simple-admin-pages/simple-admin-pages.php' );
129
  $sap = sap_initialize_library(
130
  $args = array(
131
+ 'version' => '2.1.0', // Version of the library
132
  'lib_url' => PLUGIN_URL . '/lib/simple-admin-pages/', // URL path to sap library
133
  )
134
  );
369
 
370
  ## Changelog
371
 
372
+ - 2.1 - 2017-04-21
373
+ - Add an Image setting type
374
+
375
  - 2.0.1 - 2017-03-14
376
  - Allow settings to receive $args passed to add_settings_field
377
 
lib/simple-admin-pages/classes/AdminPage.Menu.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageMenu_2_0_1 extends sapAdminPage_2_0_1 {
12
 
13
  public $setup_function = 'add_menu_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageMenu_2_1_0 extends sapAdminPage_2_1_0 {
12
 
13
  public $setup_function = 'add_menu_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.Submenu.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageSubmenu_2_0_1 extends sapAdminPage_2_0_1 {
12
 
13
  public $setup_function = 'add_submenu_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageSubmenu_2_1_0 extends sapAdminPage_2_1_0 {
12
 
13
  public $setup_function = 'add_submenu_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.Themes.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageThemes_2_0_1 extends sapAdminPage_2_0_1 {
12
 
13
  public $setup_function = 'add_theme_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageThemes_2_1_0 extends sapAdminPage_2_1_0 {
12
 
13
  public $setup_function = 'add_theme_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPage_2_0_1 {
11
 
12
  public $title;
13
  public $menu_title;
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPage_2_1_0 {
11
 
12
  public $title;
13
  public $menu_title;
lib/simple-admin-pages/classes/AdminPageSection.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSection_2_0_1 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSection_2_1_0 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingAddress_2_0_1 extends sapAdminPageSetting_2_0_1 {
11
 
12
  /*
13
  * Size of this textarea
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingAddress_2_1_0 extends sapAdminPageSetting_2_1_0 {
11
 
12
  /*
13
  * Size of this textarea
lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingEditor_2_0_1 extends sapAdminPageSetting_2_0_1 {
11
 
12
  public $sanitize_callback = 'wp_kses_post';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingEditor_2_1_0 extends sapAdminPageSetting_2_1_0 {
11
 
12
  public $sanitize_callback = 'wp_kses_post';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php CHANGED
@@ -6,7 +6,7 @@
6
  * This allows you to easily add in a dummy "setting" with any arbitrary HTML
7
  * code. It's good for displaying a link to documentation, upgrades or anything
8
  * else you can think of.
9
- *
10
  * Data in this field will not be saved or passed. It's purely for presenting
11
  * information.
12
  *
@@ -14,7 +14,7 @@
14
  * @package Simple Admin Pages
15
  */
16
 
17
- class sapAdminPageSettingHTML_2_0_1 extends sapAdminPageSetting_2_0_1 {
18
 
19
  public $sanitize_callback = 'sanitize_text_field';
20
 
@@ -23,11 +23,11 @@ class sapAdminPageSettingHTML_2_0_1 extends sapAdminPageSetting_2_0_1 {
23
  * @since 1.0
24
  */
25
  public function display_setting() {
26
-
27
  echo $this->html;
28
-
29
  $this->display_description();
30
-
31
  }
32
 
33
  }
6
  * This allows you to easily add in a dummy "setting" with any arbitrary HTML
7
  * code. It's good for displaying a link to documentation, upgrades or anything
8
  * else you can think of.
9
+ *
10
  * Data in this field will not be saved or passed. It's purely for presenting
11
  * information.
12
  *
14
  * @package Simple Admin Pages
15
  */
16
 
17
+ class sapAdminPageSettingHTML_2_1_0 extends sapAdminPageSetting_2_1_0 {
18
 
19
  public $sanitize_callback = 'sanitize_text_field';
20
 
23
  * @since 1.0
24
  */
25
  public function display_setting() {
26
+
27
  echo $this->html;
28
+
29
  $this->display_description();
30
+
31
  }
32
 
33
  }
lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Register, display and save an image field setting in the admin menu
5
+ *
6
+ * @since 1.0
7
+ * @package Simple Admin Pages
8
+ */
9
+
10
+ class sapAdminPageSettingImage_2_1_0 extends sapAdminPageSetting_2_1_0 {
11
+
12
+ public $sanitize_callback = 'absint';
13
+
14
+ /**
15
+ * Scripts that must be loaded for this component
16
+ * @since 2.1.0
17
+ */
18
+ public $scripts = array(
19
+ 'sap-image' => array(
20
+ 'path' => 'js/image.js',
21
+ 'dependencies' => array( 'jquery' ),
22
+ 'version' => '2.1.0',
23
+ 'footer' => true,
24
+ ),
25
+ );
26
+
27
+ /**
28
+ * Translateable strings required for this component
29
+ * @since 2.1.0
30
+ */
31
+ public $strings = array(
32
+ 'add_image' => null, // __( 'Add Image', 'textdomain' ),
33
+ 'change_image' => null, // __( 'Change Image', 'textdomain' ),
34
+ 'remove_image' => null, // __( 'Remove Image', 'textdomain' ),
35
+ );
36
+
37
+ /**
38
+ * Display this setting
39
+ * @since 1.0
40
+ */
41
+ public function display_setting() {
42
+ $image_url = $this->value ? wp_get_attachment_url( $this->value ) : '';
43
+ ?>
44
+
45
+ <div class="sap-image-wrapper <?php echo $this->value ? 'sap-image-wrapper-has-image' : 'sap-image-wrapper-no-image'; ?>" data-id="sap-<?php echo $this->id; ?>">
46
+ <input name="<?php echo $this->get_input_name(); ?>" type="hidden" id="sap-<?php echo $this->id; ?>" value="<?php echo $this->value; ?>">
47
+ <img src="<?php echo esc_attr( $image_url ); ?>">
48
+ <button class="button sap-image-btn-add" id="sap-<?php echo $this->id; ?>-add"><?php echo esc_html( $this->strings['add_image'] ); ?></button>
49
+ <button class="button sap-image-btn-change" id="sap-<?php echo $this->id; ?>-change"><?php echo esc_html( $this->strings['change_image'] ); ?></button>
50
+ <button class="button sap-image-btn-remove" id="sap-<?php echo $this->id; ?>-remove"><?php echo esc_html( $this->strings['remove_image'] ); ?></button>
51
+ </div>
52
+
53
+ <?php
54
+
55
+ // global $wp_scripts;
56
+ // print_r( $wp_scripts );
57
+
58
+ $this->display_description();
59
+
60
+ }
61
+
62
+ }
lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php CHANGED
@@ -25,7 +25,7 @@
25
  * @package Simple Admin Pages
26
  */
27
 
28
- class sapAdminPageSettingOpeningHours_2_0_1 extends sapAdminPageSetting_2_0_1 {
29
 
30
  public $sanitize_callback = 'sanitize_text_field';
31
 
25
  * @package Simple Admin Pages
26
  */
27
 
28
+ class sapAdminPageSettingOpeningHours_2_1_0 extends sapAdminPageSetting_2_1_0 {
29
 
30
  public $sanitize_callback = 'sanitize_text_field';
31
 
lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php CHANGED
@@ -10,7 +10,7 @@
10
  * @package Simple Admin Pages
11
  */
12
 
13
- class sapAdminPageSettingScheduler_2_0_1 extends sapAdminPageSetting_2_0_1 {
14
 
15
  public $sanitize_callback = 'sanitize_text_field';
16
 
10
  * @package Simple Admin Pages
11
  */
12
 
13
+ class sapAdminPageSettingScheduler_2_1_0 extends sapAdminPageSetting_2_1_0 {
14
 
15
  public $sanitize_callback = 'sanitize_text_field';
16
 
lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php CHANGED
@@ -21,7 +21,7 @@
21
  * @package Simple Admin Pages
22
  */
23
 
24
- class sapAdminPageSettingSelect_2_0_1 extends sapAdminPageSetting_2_0_1 {
25
 
26
  public $sanitize_callback = 'sanitize_text_field';
27
 
21
  * @package Simple Admin Pages
22
  */
23
 
24
+ class sapAdminPageSettingSelect_2_1_0 extends sapAdminPageSetting_2_1_0 {
25
 
26
  public $sanitize_callback = 'sanitize_text_field';
27
 
lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingSelectPost_2_0_1 extends sapAdminPageSetting_2_0_1 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingSelectPost_2_1_0 extends sapAdminPageSetting_2_1_0 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php CHANGED
@@ -19,7 +19,7 @@
19
  * @package Simple Admin Pages
20
  */
21
 
22
- class sapAdminPageSettingSelectTaxonomy_2_0_1 extends sapAdminPageSetting_2_0_1 {
23
 
24
  public $sanitize_callback = 'intval';
25
 
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingSelectTaxonomy_2_1_0 extends sapAdminPageSetting_2_1_0 {
23
 
24
  public $sanitize_callback = 'intval';
25
 
lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingText_2_0_1 extends sapAdminPageSetting_2_0_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingText_2_1_0 extends sapAdminPageSetting_2_1_0 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php CHANGED
@@ -9,7 +9,7 @@
9
  * @todo textareas should have an option to swap new lines for <br>s
10
  */
11
 
12
- class sapAdminPageSettingTextarea_2_0_1 extends sapAdminPageSetting_2_0_1 {
13
 
14
  /*
15
  * Size of this textarea
9
  * @todo textareas should have an option to swap new lines for <br>s
10
  */
11
 
12
+ class sapAdminPageSettingTextarea_2_1_0 extends sapAdminPageSetting_2_1_0 {
13
 
14
  /*
15
  * Size of this textarea
lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingToggle_2_0_1 extends sapAdminPageSetting_2_0_1 {
21
 
22
  public $sanitize_callback = 'sanitize_text_field';
23
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingToggle_2_1_0 extends sapAdminPageSetting_2_1_0 {
21
 
22
  public $sanitize_callback = 'sanitize_text_field';
23
 
lib/simple-admin-pages/classes/AdminPageSetting.class.php CHANGED
@@ -16,7 +16,7 @@
16
  * @package Simple Admin Pages
17
  */
18
 
19
- abstract class sapAdminPageSetting_2_0_1 {
20
 
21
  // Page defaults
22
  public $id; // used in form fields and database to track and store setting
16
  * @package Simple Admin Pages
17
  */
18
 
19
+ abstract class sapAdminPageSetting_2_1_0 {
20
 
21
  // Page defaults
22
  public $id; // used in form fields and database to track and store setting
lib/simple-admin-pages/classes/Library.class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- if ( !class_exists( 'sapLibrary_2_0_1' ) ) {
3
  /**
4
  * This library class loads and provides access to the correct version of the
5
  * Simple Admin Pages library.
@@ -7,10 +7,10 @@ if ( !class_exists( 'sapLibrary_2_0_1' ) ) {
7
  * @since 1.0
8
  * @package Simple Admin Pages
9
  */
10
- class sapLibrary_2_0_1 {
11
 
12
  // Version of the library
13
- private $version = '2.0.1';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
@@ -137,6 +137,10 @@ class sapLibrary_2_0_1 {
137
  require_once('AdminPageSetting.Toggle.class.php');
138
  return $this->get_versioned_classname( 'sapAdminPageSettingToggle' );
139
 
 
 
 
 
140
  case 'post' :
141
  require_once('AdminPageSetting.SelectPost.class.php');
142
  return $this->get_versioned_classname( 'sapAdminPageSettingSelectPost' );
@@ -389,6 +393,7 @@ class sapLibrary_2_0_1 {
389
  // Only enqueue assets for the current page
390
  if ( strpos( $screen->base, $page_id ) !== false ) {
391
  wp_enqueue_style( 'sap-admin-style-' . $this->version, $this->lib_url . 'css/admin.css' );
 
392
 
393
  foreach ( $page->sections as $section ) {
394
  foreach ( $section->settings as $setting ) {
1
  <?php
2
+ if ( !class_exists( 'sapLibrary_2_1_0' ) ) {
3
  /**
4
  * This library class loads and provides access to the correct version of the
5
  * Simple Admin Pages library.
7
  * @since 1.0
8
  * @package Simple Admin Pages
9
  */
10
+ class sapLibrary_2_1_0 {
11
 
12
  // Version of the library
13
+ private $version = '2.1.0';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
137
  require_once('AdminPageSetting.Toggle.class.php');
138
  return $this->get_versioned_classname( 'sapAdminPageSettingToggle' );
139
 
140
+ case 'image' :
141
+ require_once('AdminPageSetting.Image.class.php');
142
+ return $this->get_versioned_classname( 'sapAdminPageSettingImage' );
143
+
144
  case 'post' :
145
  require_once('AdminPageSetting.SelectPost.class.php');
146
  return $this->get_versioned_classname( 'sapAdminPageSettingSelectPost' );
393
  // Only enqueue assets for the current page
394
  if ( strpos( $screen->base, $page_id ) !== false ) {
395
  wp_enqueue_style( 'sap-admin-style-' . $this->version, $this->lib_url . 'css/admin.css' );
396
+ wp_enqueue_media();
397
 
398
  foreach ( $page->sections as $section ) {
399
  foreach ( $section->settings as $setting ) {
lib/simple-admin-pages/css/admin.css CHANGED
@@ -30,6 +30,25 @@ textarea.large-text {
30
  height: 30em;
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /*
34
  * Opening Hours
35
  */
30
  height: 30em;
31
  }
32
 
33
+ /**
34
+ * Image
35
+ */
36
+ .sap-image-wrapper img {
37
+ display: block;
38
+ width: 100%;
39
+ height: auto;
40
+ max-width: 500px;
41
+ margin-bottom: 1em;
42
+ }
43
+ .sap-image-wrapper-no-image .sap-image-btn-change,
44
+ .sap-image-wrapper-no-image .sap-image-btn-remove,
45
+ .sap-image-wrapper-no-image img {
46
+ display: none;
47
+ }
48
+ .sap-image-wrapper-has-image .sap-image-btn-add {
49
+ display: none;
50
+ }
51
+
52
  /*
53
  * Opening Hours
54
  */
lib/simple-admin-pages/js/image.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Javascript functions for Image component
3
+ *
4
+ * @package Simple Admin Pages
5
+ */
6
+
7
+ jQuery(document).ready(function ($) {
8
+
9
+ var current_setting_id;
10
+
11
+ function openMediaManager(e) {
12
+ e.stopPropagation();
13
+ e.preventDefault();
14
+ current_setting_id = $( this ).parents( '.sap-image-wrapper' ).data( 'id' );
15
+ wp.media.frames.bpfwp_frame.open();
16
+ }
17
+
18
+ function setImage( setting_id, image_id, image_url ) {
19
+ var $control = $( '.sap-image-wrapper[data-id="' + setting_id + '"]' );
20
+ $control.find( 'img' ).attr( 'src', image_url );
21
+ $control.find( '#' + setting_id ).val( image_id );
22
+ $control.removeClass( 'sap-image-wrapper-no-image' ).addClass( 'sap-image-wrapper-has-image' );
23
+ }
24
+
25
+ function removeImage(e) {
26
+ e.stopPropagation();
27
+ e.preventDefault();
28
+ var $control = $( this ).parents( '.sap-image-wrapper' );
29
+ $control.find( 'img' ).attr( 'src', '' );
30
+ $control.find( '#' + $control.data( 'id' ) ).val( '' );
31
+ $control.removeClass( 'sap-image-wrapper-has-image' ).addClass( 'sap-image-wrapper-no-image' );
32
+ }
33
+
34
+ wp.media.frames.bpfwp_frame = wp.media( {
35
+ title: 'Select image',
36
+ multiple: false,
37
+ library: {
38
+ type: 'image',
39
+ },
40
+ button: {
41
+ text: 'Use selected image',
42
+ },
43
+ } );
44
+
45
+ wp.media.frames.bpfwp_frame.on( 'select', function() {
46
+ var image = wp.media.frames.bpfwp_frame.state().get( 'selection' ).first().toJSON();
47
+ setImage( current_setting_id, image.id, image.url );
48
+ });
49
+
50
+ $( '.sap-image-wrapper .sap-image-btn-add, .sap-image-wrapper .sap-image-btn-change' ).click(openMediaManager);
51
+
52
+ $( '.sap-image-wrapper .sap-image-btn-remove' ).click(removeImage);
53
+ });
package.json CHANGED
@@ -1,13 +1,14 @@
1
  {
2
  "name": "business-profile",
3
  "description": "Contact information, Google Maps and opening hours made easy for businesses.",
4
- "version": "1.1.3",
5
  "author": {
6
  "name": "Theme of the Crop",
7
  "url": "https://themeofthecrop.com"
8
  },
9
  "devDependencies": {
10
  "grunt": "~1.0.0",
 
11
  "grunt-contrib-jshint": "~1.0.0",
12
  "grunt-contrib-watch": "~1.0.0",
13
  "grunt-wp-i18n": "~0.5.4"
1
  {
2
  "name": "business-profile",
3
  "description": "Contact information, Google Maps and opening hours made easy for businesses.",
4
+ "version": "1.1.4",
5
  "author": {
6
  "name": "Theme of the Crop",
7
  "url": "https://themeofthecrop.com"
8
  },
9
  "devDependencies": {
10
  "grunt": "~1.0.0",
11
+ "grunt-contrib-compress": "~1.4.1",
12
  "grunt-contrib-jshint": "~1.0.0",
13
  "grunt-contrib-watch": "~1.0.0",
14
  "grunt-wp-i18n": "~0.5.4"
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: NateWr, fatmedia
3
  Author URI: https://github.com/NateWr
4
  Plugin URL: http://themeofthecrop.com
5
  Requires at Least: 4.4
6
- Tested Up To: 4.7.3
7
  Tags: business profile, seo, local seo, schema, address, google map, contact, phone
8
- Stable tag: 1.1.3
9
  License: GPLv2 or later
10
  Donate link: http://themeofthecrop.com
11
 
@@ -85,6 +85,9 @@ You'll find more help in the [User Guide](http://doc.themeofthecrop.com/plugins/
85
 
86
  == Changelog ==
87
 
 
 
 
88
  = 1.1.3 (2017-03-21) =
89
  * Fix: Fatal error with location schedule metabox
90
 
@@ -155,6 +158,9 @@ You'll find more help in the [User Guide](http://doc.themeofthecrop.com/plugins/
155
 
156
  == Upgrade Notice ==
157
 
 
 
 
158
  = 1.1.3 =
159
  This update fixes a critical bug when trying to add or edit a location's opening hours.
160
 
3
  Author URI: https://github.com/NateWr
4
  Plugin URL: http://themeofthecrop.com
5
  Requires at Least: 4.4
6
+ Tested Up To: 4.8
7
  Tags: business profile, seo, local seo, schema, address, google map, contact, phone
8
+ Stable tag: 1.1.4
9
  License: GPLv2 or later
10
  Donate link: http://themeofthecrop.com
11
 
85
 
86
  == Changelog ==
87
 
88
+ = 1.1.4 (2017-04-21) =
89
+ * Add: business image to comply with Google requirements
90
+
91
  = 1.1.3 (2017-03-21) =
92
  * Fix: Fatal error with location schedule metabox
93
 
158
 
159
  == Upgrade Notice ==
160
 
161
+ = 1.1.4 =
162
+ This update adds a new image setting, which Google now requires for local businesses. You're strongly encouraged to add an image for your business.
163
+
164
  = 1.1.3 =
165
  This update fixes a critical bug when trying to add or edit a location's opening hours.
166
 
templates/contact-card.php CHANGED
@@ -96,5 +96,8 @@
96
  ?>
97
 
98
  <address class="bp-contact-card" itemscope itemtype="http://schema.org/<?php echo bpfwp_setting( 'schema-type', bpfwp_get_display( 'location' ) ); ?>">
 
 
 
99
  <?php foreach ( $data as $data => $callback ) { call_user_func( $callback, bpfwp_get_display( 'location' ) ); } ?>
100
  </address>
96
  ?>
97
 
98
  <address class="bp-contact-card" itemscope itemtype="http://schema.org/<?php echo bpfwp_setting( 'schema-type', bpfwp_get_display( 'location' ) ); ?>">
99
+ <?php if ( bpfwp_setting( 'image', bpfwp_get_display( 'location' ) ) ) : ?>
100
+ <meta itemprop="image" content="<?php echo esc_url( wp_get_attachment_url( bpfwp_setting( 'image', bpfwp_get_display( 'location' ) ) ) ); ?>">
101
+ <?php endif; ?>
102
  <?php foreach ( $data as $data => $callback ) { call_user_func( $callback, bpfwp_get_display( 'location' ) ); } ?>
103
  </address>