Business Directory Plugin - Version 4.0.4

Version Description

Download this release

Release Info

Developer businessdirectoryplugin
Plugin Icon 128x128 Business Directory Plugin
Version 4.0.4
Comparing to
See all releases

Code changes from version 4.0.3 to 4.0.4

README.TXT CHANGED
@@ -4,8 +4,8 @@ Donate link: http://businessdirectoryplugin.com/premium-modules/
4
  Tags: address book, business directory, chamber of commerce business directory, church directory, company business directory, contact directory, custom business directory, directory, listings directory, local business directory, link directory, member directory, staff directory, directory plugin
5
  Requires at least: 4.1
6
  Tested up to: 4.5
7
- Last Updated: 2016-May-27
8
- Stable tag: tags/4.0.3
9
  License: GPLv2 or later
10
 
11
  Build any kind of local directory, directory of business providers, a Yellow-Pages business directory, Yelp-like review directory and much more!
@@ -130,6 +130,15 @@ If you are having problems please visit [support forum](http://www.businessdirec
130
 
131
  == Changelog ==
132
 
 
 
 
 
 
 
 
 
 
133
  = Version 4.0.3 =
134
  * Restore WPBUSDIRMANMANAGELISTING as a valid "Manage Listings" shortcode.
135
  * Prevent view classes from being loaded more than one to prevent PHP strict errors.
4
  Tags: address book, business directory, chamber of commerce business directory, church directory, company business directory, contact directory, custom business directory, directory, listings directory, local business directory, link directory, member directory, staff directory, directory plugin
5
  Requires at least: 4.1
6
  Tested up to: 4.5
7
+ Last Updated: 2016-May-31
8
+ Stable tag: tags/4.0.4
9
  License: GPLv2 or later
10
 
11
  Build any kind of local directory, directory of business providers, a Yellow-Pages business directory, Yelp-like review directory and much more!
130
 
131
  == Changelog ==
132
 
133
+ = Version 4.0.4 =
134
+ * Add compatibility mode that disables CPT integration for setups having issues or theme conflicts.
135
+ * Try single and singular templates along with page.php for improved theme compatibility.
136
+ * Add compatibility layer for themes.
137
+ * Genesis theme compatibility fixes.
138
+ * HMTPro5 theme compatibility fixes.
139
+ * Customizr and Customizr-Pro theme compatibility fixes.
140
+ * Prevent duplication of CSV labels for fields.
141
+
142
  = Version 4.0.3 =
143
  * Restore WPBUSDIRMANMANAGELISTING as a valid "Manage Listings" shortcode.
144
  * Prevent view classes from being loaded more than one to prevent PHP strict errors.
business-directory-plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Business Directory Plugin
4
  * Plugin URI: http://www.businessdirectoryplugin.com
5
  * Description: Provides the ability to maintain a free or paid business directory on your WordPress powered site.
6
- * Version: 4.0.3
7
  * Author: D. Rodenbaugh
8
  * Author URI: http://businessdirectoryplugin.com
9
  * Text Domain: WPBDM
@@ -31,7 +31,7 @@
31
  if( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) )
32
  exit();
33
 
34
- define( 'WPBDP_VERSION', '4.0.3' );
35
 
36
  define( 'WPBDP_PATH', plugin_dir_path( __FILE__ ) );
37
  define( 'WPBDP_URL', trailingslashit( plugins_url( '/', __FILE__ ) ) );
@@ -117,8 +117,6 @@ class WPBDP_Plugin {
117
  }
118
 
119
  function init() {
120
- $this->compat = new WPBDP_Compat();
121
-
122
  // Register cache groups.
123
  wp_cache_add_non_persistent_groups( array( 'wpbdp pages', 'wpbdp formfields', 'wpbdp fees', 'wpbdp submit state', 'wpbdp' ) );
124
 
@@ -157,6 +155,7 @@ class WPBDP_Plugin {
157
  $this->payments = new WPBDP_PaymentsAPI();
158
  $this->listings = new WPBDP_Listings_API();
159
  $this->shortcodes = new WPBDP__Shortcodes();
 
160
 
161
  $this->_register_image_sizes();
162
 
@@ -300,6 +299,7 @@ class WPBDP_Plugin {
300
 
301
  $rewrite_base = str_replace( 'index.php/', '', rtrim( str_replace( $home_url . '/', '', $page_link ), '/' ) );
302
 
 
303
  $category_slug = urlencode( wpbdp_get_option( 'permalinks-category-slug' ) );
304
  $tags_slug = urlencode( wpbdp_get_option( 'permalinks-tags-slug' ) );
305
 
@@ -309,22 +309,30 @@ class WPBDP_Plugin {
309
  $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?wpbdp_category=$matches[2]&paged=$matches[3]';
310
  $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/?$'] = 'index.php?wpbdp_category=$matches[2]';
311
  } else {
312
- $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?page_id=' . $page_id . '&category=$matches[2]&paged=$matches[3]';
313
- $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/?$'] = 'index.php?page_id=' . $page_id . '&category=$matches[2]';
314
  }
315
 
316
- $rules['(' . $rewrite_base . ')/' . $tags_slug . '/(.+?)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?' . WPBDP_TAGS_TAX . '=$matches[2]&paged=$matches[3]';
317
- $rules['(' . $rewrite_base . ')/' . $tags_slug . '/(.+?)$'] = 'index.php?' . WPBDP_TAGS_TAX . '=$matches[2]';
 
 
 
 
 
318
 
319
  if ( wpbdp_get_option( 'permalinks-no-id' ) ) {
320
  if ( ! wpbdp_get_option( 'disable-cpt' ) ) {
321
  $rules['(' . $rewrite_base . ')/(.*)/?$'] = 'index.php?' . WPBDP_POST_TYPE . '=$matches[2]';
322
  } else {
323
- // TODO: how to do this when CPT is disabled?
324
- // $rules['(' . $rewrite_base . ')/(.*)/?$'] = 'index.php?page_id=' . $page_id . '&wpbdp_view=show_listing&listing_id=$matches[2]';
325
  }
326
  } else {
327
- $rules['(' . $rewrite_base . ')/([0-9]{1,})/?(.*)/?$'] = 'index.php?p=$matches[2]&post_type=' . WPBDP_POST_TYPE; // FIXME: post_type shouldn't be required. Fix Query_Integration too.
 
 
 
 
328
  }
329
  }
330
  }
@@ -372,6 +380,12 @@ class WPBDP_Plugin {
372
  array_push( $vars, 'region' );
373
  array_push( $vars, 'wpbdp_view' );
374
 
 
 
 
 
 
 
375
  return $vars;
376
  }
377
 
3
  * Plugin Name: Business Directory Plugin
4
  * Plugin URI: http://www.businessdirectoryplugin.com
5
  * Description: Provides the ability to maintain a free or paid business directory on your WordPress powered site.
6
+ * Version: 4.0.4
7
  * Author: D. Rodenbaugh
8
  * Author URI: http://businessdirectoryplugin.com
9
  * Text Domain: WPBDM
31
  if( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) )
32
  exit();
33
 
34
+ define( 'WPBDP_VERSION', '4.0.4' );
35
 
36
  define( 'WPBDP_PATH', plugin_dir_path( __FILE__ ) );
37
  define( 'WPBDP_URL', trailingslashit( plugins_url( '/', __FILE__ ) ) );
117
  }
118
 
119
  function init() {
 
 
120
  // Register cache groups.
121
  wp_cache_add_non_persistent_groups( array( 'wpbdp pages', 'wpbdp formfields', 'wpbdp fees', 'wpbdp submit state', 'wpbdp' ) );
122
 
155
  $this->payments = new WPBDP_PaymentsAPI();
156
  $this->listings = new WPBDP_Listings_API();
157
  $this->shortcodes = new WPBDP__Shortcodes();
158
+ $this->compat = new WPBDP_Compat();
159
 
160
  $this->_register_image_sizes();
161
 
299
 
300
  $rewrite_base = str_replace( 'index.php/', '', rtrim( str_replace( $home_url . '/', '', $page_link ), '/' ) );
301
 
302
+ $dir_slug = urlencode( wpbdp_get_option( 'permalinks-directory-slug' ) );
303
  $category_slug = urlencode( wpbdp_get_option( 'permalinks-category-slug' ) );
304
  $tags_slug = urlencode( wpbdp_get_option( 'permalinks-tags-slug' ) );
305
 
309
  $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?wpbdp_category=$matches[2]&paged=$matches[3]';
310
  $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/?$'] = 'index.php?wpbdp_category=$matches[2]';
311
  } else {
312
+ $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?page_id=' . $page_id . '&_' . $category_slug . '=$matches[2]&paged=$matches[3]';
313
+ $rules['(' . $rewrite_base . ')/' . $category_slug . '/(.+?)/?$'] = 'index.php?page_id=' . $page_id . '&_' . $category_slug . '=$matches[2]';
314
  }
315
 
316
+ if ( ! wpbdp_get_option( 'disable-cpt') ) {
317
+ $rules['(' . $rewrite_base . ')/' . $tags_slug . '/(.+?)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?' . WPBDP_TAGS_TAX . '=$matches[2]&paged=$matches[3]';
318
+ $rules['(' . $rewrite_base . ')/' . $tags_slug . '/(.+?)$'] = 'index.php?' . WPBDP_TAGS_TAX . '=$matches[2]';
319
+ } else {
320
+ $rules['(' . $rewrite_base . ')/' . $tags_slug . '/(.+?)/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?page_id=' .$page_id .'&_' . $tags_slug . '=$matches[2]&paged=$matches[3]';
321
+ $rules['(' . $rewrite_base . ')/' . $tags_slug . '/(.+?)$'] = 'index.php?page_id=' . $page_id . '&_' . $tags_slug . '=$matches[2]';
322
+ }
323
 
324
  if ( wpbdp_get_option( 'permalinks-no-id' ) ) {
325
  if ( ! wpbdp_get_option( 'disable-cpt' ) ) {
326
  $rules['(' . $rewrite_base . ')/(.*)/?$'] = 'index.php?' . WPBDP_POST_TYPE . '=$matches[2]';
327
  } else {
328
+ $rules['(' . $rewrite_base . ')/(.*)/?$'] = 'index.php?page_id=' . $page_id . '&_' . $dir_slug . '=$matches[2]';
 
329
  }
330
  } else {
331
+ if ( ! wpbdp_get_option( 'disable-cpt' ) ) {
332
+ $rules['(' . $rewrite_base . ')/([0-9]{1,})/?(.*)/?$'] = 'index.php?p=$matches[2]&post_type=' . WPBDP_POST_TYPE; // FIXME: post_type shouldn't be required. Fix Query_Integration too.
333
+ } else {
334
+ $rules['(' . $rewrite_base . ')/([0-9]{1,})/?(.*)/?$'] = 'index.php?page_id=' . $page_id . '&_' . $dir_slug . '=$matches[2]';
335
+ }
336
  }
337
  }
338
  }
380
  array_push( $vars, 'region' );
381
  array_push( $vars, 'wpbdp_view' );
382
 
383
+ if ( wpbdp_get_option( 'disable-cpt' ) ) {
384
+ array_push( $vars, '_' . wpbdp_get_option( 'permalinks-directory-slug' ) );
385
+ array_push( $vars, '_' . wpbdp_get_option( 'permalinks-category-slug' ) );
386
+ array_push( $vars, '_' . wpbdp_get_option( 'permalinks-tags-slug' ) );
387
+ }
388
+
389
  return $vars;
390
  }
391
 
core/class-dispatcher.php CHANGED
@@ -49,7 +49,9 @@ class WPBDP__Dispatcher {
49
  return $template;
50
  }
51
 
 
52
  $res = $this->current_view_obj->dispatch();
 
53
 
54
  if ( is_string( $res ) )
55
  $this->output = $res;
49
  return $template;
50
  }
51
 
52
+ do_action( 'wpbdp_before_dispatch' );
53
  $res = $this->current_view_obj->dispatch();
54
+ do_action( 'wpbdp_after_dispatch' );
55
 
56
  if ( is_string( $res ) )
57
  $this->output = $res;
core/class-form-field.php CHANGED
@@ -141,6 +141,7 @@ class WPBDP_Form_Field {
141
  if ( $this->shortname )
142
  return $this->shortname;
143
 
 
144
  if ( ! $this->label ) {
145
  $this->shortname = 'field_' . $this->id;
146
  } else {
@@ -160,6 +161,39 @@ class WPBDP_Form_Field {
160
  return $shortname;
161
  }
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  public function get_short_name() {
164
  return $this->get_shortname();
165
  }
@@ -501,8 +535,8 @@ class WPBDP_Form_Field {
501
 
502
  $data = array();
503
 
504
- $data['shortname'] = $this->get_shortname();
505
  $data['label'] = $this->label;
 
506
  $data['description'] = trim( $this->description );
507
  $data['field_type'] = $this->type->get_id();
508
  $data['association'] = $this->association;
141
  if ( $this->shortname )
142
  return $this->shortname;
143
 
144
+ // $name = $name . '-' . $field->get_id();
145
  if ( ! $this->label ) {
146
  $this->shortname = 'field_' . $this->id;
147
  } else {
161
  return $shortname;
162
  }
163
 
164
+ /**
165
+ * @since 4.0.4
166
+ */
167
+ public function shortname_noconflict( $shortname ) {
168
+ global $wpdb;
169
+
170
+ $in_use = false;
171
+
172
+ if ( ! $this->id )
173
+ $in_use = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT 1 AS x FROM {$wpdb->prefix}wpbdp_form_fields WHERE shortname = %s LIMIT 1", $shortname ) );
174
+ else
175
+ $in_use = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT 1 AS x FROM {$wpdb->prefix}wpbdp_form_fields WHERE shortname = %s AND id != %d LIMIT 1", $shortname, $this->id ) );
176
+
177
+ if ( ! $in_use )
178
+ return $shortname;
179
+
180
+ $n = 1;
181
+
182
+ // Find an alternative name.
183
+ while ( true ) {
184
+ $check = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT 1 AS x FROM {$wpdb->prefix}wpbdp_form_fields WHERE shortname = %s LIMIT 1", $shortname . '_' . $n ) );
185
+
186
+ if ( ! $check ) {
187
+ $shortname = $shortname . '_' . $n;
188
+ break;
189
+ }
190
+
191
+ $n++;
192
+ }
193
+
194
+ return $shortname;
195
+ }
196
+
197
  public function get_short_name() {
198
  return $this->get_shortname();
199
  }
535
 
536
  $data = array();
537
 
 
538
  $data['label'] = $this->label;
539
+ $data['shortname'] = $this->shortname_noconflict( $this->get_shortname() );
540
  $data['description'] = trim( $this->description );
541
  $data['field_type'] = $this->type->get_id();
542
  $data['association'] = $this->association;
core/class-listings-api.php CHANGED
@@ -37,8 +37,12 @@ class WPBDP_Listings_API {
37
  if ( WPBDP_CATEGORY_TAX != $taxonomy )
38
  return $link;
39
 
40
- if ( ! wpbdp_rewrite_on() )
 
 
 
41
  return $link;
 
42
 
43
  $link = wpbdp_url( sprintf( '/%s/%s/', wpbdp_get_option( 'permalinks-category-slug' ), $category->slug ) );
44
 
@@ -49,8 +53,12 @@ class WPBDP_Listings_API {
49
  if ( WPBDP_TAGS_TAX != $taxonomy )
50
  return $link;
51
 
52
- if ( ! wpbdp_rewrite_on() )
 
 
 
53
  return $link;
 
54
 
55
  $link = wpbdp_url( sprintf( '/%s/%s/', wpbdp_get_option( 'permalinks-tags-slug' ), $tag->slug ) );
56
 
@@ -61,23 +69,26 @@ class WPBDP_Listings_API {
61
  if ( WPBDP_POST_TYPE != get_post_type( $post ) )
62
  return $link;
63
 
64
- if ( ! wpbdp_rewrite_on() )
65
- return $link;
66
-
67
  if ( $querystring = parse_url( $link, PHP_URL_QUERY ) )
68
  $querystring = '?' . $querystring;
69
  else
70
  $querystring = '';
71
 
72
- if ( $leavename )
73
- return wpbdp_url( '/' . '%' . WPBDP_POST_TYPE . '%' . '/' . $querystring );
 
 
 
 
 
74
 
75
- if ( wpbdp_get_option( 'permalinks-no-id' ) && $post->post_name )
76
- $link = wpbdp_url( '/' . $post->post_name . '/' );
77
- else
78
- $link = wpbdp_url( '/' . $post->ID . '/' . ( $post->post_name ? $post->post_name : '' ) );
79
 
80
- $link .= $querystring;
 
81
 
82
  return apply_filters( 'wpbdp_listing_link', $link, $post->ID );
83
  }
37
  if ( WPBDP_CATEGORY_TAX != $taxonomy )
38
  return $link;
39
 
40
+ if ( ! wpbdp_rewrite_on() ) {
41
+ if ( wpbdp_get_option( 'disable-cpt' ) )
42
+ return wpbdp_url( '/' ) . '&_' . wpbdp_get_option( 'permalinks-category-slug' ) . '=' . $category->slug;
43
+
44
  return $link;
45
+ }
46
 
47
  $link = wpbdp_url( sprintf( '/%s/%s/', wpbdp_get_option( 'permalinks-category-slug' ), $category->slug ) );
48
 
53
  if ( WPBDP_TAGS_TAX != $taxonomy )
54
  return $link;
55
 
56
+ if ( ! wpbdp_rewrite_on() ) {
57
+ if ( wpbdp_get_option( 'disable-cpt' ) )
58
+ $link = wpbdp_url( '/' ) . '&_' . wpbdp_get_option( 'permalinks-tags-slug' ) . '=' . $tag->slug;
59
+
60
  return $link;
61
+ }
62
 
63
  $link = wpbdp_url( sprintf( '/%s/%s/', wpbdp_get_option( 'permalinks-tags-slug' ), $tag->slug ) );
64
 
69
  if ( WPBDP_POST_TYPE != get_post_type( $post ) )
70
  return $link;
71
 
 
 
 
72
  if ( $querystring = parse_url( $link, PHP_URL_QUERY ) )
73
  $querystring = '?' . $querystring;
74
  else
75
  $querystring = '';
76
 
77
+ if ( ! wpbdp_rewrite_on() ) {
78
+ if ( wpbdp_get_option( 'disable-cpt' ) ) {
79
+ $link = wpbdp_url( '/' ) . '&' . '_' . wpbdp_get_option( 'permalinks-directory-slug' ) . '=' . $post->post_name;
80
+ }
81
+ } else {
82
+ if ( $leavename )
83
+ return wpbdp_url( '/' . '%' . WPBDP_POST_TYPE . '%' . '/' . $querystring );
84
 
85
+ if ( wpbdp_get_option( 'permalinks-no-id' ) && $post->post_name )
86
+ $link = wpbdp_url( '/' . $post->post_name . '/' );
87
+ else
88
+ $link = wpbdp_url( '/' . $post->ID . '/' . ( $post->post_name ? $post->post_name : '' ) );
89
 
90
+ $link .= $querystring;
91
+ }
92
 
93
  return apply_filters( 'wpbdp_listing_link', $link, $post->ID );
94
  }
core/class-settings.php CHANGED
@@ -113,7 +113,7 @@ class WPBDP_Settings {
113
  $this->add_setting($s, 'show-search-listings', _x('Show "Search listings".', 'admin settings', 'WPBDM'), 'boolean', true);
114
  $this->add_setting($s, 'show-view-listings', _x('Show the "View Listings" button.', 'admin settings', 'WPBDM'), 'boolean', true);
115
  $this->add_setting($s, 'show-directory-button', _x('Show the "Directory" button.', 'admin settings', 'WPBDM'), 'boolean', true);
116
- $this->add_setting( $s, 'disable-cpt', _x( 'Disable CPT integration.', 'admin settings', 'WPBDM' ), 'boolean', false );
117
 
118
  // {{ Directory search.
119
  $s = $this->add_section( $g,
113
  $this->add_setting($s, 'show-search-listings', _x('Show "Search listings".', 'admin settings', 'WPBDM'), 'boolean', true);
114
  $this->add_setting($s, 'show-view-listings', _x('Show the "View Listings" button.', 'admin settings', 'WPBDM'), 'boolean', true);
115
  $this->add_setting($s, 'show-directory-button', _x('Show the "Directory" button.', 'admin settings', 'WPBDM'), 'boolean', true);
116
+ $this->add_setting( $s, 'disable-cpt', _x( 'Disable advanced CPT integration.', 'admin settings', 'WPBDM' ), 'boolean', false );
117
 
118
  // {{ Directory search.
119
  $s = $this->add_section( $g,
core/class-wordpress-template-integration.php CHANGED
@@ -10,6 +10,9 @@ class WPBDP__WordPress_Template_Integration {
10
 
11
 
12
  public function __construct() {
 
 
 
13
  add_filter( 'template_include', array( $this, 'template_include' ), 20 );
14
  add_action( 'wp_head', array( $this, 'maybe_spoof_post' ), 100 );
15
  add_action( 'wp_head', array( $this, 'wp_head_done' ), 999 );
@@ -33,19 +36,21 @@ class WPBDP__WordPress_Template_Integration {
33
  add_filter( 'wp_title', array( $this, 'modify_global_post_title' ), 1000 );
34
  add_action( 'loop_start', array( $this, 'setup_post_hooks' ) );
35
 
36
- if ( $page_template = locate_template( 'page.php' ) )
37
- $template = locate_template( 'page.php' );
38
 
39
  return $template;
40
  }
41
 
42
  public function setup_post_hooks( $query ) {
43
- if ( ! $query->is_main_query() || ! $this->wp_head_done )
 
 
 
44
  return;
45
 
46
  add_action( 'the_post', array( $this, 'spoof_post' ) );
47
  remove_filter( 'the_content', 'wpautop' );
48
- // add_filter( 'the_excerpt', array( $this, 'display_view_in_excerpt' ), 5 );
49
  add_filter( 'the_content', array( $this, 'display_view_in_content' ), 5 );
50
  remove_action( 'loop_start', array( $this, 'setup_post_hooks' ) );
51
  }
@@ -55,25 +60,6 @@ class WPBDP__WordPress_Template_Integration {
55
  remove_action( 'the_post', array( $this, 'spoof_post' ) );
56
  }
57
 
58
- public function display_view_in_excerpt( $excerpt = '' ) {
59
- if ( $this->displayed ) {
60
- remove_filter( 'the_excerpt', array( $this, 'display_view_in_excerpt' ), 5 );
61
- return '';
62
- }
63
-
64
- remove_filter( 'the_excerpt', array( $this, 'display_view_in_excerpt' ), 5 );
65
- $this->restore_things();
66
-
67
- $html = wpbdp_current_view_output();
68
-
69
- if ( ! is_404() )
70
- $this->end_query();
71
-
72
- $this->displayed = true;
73
-
74
- return $html;
75
- }
76
-
77
  public function display_view_in_content( $content = '' ) {
78
  if ( $this->displayed ) {
79
  remove_filter( 'the_content', array( $this, 'display_view_in_content' ), 5 );
@@ -175,8 +161,10 @@ class WPBDP__WordPress_Template_Integration {
175
  $classes[] = 'business-directory';
176
  $classes[] = 'wpbdp-view-' . $wp_query->wpbdp_view;
177
 
178
- if ( $theme = wp_get_theme() )
179
- $classes[] = 'wpbdp-wp-theme-' . strtolower( $theme->Name );
 
 
180
 
181
  $classes[] = 'wpbdp-theme-' . $wpbdp->themes->get_active_theme();
182
  }
10
 
11
 
12
  public function __construct() {
13
+ if ( wpbdp_get_option( 'disable-cpt' ) )
14
+ return;
15
+
16
  add_filter( 'template_include', array( $this, 'template_include' ), 20 );
17
  add_action( 'wp_head', array( $this, 'maybe_spoof_post' ), 100 );
18
  add_action( 'wp_head', array( $this, 'wp_head_done' ), 999 );
36
  add_filter( 'wp_title', array( $this, 'modify_global_post_title' ), 1000 );
37
  add_action( 'loop_start', array( $this, 'setup_post_hooks' ) );
38
 
39
+ if ( $page_template = locate_template( array( 'page.php', 'single.php', 'singular.php' ) ) )
40
+ $template = $page_template;
41
 
42
  return $template;
43
  }
44
 
45
  public function setup_post_hooks( $query ) {
46
+ if ( ! $this->wp_head_done )
47
+ return;
48
+
49
+ if ( ! $query->is_main_query() )
50
  return;
51
 
52
  add_action( 'the_post', array( $this, 'spoof_post' ) );
53
  remove_filter( 'the_content', 'wpautop' );
 
54
  add_filter( 'the_content', array( $this, 'display_view_in_content' ), 5 );
55
  remove_action( 'loop_start', array( $this, 'setup_post_hooks' ) );
56
  }
60
  remove_action( 'the_post', array( $this, 'spoof_post' ) );
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  public function display_view_in_content( $content = '' ) {
64
  if ( $this->displayed ) {
65
  remove_filter( 'the_content', array( $this, 'display_view_in_content' ), 5 );
161
  $classes[] = 'business-directory';
162
  $classes[] = 'wpbdp-view-' . $wp_query->wpbdp_view;
163
 
164
+ if ( $theme = wp_get_theme() ) {
165
+ $classes[] = 'wpbdp-wp-theme-' . $theme->get_stylesheet();
166
+ $classes[] = 'wpbdp-wp-theme-' . $theme->get_template();
167
+ }
168
 
169
  $classes[] = 'wpbdp-theme-' . $wpbdp->themes->get_active_theme();
170
  }
core/compatibility/class-compat.php CHANGED
@@ -6,6 +6,14 @@ class WPBDP_Compat {
6
  function __construct() {
7
  $this->workarounds_for_wp_bugs();
8
  $this->load_integrations();
 
 
 
 
 
 
 
 
9
  }
10
 
11
  function load_integrations() {
@@ -20,6 +28,11 @@ class WPBDP_Compat {
20
  }
21
  }
22
 
 
 
 
 
 
23
  // Work around WP bugs. {{{
24
 
25
  function workarounds_for_wp_bugs() {
6
  function __construct() {
7
  $this->workarounds_for_wp_bugs();
8
  $this->load_integrations();
9
+
10
+ if ( wpbdp_get_option( 'disable-cpt' ) ) {
11
+ require_once( WPBDP_PATH . 'core/compatibility/class-cpt-compat-mode.php' );
12
+ $nocpt = new WPBDP__CPT_Compat_Mode();
13
+ } else {
14
+ require_once( WPBDP_PATH . 'core/compatibility/class-themes-compat.php' );
15
+ new WPBDP__Themes_Compat();
16
+ }
17
  }
18
 
19
  function load_integrations() {
28
  }
29
  }
30
 
31
+ function cpt_compat_mode() {
32
+ require_once( WPBDP_PATH . 'core/compatibility/class-cpt-compat-mode.php' );
33
+ $nocpt = new WPBDP__CPT_Compat_Mode();
34
+ }
35
+
36
  // Work around WP bugs. {{{
37
 
38
  function workarounds_for_wp_bugs() {
core/compatibility/class-cpt-compat-mode.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPBDP__CPT_Compat_Mode {
4
+
5
+ private $current_view = '';
6
+ private $data = array();
7
+
8
+
9
+ public function __construct() {
10
+ add_filter( 'wpbdp_current_view', array( $this, 'maybe_change_current_view' ) );
11
+ add_action( 'wpbdp_before_dispatch', array( $this, 'before_dispatch' ) );
12
+ add_action( 'wpbdp_after_dispatch', array( $this, 'after_dispatch' ) );
13
+ }
14
+
15
+ public function maybe_change_current_view( $viewname ) {
16
+ global $wp_query;
17
+
18
+ $slug_dir = wpbdp_get_option( 'permalinks-directory-slug' );
19
+ $slug_cat = wpbdp_get_option( 'permalinks-category-slug' );
20
+ $slug_tag = wpbdp_get_option( 'permalinks-tags-slug' );
21
+
22
+ if ( get_query_var( '_' . $slug_dir ) )
23
+ $this->current_view = 'show_listing';
24
+ elseif ( get_query_var( '_' . $slug_cat ) )
25
+ $this->current_view = 'show_category';
26
+ elseif ( get_query_var( '_' . $slug_tag ) )
27
+ $this->current_view = 'show_tag';
28
+
29
+ if ( $this->current_view )
30
+ return $this->current_view;
31
+
32
+ return $viewname;
33
+ }
34
+
35
+ public function before_dispatch() {
36
+ global $wp_query;
37
+
38
+ $this->current_view = wpbdp_current_view();
39
+
40
+ if ( ! $this->current_view )
41
+ return;
42
+
43
+ switch ( $this->current_view ) {
44
+ case 'show_listing':
45
+ $this->data['wp_query'] = $wp_query;
46
+
47
+ $listing_id = wpbdp_get_post_by_id_or_slug( get_query_var( '_' . wpbdp_get_option( 'permalinks-directory-slug' ) ),
48
+ 'id',
49
+ 'id' );
50
+
51
+ $args = array( 'post_type' => WPBDP_POST_TYPE,
52
+ 'p' => $listing_id );
53
+ $wp_query = new WP_Query( $args );
54
+ $wp_query->the_post();
55
+
56
+ break;
57
+
58
+ case 'show_category':
59
+ $this->data['wp_query'] = $wp_query;
60
+
61
+ $args = array( WPBDP_CATEGORY_TAX => get_query_var( '_' . wpbdp_get_option( 'permalinks-category-slug' ) ) );
62
+ $wp_query = new WP_Query( $args );
63
+
64
+ break;
65
+
66
+ case 'show_tag':
67
+ $this->data['wp_query'] = $wp_query;
68
+
69
+ $args = array( WPBDP_TAGS_TAX => get_query_var( '_' . wpbdp_get_option( 'permalinks-tags-slug' ) ) );
70
+ $wp_query = new WP_Query( $args );
71
+
72
+ break;
73
+ }
74
+
75
+ // wpbdp_debug_e( $wp_query, $this->current_view );
76
+ }
77
+
78
+ public function after_dispatch() {
79
+ global $wp_query;
80
+
81
+ $this->current_view = wpbdp_current_view();
82
+
83
+ switch ( $this->current_view ) {
84
+ case 'show_listing':
85
+ case 'show_category':
86
+ case 'show_tag':
87
+ $wp_query = $this->data['wp_query'];
88
+ wp_reset_postdata();
89
+ break;
90
+ }
91
+ }
92
+
93
+
94
+ }
core/compatibility/class-themes-compat.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class WPBDP__Themes_Compat {
3
+
4
+ private $theme = '';
5
+ private $theme_version = '';
6
+ private $parent_theme = '';
7
+ private $parent_theme_version = '';
8
+
9
+
10
+ public function __construct() {
11
+ if ( wpbdp_get_option( 'disable-cpt' ) )
12
+ return;
13
+
14
+ $current_theme = wp_get_theme();
15
+
16
+ $this->theme = $current_theme->get_stylesheet();
17
+ $this->theme_version = $current_theme->get( 'Version' );
18
+
19
+ if ( $parent = $current_theme->parent() ) {
20
+ $this->parent_theme = $parent->get_stylesheet();
21
+ $this->parent_theme_version = $parent->get( 'Version' );
22
+ }
23
+
24
+ add_action( 'wpbdp_after_dispatch', array( $this, 'add_workarounds' ) );
25
+ }
26
+
27
+ public function add_workarounds() {
28
+ $current_view = wpbdp_current_view();
29
+
30
+ if ( ! $current_view )
31
+ return;
32
+
33
+
34
+ $themes_with_fixes = $this->get_themes_with_fixes();
35
+ $themes_to_try = array( $this->theme, $this->parent_theme );
36
+
37
+ foreach ( $themes_to_try as $t ) {
38
+ if ( ! $t )
39
+ continue;
40
+
41
+ if ( ! in_array( $t, $themes_with_fixes, true ) )
42
+ continue;
43
+
44
+ $t = WPBDP_Utils::normalize( $t );
45
+ $t = str_replace( '-', '_', $t );
46
+
47
+ if ( method_exists( $this, 'theme_' . $t ) )
48
+ call_user_func( array( $this, 'theme_' . $t ) );
49
+ }
50
+ }
51
+
52
+ public function get_themes_with_fixes() {
53
+ $themes_with_fixes = array( 'genesis', 'hmtpro5', 'customizr', 'customizr-pro' );
54
+ return apply_filters( 'wpbdp_themes_with_fixes_list', $themes_with_fixes );
55
+ }
56
+
57
+ //
58
+ // {{ Fixes for some themes.
59
+ //
60
+
61
+ public function theme_genesis() {
62
+ if ( ! in_array( wpbdp_current_view(), array( 'show_listing', 'show_category', 'show_tag' ), true ) )
63
+ return;
64
+
65
+ // Workaround taken from https://theeventscalendar.com/knowledgebase/genesis-theme-framework-integration/.
66
+ remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
67
+ remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
68
+ remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
69
+ add_action( 'genesis_entry_content', 'the_content', 15 );
70
+ }
71
+
72
+ public function theme_hmtpro5() {
73
+ if ( ! in_array( wpbdp_current_view(), array( 'show_category', 'show_tag' ), true ) )
74
+ return;
75
+
76
+ add_action( 'wp_head', array( $this, 'theme_hmtpro5_after_head' ), 999 );
77
+ }
78
+
79
+ public function theme_hmtpro5_after_head() {
80
+ global $wp_query;
81
+
82
+ $wp_query->is_page = true;
83
+ }
84
+
85
+ public function theme_customizr() {
86
+ add_filter( 'tc_show_single_post_content', '__return_false', 999 );
87
+ add_filter( 'tc_show_single_post_footer', '__return_false', 999 );
88
+
89
+ if ( ! in_array( wpbdp_current_view(), array( 'show_category', 'show_tag' ), true ) )
90
+ return;
91
+
92
+ add_filter( 'tc_is_grid_enabled', '__return_false', 999 );
93
+ add_filter( 'tc_show_excerpt', '__return_false', 999 );
94
+ add_filter( 'tc_post_list_controller', '__return_true', 999 );
95
+ add_filter( 'tc_show_tax_archive_title', '__return_false', 999 );
96
+ }
97
+
98
+ public function theme_customizr_pro() {
99
+ return $this->theme_customizr();
100
+ }
101
+
102
+ //
103
+ // }}
104
+ //
105
+ }
106
+
107
+
core/css/wpbdp.css CHANGED
@@ -836,6 +836,18 @@ body.business-directory #TB_secondLine {
836
  display: none;
837
  }
838
 
 
 
 
 
 
 
 
 
 
 
 
 
839
  /*
840
  * }}
841
  */
836
  display: none;
837
  }
838
 
839
+ .wpbdp-wp-theme-genesis.wpbdp-view-show_category .archive-description,
840
+ .wpbdp-wp-theme-genesis.wpbdp-view-show_tag .archive-description
841
+ {
842
+ display: none;
843
+ }
844
+
845
+ .wpbdp-wp-theme-hmtpro5.wpbdp-view-show_category .post-details,
846
+ .wpbdp-wp-theme-hmtpro5.wpbdp-view-show_tag .post-details
847
+ {
848
+ display: none;
849
+ }
850
+
851
  /*
852
  * }}
853
  */
core/css/wpbdp.min.css CHANGED
@@ -1 +1 @@
1
- form#wpbdmsearchform{padding:12px 0;text-align:center}form#wpbdmsearchform input{display:inline}form#wpbdmsearchform .wpbdmsearchbutton{margin-top:5px}form#wpbdmsearchform a.advanced-search-link{font-size:70%;display:block}#wpbdp-search-form{padding-left:10px}#wpbdp-search-form .wpbdp-search-filter{margin-bottom:10px;clear:both}#wpbdp-search-form .wpbdp-search-filter>.wpbdp-search-field-label{display:block;width:40%;float:left}#wpbdp-search-form .wpbdp-search-filter>div.field{display:block;width:60%;margin-left:40%;padding-left:5px}#wpbdp-search-form .wpbdp-search-filter>div.field>input[type="text"]{width:90%}#wpbdp-search-form .wpbdp-search-filter>div.field>select{width:90%}#wpbdp-search-form input[type="submit"]{width:100px;float:none;margin:auto}.cf:before,.cf:after{content:" ";display:table}.cf:after{clear:both}.cf{*zoom:1}.wpbdp-pagination{margin:25px 0 0 0}.wpbdp-pagination .next{float:right}.listing-actions form{margin:0;padding:0;display:inline}.listing-actions input{margin:0}.listing-actions input.delete-listing{margin-left:5px;margin-right:30px;color:#f00 !important}.listing-actions a.button{padding:5px 10px;font-size:11px;text-decoration:none;background-color:#e6e6e6;color:#7c7c7c;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-ms-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-webkit-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-o-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:linear-gradient(top,#f4f4f4,#e6e6e6);border:1px solid #d2d2d2;border-radius:3px;box-shadow:0 1px 2px rgba(64,64,64,0.1);margin-right:3px}.listing-actions a.button:hover{color:#5e5e5e;background-color:#ebebeb;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f9f9f9,#ebebeb);background-image:-ms-linear-gradient(top,#f9f9f9,#ebebeb);background-image:-webkit-linear-gradient(top,#f9f9f9,#ebebeb);background-image:-o-linear-gradient(top,#f9f9f9,#ebebeb);background-image:linear-gradient(top,#f9f9f9,#ebebeb)}.listing-actions a.delete-listing{margin-left:20px;color:red}.wpbdp-listing .listing-details .field-value{margin-bottom:10px;width:100%;float:none}.wpbdmsingledetails .singledetailsview .field-value{margin-bottom:10px}.field-value label{color:#444;font-weight:bold}.wpbdp-listing-excerpt{padding:10px;border-bottom:dotted 1px #ddd}.wpbdp-listing-excerpt.odd{background:#eee}.wpbdp-listing-excerpt.sticky{background:#fff0cf;border-bottom:solid 1px #b37800}.wpbdp-listing-excerpt .listing-thumbnail{float:right;margin:0 10px 0 0}.wpbdp-listing-excerpt .listing-actions{margin-top:15px}.wpbdp-listing-single .listing-actions{margin-bottom:25px}.wpbdp-listing-single .stickytag{float:right;margin-top:-68px}.wpbdp-listing-single .stickytag img{border:0;box-shadow:none;background:transparent}.wpbdp-listing-single .listing-title{padding:2px 8px;background:#efefef;border:dotted 1px #ddd;margin-bottom:7px}.wpbdp-listing-single .listing-title h2{clear:none;margin:0}.wpbdp-listing-single .main-image{float:right;margin-left:10px;padding:5px}.wpbdp-listing-single .main-image a{position:relative !important}.wpbdp-listing-single .main-image img{border:solid 1px #333}.wpbdp-listing-single .extra-images{margin-top:10px;clear:both}.wpbdp-listing-single .extra-images ul{margin:0 auto;width:100%}.wpbdp-listing-single .extra-images ul li{list-style-type:none;display:inline;margin-left:5px}.wpbdp-listing-single .extra-images ul li img{display:inline;vertical-align:top;margin:0 auto;max-width:150px;border:solid 1px #333}.wpbdp-listing .social-fields{margin:20px 0}.wpbdp-listing .social-field{margin:5px 0;height:20px;vertical-align:middle}.social-field.facebook .fb-like>span{overflow:visible !important;width:450px !important;vertical-align:top !important}@media screen and (max-width:500px){.social-field.facebook .fb-like>span{width:100% !important}}.wpbdp-listing-contact-form{margin-top:20px;border-top:dotted 1px #ddd;padding-top:20px;padding-left:10px}.wpbdp-listing-contact-form .send-message-button{margin-left:-10px}.wpbdp-listing-contact-form h3{margin-left:-10px}.wpbdp-listing-contact-form textarea{width:98% !important}.wpbdp-listing .comments{margin-top:20px}.wpbdp-bar{background:#f7f7f7;margin:10px 0 20px 0;padding:5px 10px}.wpbdp-bar .wpbdp-main-links{float:left}.wpbdp-bar .wpbdp-main-links #wpbdp-bar-view-listings-button,.wpbdp-bar .wpbdp-main-links #wpbdp-bar-show-directory-button{margin-right:5px}.wpbdp-bar .wpbdp-search-form{margin:0;padding:0 !important;margin-left:50%}.wpbdp-main-links a{margin-right:15px}.wpbdp-bar .left{float:left;text-align:center}.wpbdp-bar .right{width:300px;float:right}.wpbdp-listings-sort-options{font-size:90%;margin:5px 0;text-align:right}.wpbdp-listings-sort-options .current{font-weight:bold}.wpbdp-page-main_page #wpbdp-categories{clear:both;margin-bottom:20px}ul.wpbdp-categories{margin:0 0 10px 15px;padding:0 10px}ul.wpbdp-categories>li{width:50%;float:left;margin:0}@media screen and (max-width:704px){ul.wpbdp-categories>li{float:none;width:initial}}@media screen and (max-width:500px){ul.wpbdp-categories{font-size:90%}ul.wpbdp-categories ul.children li.cat-item{margin-left:10px;padding:0}}.wpbdp-submit-page h3{margin-bottom:10px}.wpbdp-submit-page .wpbdmp{margin:0}.wpbdp-submit-page legend{font-size:85%;margin-bottom:20px}.wpbdp-submit-page .wpbdp-form-field{margin-bottom:8px}.wpbdp-submit-page .wpbdp-form-field .wpbdmcheckboxclass checkbox{margin-left:0}.wpbdp-submit-page .wpbdp-form-field.required .wpbdp-form-field-label:after{content:' *';font-size:80%}.wpbdp-submit-page .wpbdp-form-field-type-textarea textarea{width:90%;min-height:50px}.wpbdp-submit-page .wpbdp-form-field-association-content textarea{min-height:80px}.wpbdp-form-field .field-description{font-size:90%;color:#696969;float:right}.wpbdp-form-field span.sublabel{font-size:90%;margin-left:10px;margin-right:10px}.wpbdp-form-field.image a.delete{margin-left:10px}ul.validation-errors{margin:15px 0 15px 0}ul.validation-errors li{color:red;margin:3px 0;list-style-position:inside}.wpbdp-submit-page.step-fees h4{background:#ddd;color:#333;padding:10px;margin-bottom:5px}.wpbdp-submit-page.step-images #image-upload-form{margin:15px 10px}.wpbdp-submit-page.step-images .wpbdp-image{float:left;border-bottom:dotted 1px #efefef;margin-right:10px;margin-bottom:10px;vertical-align:top}.wpbdp-submit-page.step-images .wpbdp-image img{vertical-align:top;text-align:center;max-width:150px;height:auto}.wpbdp-submit-page.step-images .wpbdp-image-draggable-highlight{width:160px;height:160px;margin:0 10px;background:red;float:left}.wpbdp-submit-page.step-images .area-and-conditions #image-upload-dnd-area{float:left;width:72%}.wpbdp-submit-page.step-images .area-and-conditions #image-upload-conditions{float:right;width:25%;color:#666}.wpbdp-submit-page.step-images .area-and-conditions #image-upload-conditions dl{margin:0}.wpbdp-submit-page.step-images #image-upload-form-no-js{width:0;height:0;overflow:hidden;visibility:hidden}.wpbdp-submit-page.step-images .wpbdp-image .delete-image{color:red}.wpbdp-submit-page .upgrade-to-featured-option{border:solid 1px #666;padding:5px 10px;margin:25px 0 25px 0;font-size:90%}.wpbdp-msg{font-size:85%;padding:.6em;border:solid 1px #e6db55;color:#555;margin:5px 0;background:#fffbcc;border-radius:3px}.wpbdp-msg.error{background-color:#ffebe8;border-color:#C00}.wpbdp-submit-page table.fee-options{width:100%}.wpbdp-submit-page table.fee-options th,.wpbdp-submit-page table.fee-options td{text-align:center}.wpbdp-submit-page table.fee-options .fee-selection{width:5%}.wpbdp-submit-page table.fee-options tr.fee-option td.fee-label{font-weight:bold}.wpbdp-submit-page table.fee-options td.fee-description{font-size:90%;color:#666}#wpbdp-renewal-page .do-not-renew-listing{margin:40px 0;border:solid 1px #eee;font-size:95%}#wpbdp-renewal-page .do-not-renew-listing .header{background:#bc0b0b;color:#fff;text-align:center;font-weight:bold;padding:2px 0}#wpbdp-renewal-page .do-not-renew-listing input[type="submit"]{color:#900000}.wpbdp-recaptcha-error{color:red}#wpbdp-delete-listing-page form.confirm-form{margin-top:30px}#wpbdp-delete-listing-page input.delete-listing-confirm{margin-left:20px;color:#c00}#googlewallet-buy img{border:0;box-shadow:none}.wpbdp-checkout input[type="image"]{padding:0;border:0;box-shadow:none;width:auto}table#wpbdp-manage-recurring th.listing-title,table#wpbdp-manage-recurring td.listing-title{min-width:200px}table#wpbdp-manage-recurring a.cancel-subscription{color:red}#wpbdp-manage-recurring-cancel dl dd{margin-left:10px}.wpbdp-cc-form{padding:0;width:90%}.wpbdp-cc-form h4{margin:0}.wpbdp-cc-field input{width:auto}.wpbdp-cc-field label{display:block;font-weight:bold;text-align:right;padding-right:10px}#wpbdp-billing-information .billing-info-section h4{margin-bottom:5px}#wpbdp-billing-information .billing-info-section table{margin:10px 0 0 20px}#wpbdp-billing-information .form-buttons{margin:15px 0}.wpbdp-show-on-mobile{display:none}@media screen and (max-width:500px){.wpbdp-show-on-mobile{display:inline !important}.wpbdp-hide-on-mobile{display:none}.wpbdp-bar .wpbdp-main-links{display:block;float:none;text-align:center}.wpbdp-bar .wpbdp-main-links #wpbdp-bar-submit-listing-button{margin-bottom:5px;display:inline-block}.wpbdp-bar .wpbdp-main-links #wpbdp-bar-view-listings-button{display:inline-block;float:left;margin-right:20px}.wpbdp-bar .wpbdp-main-links input[type="button"]{display:block;margin-bottom:2px}.wpbdp-bar form.wpbdp-search-form{display:block;margin-left:0;margin-top:10px}.wpbdp-bar form.wpbdp-search-form #intextbox{margin-bottom:5px;padding:4px}.wpbdp-bar form.wpbdp-search-form input[type="text"]{padding:4px 0;margin:0 0 2px 0}.wpbdp-listings-sort-options{font-size:90%}.wpbdp-listing.wpbdp-listing{font-size:90%}.wpbdp-listing.wpbdp-listing-excerpt .field-value>label{display:block}.wpbdp-listing.wpbdp-listing-excerpt .listing-thumbnail{padding:5px}.wpbdp-listing .listing-actions input{font-size:85%}.wpbdp-listing .listing-actions input.back-to-dir{float:right}.wpbdp-listing.wpbdp-listing-single .main-image{display:block;float:none;padding:0;margin:0 0 10px 0;text-align:center;max-width:90%}.wpbdp-listing.wpbdp-listing-single .field-value>label{display:block}.wpbdp-submit-page.step-images #image-upload-dnd-area{font-size:90%;float:none !important;width:100% !important}.wpbdp-submit-page.step-images .dnd-area-inside-error{margin-top:30px}.wpbdp-submit-page.step-images #image-upload-conditions{width:100% !important;float:none !important;font-size:90%}.wpbdp-submit-page.step-images #image-upload-conditions dl{margin:0;padding:0}.wpbdp-submit-page.step-images #image-upload-conditions dl dt{margin:0;margin-right:5px;padding:0;float:left}.wpbdp-submit-page.step-images #image-upload-conditions dl dd{margin:0;padding:0;display:block}.wpbdp-submit-page.step-images .wpbdp-image img{max-width:50%}.wpbdp-listings-sort-options.wpbdp-show-on-mobile{margin-bottom:10px}}body.business-directory #TB_ImageOff .screen-reader-text,body.business-directory #TB_closeWindowButton .screen-reader-text{visibility:hidden}body.business-directory #TB_next{float:right}body.business-directory #TB_prev{float:left}body.business-directory #TB_caption{float:none !important}body.business-directory #TB_closeWindow{padding:0;height:0}body.business-directory #TB_closeWindow .screen-reader-text{display:none}body.business-directory #TB_secondLine{text-align:center}.wpbdp-form-row label{display:block}.wpbdp-form-row.wpbdp-form-textfield input[type="text"]{width:400px}.single-wpbdp_listing header.entry-header,.wpbdp-view-show_category header.entry-header,.wpbdp-view-show_tag header.entry-header,.wpbdp-view-search header.entry-header,.wpbdp-view-submit_listing header.entry-header{display:none}.wpbdp-wp-theme-graphene.single-wpbdp_listing h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-show_category h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-show_tag h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-search h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-submit_listing h1.post-title{display:none}
1
+ form#wpbdmsearchform{padding:12px 0;text-align:center}form#wpbdmsearchform input{display:inline}form#wpbdmsearchform .wpbdmsearchbutton{margin-top:5px}form#wpbdmsearchform a.advanced-search-link{font-size:70%;display:block}#wpbdp-search-form{padding-left:10px}#wpbdp-search-form .wpbdp-search-filter{margin-bottom:10px;clear:both}#wpbdp-search-form .wpbdp-search-filter>.wpbdp-search-field-label{display:block;width:40%;float:left}#wpbdp-search-form .wpbdp-search-filter>div.field{display:block;width:60%;margin-left:40%;padding-left:5px}#wpbdp-search-form .wpbdp-search-filter>div.field>input[type="text"]{width:90%}#wpbdp-search-form .wpbdp-search-filter>div.field>select{width:90%}#wpbdp-search-form input[type="submit"]{width:100px;float:none;margin:auto}.cf:before,.cf:after{content:" ";display:table}.cf:after{clear:both}.cf{*zoom:1}.wpbdp-pagination{margin:25px 0 0 0}.wpbdp-pagination .next{float:right}.listing-actions form{margin:0;padding:0;display:inline}.listing-actions input{margin:0}.listing-actions input.delete-listing{margin-left:5px;margin-right:30px;color:#f00 !important}.listing-actions a.button{padding:5px 10px;font-size:11px;text-decoration:none;background-color:#e6e6e6;color:#7c7c7c;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-ms-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-webkit-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:-o-linear-gradient(top,#f4f4f4,#e6e6e6);background-image:linear-gradient(top,#f4f4f4,#e6e6e6);border:1px solid #d2d2d2;border-radius:3px;box-shadow:0 1px 2px rgba(64,64,64,0.1);margin-right:3px}.listing-actions a.button:hover{color:#5e5e5e;background-color:#ebebeb;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f9f9f9,#ebebeb);background-image:-ms-linear-gradient(top,#f9f9f9,#ebebeb);background-image:-webkit-linear-gradient(top,#f9f9f9,#ebebeb);background-image:-o-linear-gradient(top,#f9f9f9,#ebebeb);background-image:linear-gradient(top,#f9f9f9,#ebebeb)}.listing-actions a.delete-listing{margin-left:20px;color:red}.wpbdp-listing .listing-details .field-value{margin-bottom:10px;width:100%;float:none}.wpbdmsingledetails .singledetailsview .field-value{margin-bottom:10px}.field-value label{color:#444;font-weight:bold}.wpbdp-listing-excerpt{padding:10px;border-bottom:dotted 1px #ddd}.wpbdp-listing-excerpt.odd{background:#eee}.wpbdp-listing-excerpt.sticky{background:#fff0cf;border-bottom:solid 1px #b37800}.wpbdp-listing-excerpt .listing-thumbnail{float:right;margin:0 10px 0 0}.wpbdp-listing-excerpt .listing-actions{margin-top:15px}.wpbdp-listing-single .listing-actions{margin-bottom:25px}.wpbdp-listing-single .stickytag{float:right;margin-top:-68px}.wpbdp-listing-single .stickytag img{border:0;box-shadow:none;background:transparent}.wpbdp-listing-single .listing-title{padding:2px 8px;background:#efefef;border:dotted 1px #ddd;margin-bottom:7px}.wpbdp-listing-single .listing-title h2{clear:none;margin:0}.wpbdp-listing-single .main-image{float:right;margin-left:10px;padding:5px}.wpbdp-listing-single .main-image a{position:relative !important}.wpbdp-listing-single .main-image img{border:solid 1px #333}.wpbdp-listing-single .extra-images{margin-top:10px;clear:both}.wpbdp-listing-single .extra-images ul{margin:0 auto;width:100%}.wpbdp-listing-single .extra-images ul li{list-style-type:none;display:inline;margin-left:5px}.wpbdp-listing-single .extra-images ul li img{display:inline;vertical-align:top;margin:0 auto;max-width:150px;border:solid 1px #333}.wpbdp-listing .social-fields{margin:20px 0}.wpbdp-listing .social-field{margin:5px 0;height:20px;vertical-align:middle}.social-field.facebook .fb-like>span{overflow:visible !important;width:450px !important;vertical-align:top !important}@media screen and (max-width:500px){.social-field.facebook .fb-like>span{width:100% !important}}.wpbdp-listing-contact-form{margin-top:20px;border-top:dotted 1px #ddd;padding-top:20px;padding-left:10px}.wpbdp-listing-contact-form .send-message-button{margin-left:-10px}.wpbdp-listing-contact-form h3{margin-left:-10px}.wpbdp-listing-contact-form textarea{width:98% !important}.wpbdp-listing .comments{margin-top:20px}.wpbdp-bar{background:#f7f7f7;margin:10px 0 20px 0;padding:5px 10px}.wpbdp-bar .wpbdp-main-links{float:left}.wpbdp-bar .wpbdp-main-links #wpbdp-bar-view-listings-button,.wpbdp-bar .wpbdp-main-links #wpbdp-bar-show-directory-button{margin-right:5px}.wpbdp-bar .wpbdp-search-form{margin:0;padding:0 !important;margin-left:50%}.wpbdp-main-links a{margin-right:15px}.wpbdp-bar .left{float:left;text-align:center}.wpbdp-bar .right{width:300px;float:right}.wpbdp-listings-sort-options{font-size:90%;margin:5px 0;text-align:right}.wpbdp-listings-sort-options .current{font-weight:bold}.wpbdp-page-main_page #wpbdp-categories{clear:both;margin-bottom:20px}ul.wpbdp-categories{margin:0 0 10px 15px;padding:0 10px}ul.wpbdp-categories>li{width:50%;float:left;margin:0}@media screen and (max-width:704px){ul.wpbdp-categories>li{float:none;width:initial}}@media screen and (max-width:500px){ul.wpbdp-categories{font-size:90%}ul.wpbdp-categories ul.children li.cat-item{margin-left:10px;padding:0}}.wpbdp-submit-page h3{margin-bottom:10px}.wpbdp-submit-page .wpbdmp{margin:0}.wpbdp-submit-page legend{font-size:85%;margin-bottom:20px}.wpbdp-submit-page .wpbdp-form-field{margin-bottom:8px}.wpbdp-submit-page .wpbdp-form-field .wpbdmcheckboxclass checkbox{margin-left:0}.wpbdp-submit-page .wpbdp-form-field.required .wpbdp-form-field-label:after{content:' *';font-size:80%}.wpbdp-submit-page .wpbdp-form-field-type-textarea textarea{width:90%;min-height:50px}.wpbdp-submit-page .wpbdp-form-field-association-content textarea{min-height:80px}.wpbdp-form-field .field-description{font-size:90%;color:#696969;float:right}.wpbdp-form-field span.sublabel{font-size:90%;margin-left:10px;margin-right:10px}.wpbdp-form-field.image a.delete{margin-left:10px}ul.validation-errors{margin:15px 0 15px 0}ul.validation-errors li{color:red;margin:3px 0;list-style-position:inside}.wpbdp-submit-page.step-fees h4{background:#ddd;color:#333;padding:10px;margin-bottom:5px}.wpbdp-submit-page.step-images #image-upload-form{margin:15px 10px}.wpbdp-submit-page.step-images .wpbdp-image{float:left;border-bottom:dotted 1px #efefef;margin-right:10px;margin-bottom:10px;vertical-align:top}.wpbdp-submit-page.step-images .wpbdp-image img{vertical-align:top;text-align:center;max-width:150px;height:auto}.wpbdp-submit-page.step-images .wpbdp-image-draggable-highlight{width:160px;height:160px;margin:0 10px;background:red;float:left}.wpbdp-submit-page.step-images .area-and-conditions #image-upload-dnd-area{float:left;width:72%}.wpbdp-submit-page.step-images .area-and-conditions #image-upload-conditions{float:right;width:25%;color:#666}.wpbdp-submit-page.step-images .area-and-conditions #image-upload-conditions dl{margin:0}.wpbdp-submit-page.step-images #image-upload-form-no-js{width:0;height:0;overflow:hidden;visibility:hidden}.wpbdp-submit-page.step-images .wpbdp-image .delete-image{color:red}.wpbdp-submit-page .upgrade-to-featured-option{border:solid 1px #666;padding:5px 10px;margin:25px 0 25px 0;font-size:90%}.wpbdp-msg{font-size:85%;padding:.6em;border:solid 1px #e6db55;color:#555;margin:5px 0;background:#fffbcc;border-radius:3px}.wpbdp-msg.error{background-color:#ffebe8;border-color:#C00}.wpbdp-submit-page table.fee-options{width:100%}.wpbdp-submit-page table.fee-options th,.wpbdp-submit-page table.fee-options td{text-align:center}.wpbdp-submit-page table.fee-options .fee-selection{width:5%}.wpbdp-submit-page table.fee-options tr.fee-option td.fee-label{font-weight:bold}.wpbdp-submit-page table.fee-options td.fee-description{font-size:90%;color:#666}#wpbdp-renewal-page .do-not-renew-listing{margin:40px 0;border:solid 1px #eee;font-size:95%}#wpbdp-renewal-page .do-not-renew-listing .header{background:#bc0b0b;color:#fff;text-align:center;font-weight:bold;padding:2px 0}#wpbdp-renewal-page .do-not-renew-listing input[type="submit"]{color:#900000}.wpbdp-recaptcha-error{color:red}#wpbdp-delete-listing-page form.confirm-form{margin-top:30px}#wpbdp-delete-listing-page input.delete-listing-confirm{margin-left:20px;color:#c00}#googlewallet-buy img{border:0;box-shadow:none}.wpbdp-checkout input[type="image"]{padding:0;border:0;box-shadow:none;width:auto}table#wpbdp-manage-recurring th.listing-title,table#wpbdp-manage-recurring td.listing-title{min-width:200px}table#wpbdp-manage-recurring a.cancel-subscription{color:red}#wpbdp-manage-recurring-cancel dl dd{margin-left:10px}.wpbdp-cc-form{padding:0;width:90%}.wpbdp-cc-form h4{margin:0}.wpbdp-cc-field input{width:auto}.wpbdp-cc-field label{display:block;font-weight:bold;text-align:right;padding-right:10px}#wpbdp-billing-information .billing-info-section h4{margin-bottom:5px}#wpbdp-billing-information .billing-info-section table{margin:10px 0 0 20px}#wpbdp-billing-information .form-buttons{margin:15px 0}.wpbdp-show-on-mobile{display:none}@media screen and (max-width:500px){.wpbdp-show-on-mobile{display:inline !important}.wpbdp-hide-on-mobile{display:none}.wpbdp-bar .wpbdp-main-links{display:block;float:none;text-align:center}.wpbdp-bar .wpbdp-main-links #wpbdp-bar-submit-listing-button{margin-bottom:5px;display:inline-block}.wpbdp-bar .wpbdp-main-links #wpbdp-bar-view-listings-button{display:inline-block;float:left;margin-right:20px}.wpbdp-bar .wpbdp-main-links input[type="button"]{display:block;margin-bottom:2px}.wpbdp-bar form.wpbdp-search-form{display:block;margin-left:0;margin-top:10px}.wpbdp-bar form.wpbdp-search-form #intextbox{margin-bottom:5px;padding:4px}.wpbdp-bar form.wpbdp-search-form input[type="text"]{padding:4px 0;margin:0 0 2px 0}.wpbdp-listings-sort-options{font-size:90%}.wpbdp-listing.wpbdp-listing{font-size:90%}.wpbdp-listing.wpbdp-listing-excerpt .field-value>label{display:block}.wpbdp-listing.wpbdp-listing-excerpt .listing-thumbnail{padding:5px}.wpbdp-listing .listing-actions input{font-size:85%}.wpbdp-listing .listing-actions input.back-to-dir{float:right}.wpbdp-listing.wpbdp-listing-single .main-image{display:block;float:none;padding:0;margin:0 0 10px 0;text-align:center;max-width:90%}.wpbdp-listing.wpbdp-listing-single .field-value>label{display:block}.wpbdp-submit-page.step-images #image-upload-dnd-area{font-size:90%;float:none !important;width:100% !important}.wpbdp-submit-page.step-images .dnd-area-inside-error{margin-top:30px}.wpbdp-submit-page.step-images #image-upload-conditions{width:100% !important;float:none !important;font-size:90%}.wpbdp-submit-page.step-images #image-upload-conditions dl{margin:0;padding:0}.wpbdp-submit-page.step-images #image-upload-conditions dl dt{margin:0;margin-right:5px;padding:0;float:left}.wpbdp-submit-page.step-images #image-upload-conditions dl dd{margin:0;padding:0;display:block}.wpbdp-submit-page.step-images .wpbdp-image img{max-width:50%}.wpbdp-listings-sort-options.wpbdp-show-on-mobile{margin-bottom:10px}}body.business-directory #TB_ImageOff .screen-reader-text,body.business-directory #TB_closeWindowButton .screen-reader-text{visibility:hidden}body.business-directory #TB_next{float:right}body.business-directory #TB_prev{float:left}body.business-directory #TB_caption{float:none !important}body.business-directory #TB_closeWindow{padding:0;height:0}body.business-directory #TB_closeWindow .screen-reader-text{display:none}body.business-directory #TB_secondLine{text-align:center}.wpbdp-form-row label{display:block}.wpbdp-form-row.wpbdp-form-textfield input[type="text"]{width:400px}.single-wpbdp_listing header.entry-header,.wpbdp-view-show_category header.entry-header,.wpbdp-view-show_tag header.entry-header,.wpbdp-view-search header.entry-header,.wpbdp-view-submit_listing header.entry-header{display:none}.wpbdp-wp-theme-graphene.single-wpbdp_listing h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-show_category h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-show_tag h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-search h1.post-title,.wpbdp-wp-theme-graphene.wpbdp-view-submit_listing h1.post-title{display:none}.wpbdp-wp-theme-genesis.wpbdp-view-show_category .archive-description,.wpbdp-wp-theme-genesis.wpbdp-view-show_tag .archive-description{display:none}.wpbdp-wp-theme-hmtpro5.wpbdp-view-show_category .post-details,.wpbdp-wp-theme-hmtpro5.wpbdp-view-show_tag .post-details{display:none}
core/installer.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  class WPBDP_Installer {
4
 
5
- const DB_VERSION = '12';
6
 
7
  private $installed_version = null;
8
 
@@ -171,7 +171,7 @@ class WPBDP_Installer {
171
  if ( get_option( 'wpbdp-manual-upgrade-pending', false ) )
172
  return;
173
 
174
- $upgrade_routines = array( '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '3.1', '3.2', '3.4', '3.5', '3.6', '3.7', '3.9', '4.0', '5', '6', '7', '8', '11', '12' );
175
 
176
  foreach ( $upgrade_routines as $v ) {
177
  if ( version_compare( $this->installed_version, $v ) < 0 ) {
@@ -904,13 +904,13 @@ class WPBDP_Installer {
904
  delete_transient( 'wpbdp-themes-updates' );
905
  }
906
 
907
- // public function upgrade_to_12() {
908
- // global $wpdb;
909
- //
910
- // $wpdb->query( $wpdb->prepare(
911
- // "DELETE lf.* FROM {$wpdb->prefix}wpbdp_listing_fees lf WHERE lf.category_id NOT IN ( SELECT tt.term_id FROM {$wpdb->term_taxonomy} tt WHERE tt.taxonomy = %s )",
912
- // WPBDP_CATEGORY_TAX ) );
913
- // }
914
 
915
  }
916
 
2
 
3
  class WPBDP_Installer {
4
 
5
+ const DB_VERSION = '13';
6
 
7
  private $installed_version = null;
8
 
171
  if ( get_option( 'wpbdp-manual-upgrade-pending', false ) )
172
  return;
173
 
174
+ $upgrade_routines = array( '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '3.1', '3.2', '3.4', '3.5', '3.6', '3.7', '3.9', '4.0', '5', '6', '7', '8', '11', '12', '13' );
175
 
176
  foreach ( $upgrade_routines as $v ) {
177
  if ( version_compare( $this->installed_version, $v ) < 0 ) {
904
  delete_transient( 'wpbdp-themes-updates' );
905
  }
906
 
907
+ public function upgrade_to_13() {
908
+ // Make sure no field shortnames conflict.
909
+ $fields = wpbdp_get_form_fields();
910
+
911
+ foreach ( $fields as $f )
912
+ $f->save();
913
+ }
914
 
915
  }
916
 
themes/default/theme.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "name": "Default Theme",
3
  "description": "This is the new default look of Business Directory starting with version 4.0. A cleaner, basic look to the directory with improved layout. This theme is always installed and cannot be removed.",
4
- "version": "4.0.3",
5
  "author": "BD Team",
6
  "author_email": "support@businessdirectoryplugin.com",
7
  "author_url": "http://businessdirectoryplugin.com",
1
  {
2
  "name": "Default Theme",
3
  "description": "This is the new default look of Business Directory starting with version 4.0. A cleaner, basic look to the directory with improved layout. This theme is always installed and cannot be removed.",
4
+ "version": "4.0.4",
5
  "author": "BD Team",
6
  "author_email": "support@businessdirectoryplugin.com",
7
  "author_url": "http://businessdirectoryplugin.com",