@@ -16,184 +16,184 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | $geodir_settings['permalink_settings'] = apply_filters('geodir_permalink_settings', array( |
| 18 | 18 | |
| 19 | - /* Listing Permalink Settings start */ |
|
| 20 | - array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '), |
|
| 21 | - |
|
| 22 | - |
|
| 23 | - array('name' => __('Listing Detail Permalink Settings', 'geodirectory'), |
|
| 24 | - 'type' => 'sectionstart', |
|
| 25 | - 'desc' => '', |
|
| 26 | - 'id' => 'geodir_permalink'), |
|
| 27 | - |
|
| 28 | - array( |
|
| 29 | - 'name' => __('Add location in urls', 'geodirectory'), |
|
| 30 | - 'desc' => __('Add location slug in listing urls', 'geodirectory'), |
|
| 31 | - 'id' => 'geodir_add_location_url', |
|
| 32 | - 'type' => 'checkbox', |
|
| 33 | - 'std' => '1', |
|
| 34 | - 'checkboxgroup' => 'start' |
|
| 35 | - ), |
|
| 36 | - |
|
| 37 | - array( |
|
| 38 | - 'name' => __('Add full location in listing urls', 'geodirectory'), |
|
| 39 | - 'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'), |
|
| 40 | - 'id' => 'geodir_show_location_url', |
|
| 41 | - 'type' => 'radio', |
|
| 42 | - 'value' => 'all', |
|
| 43 | - 'std' => 'all', |
|
| 44 | - 'radiogroup' => '' |
|
| 45 | - ), |
|
| 46 | - |
|
| 47 | - array( |
|
| 48 | - 'name' => __('Add country and city slug in listing urls', 'geodirectory'), |
|
| 49 | - 'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'), |
|
| 50 | - 'id' => 'geodir_show_location_url', |
|
| 51 | - 'type' => 'radio', |
|
| 52 | - 'std' => 'all', |
|
| 53 | - 'value' => 'country_city', |
|
| 54 | - 'radiogroup' => '' |
|
| 55 | - ), |
|
| 56 | - array( |
|
| 57 | - 'name' => __('Add region and city slug in listing urls', 'geodirectory'), |
|
| 58 | - 'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'), |
|
| 59 | - 'id' => 'geodir_show_location_url', |
|
| 60 | - 'type' => 'radio', |
|
| 61 | - 'std' => 'all', |
|
| 62 | - 'value' => 'region_city', |
|
| 63 | - 'radiogroup' => '' |
|
| 64 | - ), |
|
| 65 | - array( |
|
| 66 | - 'name' => __('Add only city in listing urls', 'geodirectory'), |
|
| 67 | - 'desc' => __('Add city slug in listing urls', 'geodirectory'), |
|
| 68 | - 'id' => 'geodir_show_location_url', |
|
| 69 | - 'type' => 'radio', |
|
| 70 | - 'std' => 'all', |
|
| 71 | - 'value' => 'city', |
|
| 72 | - 'radiogroup' => 'end' |
|
| 73 | - ), |
|
| 74 | - |
|
| 75 | - |
|
| 76 | - |
|
| 77 | - array( |
|
| 78 | - 'name' => __('Add category in listing urls', 'geodirectory'), |
|
| 79 | - 'desc' => __('Add requested category slugs in listing urls', 'geodirectory'), |
|
| 80 | - 'id' => 'geodir_add_categories_url', |
|
| 81 | - 'type' => 'checkbox', |
|
| 82 | - 'std' => '1', |
|
| 83 | - ), |
|
| 84 | - |
|
| 85 | - array( |
|
| 86 | - 'name' => __('Listing url prefix', 'geodirectory'), |
|
| 87 | - 'desc' => __('Listing prefix to show in url', 'geodirectory'), |
|
| 88 | - 'id' => 'geodir_listing_prefix', |
|
| 89 | - 'type' => 'text', |
|
| 90 | - 'css' => 'min-width:300px;', |
|
| 91 | - 'std' => 'places' |
|
| 92 | - ), |
|
| 93 | - |
|
| 94 | - array( |
|
| 95 | - 'name' => __('Location url prefix', 'geodirectory'), |
|
| 96 | - 'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'), |
|
| 97 | - 'id' => 'geodir_location_prefix', |
|
| 98 | - 'type' => 'text', |
|
| 99 | - 'css' => 'min-width:300px;', |
|
| 100 | - 'std' => 'location' // Default value to show home top section |
|
| 101 | - ), |
|
| 102 | - |
|
| 103 | - array( |
|
| 104 | - 'name' => __('Location and category url separator', 'geodirectory'), |
|
| 105 | - 'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'), |
|
| 106 | - 'id' => 'geodir_listingurl_separator', |
|
| 107 | - 'type' => 'text', |
|
| 108 | - 'css' => 'min-width:300px;', |
|
| 109 | - 'std' => 'C' // Default value to show home top section |
|
| 110 | - ), |
|
| 111 | - |
|
| 112 | - array( |
|
| 113 | - 'name' => __('Listing detail url separator', 'geodirectory'), |
|
| 114 | - 'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'), |
|
| 115 | - 'id' => 'geodir_detailurl_separator', |
|
| 116 | - 'type' => 'text', |
|
| 117 | - 'css' => 'min-width:300px;', |
|
| 118 | - 'std' => 'info' // Default value to show home top section |
|
| 119 | - ), |
|
| 120 | - |
|
| 121 | - |
|
| 122 | - array('type' => 'sectionend', 'id' => 'geodir_permalink'), |
|
| 123 | - |
|
| 124 | - array('name' => __('GeoDirectory Pages', 'geodirectory'), |
|
| 125 | - 'type' => 'sectionstart', |
|
| 126 | - 'desc' => '', |
|
| 127 | - 'id' => 'geodir_pages'), |
|
| 128 | - |
|
| 129 | - array( |
|
| 130 | - 'name' => __('GD Home page', 'geodirectory'), |
|
| 131 | - 'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'), |
|
| 132 | - 'id' => 'geodir_home_page', |
|
| 133 | - 'type' => 'single_select_page', |
|
| 134 | - 'class' => 'chosen_select' |
|
| 135 | - ), |
|
| 136 | - |
|
| 137 | - array( |
|
| 138 | - 'name' => __('Add listing page', 'geodirectory'), |
|
| 139 | - 'desc' => __('Select the page to use for adding listings', 'geodirectory'), |
|
| 140 | - 'id' => 'geodir_add_listing_page', |
|
| 141 | - 'type' => 'single_select_page', |
|
| 142 | - 'class' => 'chosen_select' |
|
| 143 | - ), |
|
| 144 | - |
|
| 145 | - array( |
|
| 146 | - 'name' => __('Listing preview page', 'geodirectory'), |
|
| 147 | - 'desc' => __('Select the page to use for listing preview', 'geodirectory'), |
|
| 148 | - 'id' => 'geodir_preview_page', |
|
| 149 | - 'type' => 'single_select_page', |
|
| 150 | - 'class' => 'chosen_select' |
|
| 151 | - ), |
|
| 152 | - |
|
| 153 | - array( |
|
| 154 | - 'name' => __('Listing success page', 'geodirectory'), |
|
| 155 | - 'desc' => __('Select the page to use for listing success', 'geodirectory'), |
|
| 156 | - 'id' => 'geodir_success_page', |
|
| 157 | - 'type' => 'single_select_page', |
|
| 158 | - 'class' => 'chosen_select' |
|
| 159 | - ), |
|
| 160 | - |
|
| 161 | - array( |
|
| 162 | - 'name' => __('Location page', 'geodirectory'), |
|
| 163 | - 'desc' => __('Select the page to use for locations', 'geodirectory'), |
|
| 164 | - 'id' => 'geodir_location_page', |
|
| 165 | - 'type' => 'single_select_page', |
|
| 166 | - 'class' => 'chosen_select' |
|
| 167 | - ), |
|
| 168 | - |
|
| 169 | - array( |
|
| 170 | - 'name' => __('Terms and Conditions page', 'geodirectory'), |
|
| 171 | - 'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'), |
|
| 172 | - 'id' => 'geodir_term_condition_page', |
|
| 173 | - 'type' => 'single_select_page', |
|
| 174 | - 'class' => 'chosen_select' |
|
| 175 | - ), |
|
| 176 | - |
|
| 177 | - array( |
|
| 178 | - 'name' => __('Info page', 'geodirectory'), |
|
| 179 | - 'desc' => __('Select the page to use for Gd general Info', 'geodirectory'), |
|
| 180 | - 'id' => 'geodir_info_page', |
|
| 181 | - 'type' => 'single_select_page', |
|
| 182 | - 'class' => 'chosen_select' |
|
| 183 | - ), |
|
| 184 | - |
|
| 185 | - array( |
|
| 186 | - 'name' => __('Login page', 'geodirectory'), |
|
| 187 | - 'desc' => __('Select the page to use for Login / Register', 'geodirectory'), |
|
| 188 | - 'id' => 'geodir_login_page', |
|
| 189 | - 'type' => 'single_select_page', |
|
| 190 | - 'class' => 'chosen_select' |
|
| 191 | - ), |
|
| 192 | - |
|
| 193 | - |
|
| 194 | - array('type' => 'sectionend', 'id' => 'geodir_pages'), |
|
| 195 | - |
|
| 196 | - /* Listing Detail Permalink Settings End */ |
|
| 19 | + /* Listing Permalink Settings start */ |
|
| 20 | + array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '), |
|
| 21 | + |
|
| 22 | + |
|
| 23 | + array('name' => __('Listing Detail Permalink Settings', 'geodirectory'), |
|
| 24 | + 'type' => 'sectionstart', |
|
| 25 | + 'desc' => '', |
|
| 26 | + 'id' => 'geodir_permalink'), |
|
| 27 | + |
|
| 28 | + array( |
|
| 29 | + 'name' => __('Add location in urls', 'geodirectory'), |
|
| 30 | + 'desc' => __('Add location slug in listing urls', 'geodirectory'), |
|
| 31 | + 'id' => 'geodir_add_location_url', |
|
| 32 | + 'type' => 'checkbox', |
|
| 33 | + 'std' => '1', |
|
| 34 | + 'checkboxgroup' => 'start' |
|
| 35 | + ), |
|
| 36 | + |
|
| 37 | + array( |
|
| 38 | + 'name' => __('Add full location in listing urls', 'geodirectory'), |
|
| 39 | + 'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'), |
|
| 40 | + 'id' => 'geodir_show_location_url', |
|
| 41 | + 'type' => 'radio', |
|
| 42 | + 'value' => 'all', |
|
| 43 | + 'std' => 'all', |
|
| 44 | + 'radiogroup' => '' |
|
| 45 | + ), |
|
| 46 | + |
|
| 47 | + array( |
|
| 48 | + 'name' => __('Add country and city slug in listing urls', 'geodirectory'), |
|
| 49 | + 'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'), |
|
| 50 | + 'id' => 'geodir_show_location_url', |
|
| 51 | + 'type' => 'radio', |
|
| 52 | + 'std' => 'all', |
|
| 53 | + 'value' => 'country_city', |
|
| 54 | + 'radiogroup' => '' |
|
| 55 | + ), |
|
| 56 | + array( |
|
| 57 | + 'name' => __('Add region and city slug in listing urls', 'geodirectory'), |
|
| 58 | + 'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'), |
|
| 59 | + 'id' => 'geodir_show_location_url', |
|
| 60 | + 'type' => 'radio', |
|
| 61 | + 'std' => 'all', |
|
| 62 | + 'value' => 'region_city', |
|
| 63 | + 'radiogroup' => '' |
|
| 64 | + ), |
|
| 65 | + array( |
|
| 66 | + 'name' => __('Add only city in listing urls', 'geodirectory'), |
|
| 67 | + 'desc' => __('Add city slug in listing urls', 'geodirectory'), |
|
| 68 | + 'id' => 'geodir_show_location_url', |
|
| 69 | + 'type' => 'radio', |
|
| 70 | + 'std' => 'all', |
|
| 71 | + 'value' => 'city', |
|
| 72 | + 'radiogroup' => 'end' |
|
| 73 | + ), |
|
| 74 | + |
|
| 75 | + |
|
| 76 | + |
|
| 77 | + array( |
|
| 78 | + 'name' => __('Add category in listing urls', 'geodirectory'), |
|
| 79 | + 'desc' => __('Add requested category slugs in listing urls', 'geodirectory'), |
|
| 80 | + 'id' => 'geodir_add_categories_url', |
|
| 81 | + 'type' => 'checkbox', |
|
| 82 | + 'std' => '1', |
|
| 83 | + ), |
|
| 84 | + |
|
| 85 | + array( |
|
| 86 | + 'name' => __('Listing url prefix', 'geodirectory'), |
|
| 87 | + 'desc' => __('Listing prefix to show in url', 'geodirectory'), |
|
| 88 | + 'id' => 'geodir_listing_prefix', |
|
| 89 | + 'type' => 'text', |
|
| 90 | + 'css' => 'min-width:300px;', |
|
| 91 | + 'std' => 'places' |
|
| 92 | + ), |
|
| 93 | + |
|
| 94 | + array( |
|
| 95 | + 'name' => __('Location url prefix', 'geodirectory'), |
|
| 96 | + 'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'), |
|
| 97 | + 'id' => 'geodir_location_prefix', |
|
| 98 | + 'type' => 'text', |
|
| 99 | + 'css' => 'min-width:300px;', |
|
| 100 | + 'std' => 'location' // Default value to show home top section |
|
| 101 | + ), |
|
| 102 | + |
|
| 103 | + array( |
|
| 104 | + 'name' => __('Location and category url separator', 'geodirectory'), |
|
| 105 | + 'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'), |
|
| 106 | + 'id' => 'geodir_listingurl_separator', |
|
| 107 | + 'type' => 'text', |
|
| 108 | + 'css' => 'min-width:300px;', |
|
| 109 | + 'std' => 'C' // Default value to show home top section |
|
| 110 | + ), |
|
| 111 | + |
|
| 112 | + array( |
|
| 113 | + 'name' => __('Listing detail url separator', 'geodirectory'), |
|
| 114 | + 'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'), |
|
| 115 | + 'id' => 'geodir_detailurl_separator', |
|
| 116 | + 'type' => 'text', |
|
| 117 | + 'css' => 'min-width:300px;', |
|
| 118 | + 'std' => 'info' // Default value to show home top section |
|
| 119 | + ), |
|
| 120 | + |
|
| 121 | + |
|
| 122 | + array('type' => 'sectionend', 'id' => 'geodir_permalink'), |
|
| 123 | + |
|
| 124 | + array('name' => __('GeoDirectory Pages', 'geodirectory'), |
|
| 125 | + 'type' => 'sectionstart', |
|
| 126 | + 'desc' => '', |
|
| 127 | + 'id' => 'geodir_pages'), |
|
| 128 | + |
|
| 129 | + array( |
|
| 130 | + 'name' => __('GD Home page', 'geodirectory'), |
|
| 131 | + 'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'), |
|
| 132 | + 'id' => 'geodir_home_page', |
|
| 133 | + 'type' => 'single_select_page', |
|
| 134 | + 'class' => 'chosen_select' |
|
| 135 | + ), |
|
| 136 | + |
|
| 137 | + array( |
|
| 138 | + 'name' => __('Add listing page', 'geodirectory'), |
|
| 139 | + 'desc' => __('Select the page to use for adding listings', 'geodirectory'), |
|
| 140 | + 'id' => 'geodir_add_listing_page', |
|
| 141 | + 'type' => 'single_select_page', |
|
| 142 | + 'class' => 'chosen_select' |
|
| 143 | + ), |
|
| 144 | + |
|
| 145 | + array( |
|
| 146 | + 'name' => __('Listing preview page', 'geodirectory'), |
|
| 147 | + 'desc' => __('Select the page to use for listing preview', 'geodirectory'), |
|
| 148 | + 'id' => 'geodir_preview_page', |
|
| 149 | + 'type' => 'single_select_page', |
|
| 150 | + 'class' => 'chosen_select' |
|
| 151 | + ), |
|
| 152 | + |
|
| 153 | + array( |
|
| 154 | + 'name' => __('Listing success page', 'geodirectory'), |
|
| 155 | + 'desc' => __('Select the page to use for listing success', 'geodirectory'), |
|
| 156 | + 'id' => 'geodir_success_page', |
|
| 157 | + 'type' => 'single_select_page', |
|
| 158 | + 'class' => 'chosen_select' |
|
| 159 | + ), |
|
| 160 | + |
|
| 161 | + array( |
|
| 162 | + 'name' => __('Location page', 'geodirectory'), |
|
| 163 | + 'desc' => __('Select the page to use for locations', 'geodirectory'), |
|
| 164 | + 'id' => 'geodir_location_page', |
|
| 165 | + 'type' => 'single_select_page', |
|
| 166 | + 'class' => 'chosen_select' |
|
| 167 | + ), |
|
| 168 | + |
|
| 169 | + array( |
|
| 170 | + 'name' => __('Terms and Conditions page', 'geodirectory'), |
|
| 171 | + 'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'), |
|
| 172 | + 'id' => 'geodir_term_condition_page', |
|
| 173 | + 'type' => 'single_select_page', |
|
| 174 | + 'class' => 'chosen_select' |
|
| 175 | + ), |
|
| 176 | + |
|
| 177 | + array( |
|
| 178 | + 'name' => __('Info page', 'geodirectory'), |
|
| 179 | + 'desc' => __('Select the page to use for Gd general Info', 'geodirectory'), |
|
| 180 | + 'id' => 'geodir_info_page', |
|
| 181 | + 'type' => 'single_select_page', |
|
| 182 | + 'class' => 'chosen_select' |
|
| 183 | + ), |
|
| 184 | + |
|
| 185 | + array( |
|
| 186 | + 'name' => __('Login page', 'geodirectory'), |
|
| 187 | + 'desc' => __('Select the page to use for Login / Register', 'geodirectory'), |
|
| 188 | + 'id' => 'geodir_login_page', |
|
| 189 | + 'type' => 'single_select_page', |
|
| 190 | + 'class' => 'chosen_select' |
|
| 191 | + ), |
|
| 192 | + |
|
| 193 | + |
|
| 194 | + array('type' => 'sectionend', 'id' => 'geodir_pages'), |
|
| 195 | + |
|
| 196 | + /* Listing Detail Permalink Settings End */ |
|
| 197 | 197 | |
| 198 | 198 | |
| 199 | 199 | )); // End Design settings |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function geodir_divi_signup_body_class($classes) |
| 20 | 20 | { |
| 21 | - if (geodir_is_page('login')) { |
|
| 22 | - $classes = str_replace('et_right_sidebar', 'et_full_width_page', $classes); |
|
| 23 | - $classes[] = 'divi-gd-signup'; |
|
| 24 | - } |
|
| 25 | - return $classes; |
|
| 21 | + if (geodir_is_page('login')) { |
|
| 22 | + $classes = str_replace('et_right_sidebar', 'et_full_width_page', $classes); |
|
| 23 | + $classes[] = 'divi-gd-signup'; |
|
| 24 | + } |
|
| 25 | + return $classes; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | add_action('geodir_wrapper_close', 'geodir_divi_action_wrapper_close', 11); |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function geodir_divi_action_wrapper_close() |
| 36 | 36 | { |
| 37 | - if (geodir_is_page('login')) { |
|
| 38 | - // We need to close extra divs generated by WRAPPER BEFORE MAIN CONTENT (below) because there is no sidebar on this page |
|
| 39 | - echo '</div></div>'; |
|
| 40 | - } |
|
| 37 | + if (geodir_is_page('login')) { |
|
| 38 | + // We need to close extra divs generated by WRAPPER BEFORE MAIN CONTENT (below) because there is no sidebar on this page |
|
| 39 | + echo '</div></div>'; |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | \ No newline at end of file |
@@ -19,60 +19,60 @@ discard block |
||
| 19 | 19 | function geodir_x_action_calls() |
| 20 | 20 | { |
| 21 | 21 | |
| 22 | - /* ACTIONS |
|
| 22 | + /* ACTIONS |
|
| 23 | 23 | ****************************************************************************************/ |
| 24 | 24 | |
| 25 | - // Add body class for styling purposes |
|
| 26 | - add_filter('body_class', 'geodir_x_body_class'); |
|
| 25 | + // Add body class for styling purposes |
|
| 26 | + add_filter('body_class', 'geodir_x_body_class'); |
|
| 27 | 27 | |
| 28 | - // HOME TOP SIDEBAR |
|
| 29 | - //remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
| 30 | - //remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
| 31 | - //add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 ); |
|
| 32 | - add_action('geodir_before_search_form', 'geodir_x_search_container_open'); |
|
| 33 | - add_action('geodir_after_search_form', 'geodir_x_search_container_close'); |
|
| 28 | + // HOME TOP SIDEBAR |
|
| 29 | + //remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
| 30 | + //remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
| 31 | + //add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 ); |
|
| 32 | + add_action('geodir_before_search_form', 'geodir_x_search_container_open'); |
|
| 33 | + add_action('geodir_after_search_form', 'geodir_x_search_container_close'); |
|
| 34 | 34 | |
| 35 | - // WRAPPER OPEN ACTIONS |
|
| 36 | - remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10); |
|
| 37 | - add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9); |
|
| 35 | + // WRAPPER OPEN ACTIONS |
|
| 36 | + remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10); |
|
| 37 | + add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9); |
|
| 38 | 38 | |
| 39 | - // WRAPPER CLOSE ACTIONS |
|
| 40 | - remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10); |
|
| 41 | - add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11); |
|
| 39 | + // WRAPPER CLOSE ACTIONS |
|
| 40 | + remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10); |
|
| 41 | + add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11); |
|
| 42 | 42 | |
| 43 | - // WRAPPER CONTENT OPEN ACTIONS |
|
| 44 | - remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10); |
|
| 45 | - add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3); |
|
| 43 | + // WRAPPER CONTENT OPEN ACTIONS |
|
| 44 | + remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10); |
|
| 45 | + add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3); |
|
| 46 | 46 | |
| 47 | - // WRAPPER CONTENT CLOSE ACTIONS |
|
| 48 | - remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10); |
|
| 49 | - add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11); |
|
| 47 | + // WRAPPER CONTENT CLOSE ACTIONS |
|
| 48 | + remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10); |
|
| 49 | + add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11); |
|
| 50 | 50 | |
| 51 | - // SIDEBAR RIGHT OPEN ACTIONS |
|
| 52 | - remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10); |
|
| 53 | - add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4); |
|
| 51 | + // SIDEBAR RIGHT OPEN ACTIONS |
|
| 52 | + remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10); |
|
| 53 | + add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4); |
|
| 54 | 54 | |
| 55 | - // SIDEBAR RIGHT CLOSE ACTIONS |
|
| 56 | - remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10); |
|
| 57 | - add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1); |
|
| 55 | + // SIDEBAR RIGHT CLOSE ACTIONS |
|
| 56 | + remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10); |
|
| 57 | + add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1); |
|
| 58 | 58 | |
| 59 | - // REMOVE BREADCRUMBS |
|
| 60 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
| 61 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
| 62 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
| 63 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
| 64 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
| 65 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
| 59 | + // REMOVE BREADCRUMBS |
|
| 60 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
| 61 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
| 62 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
| 63 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
| 64 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
| 65 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
| 66 | 66 | |
| 67 | - // make top section wide |
|
| 68 | - remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
| 69 | - remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
| 70 | - remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
| 71 | - remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
| 72 | - remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
| 73 | - remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
| 67 | + // make top section wide |
|
| 68 | + remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
| 69 | + remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
| 70 | + remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
| 71 | + remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
| 72 | + remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
| 73 | + remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
| 74 | 74 | |
| 75 | - add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5); |
|
| 75 | + add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5); |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | } // Close geodir_x_action_calls |
@@ -89,17 +89,17 @@ discard block |
||
| 89 | 89 | function gd_X_compat_add_top_section_back() |
| 90 | 90 | { |
| 91 | 91 | |
| 92 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 93 | - geodir_action_geodir_sidebar_home_top(); |
|
| 94 | - } elseif (geodir_is_page('listing')) { |
|
| 95 | - geodir_action_geodir_sidebar_listings_top(); |
|
| 96 | - } elseif (geodir_is_page('detail')) { |
|
| 97 | - geodir_action_geodir_sidebar_detail_top(); |
|
| 98 | - } elseif (geodir_is_page('search')) { |
|
| 99 | - geodir_action_geodir_sidebar_search_top(); |
|
| 100 | - } elseif (geodir_is_page('author')) { |
|
| 101 | - geodir_action_geodir_sidebar_author_top(); |
|
| 102 | - } |
|
| 92 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
| 93 | + geodir_action_geodir_sidebar_home_top(); |
|
| 94 | + } elseif (geodir_is_page('listing')) { |
|
| 95 | + geodir_action_geodir_sidebar_listings_top(); |
|
| 96 | + } elseif (geodir_is_page('detail')) { |
|
| 97 | + geodir_action_geodir_sidebar_detail_top(); |
|
| 98 | + } elseif (geodir_is_page('search')) { |
|
| 99 | + geodir_action_geodir_sidebar_search_top(); |
|
| 100 | + } elseif (geodir_is_page('author')) { |
|
| 101 | + geodir_action_geodir_sidebar_author_top(); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | } |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | function geodir_x_body_class($classes) |
| 119 | 119 | { |
| 120 | - $classes[] = 'geodir-x'; |
|
| 121 | - return $classes; |
|
| 120 | + $classes[] = 'geodir-x'; |
|
| 121 | + return $classes; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -130,14 +130,14 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | function geodir_x_home_sidebar() |
| 132 | 132 | { |
| 133 | - //if ( geodir_is_geodir_page() ) { |
|
| 134 | - global $wp; |
|
| 135 | - if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) { |
|
| 136 | - echo '<div class="x-main full">'; |
|
| 137 | - dynamic_sidebar('geodir_home_top'); |
|
| 138 | - echo '</div>'; |
|
| 139 | - } |
|
| 140 | - //} |
|
| 133 | + //if ( geodir_is_geodir_page() ) { |
|
| 134 | + global $wp; |
|
| 135 | + if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) { |
|
| 136 | + echo '<div class="x-main full">'; |
|
| 137 | + dynamic_sidebar('geodir_home_top'); |
|
| 138 | + echo '</div>'; |
|
| 139 | + } |
|
| 140 | + //} |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | function geodir_x_search_container_open() |
| 150 | 150 | { |
| 151 | - echo '<div class="x-container-fluid x-container max">'; |
|
| 151 | + echo '<div class="x-container-fluid x-container max">'; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function geodir_x_search_container_close() |
| 161 | 161 | { |
| 162 | - echo '</div>'; |
|
| 162 | + echo '</div>'; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -170,16 +170,16 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | function geodir_x_action_wrapper_open() |
| 172 | 172 | { |
| 173 | - global $stack; |
|
| 174 | - if ($stack == 'integrity') { |
|
| 175 | - echo '<div class="x-container-fluid x-container max width offset">'; |
|
| 176 | - } elseif ($stack == 'renew') { |
|
| 177 | - echo '<div class="x-container-fluid x-container max width offset cf">'; |
|
| 178 | - } elseif ($stack == 'icon') { |
|
| 179 | - echo '<div class="x-main full" role="main">'; |
|
| 180 | - } elseif ($stack == 'ethos') { |
|
| 181 | - echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">'; |
|
| 182 | - } |
|
| 173 | + global $stack; |
|
| 174 | + if ($stack == 'integrity') { |
|
| 175 | + echo '<div class="x-container-fluid x-container max width offset">'; |
|
| 176 | + } elseif ($stack == 'renew') { |
|
| 177 | + echo '<div class="x-container-fluid x-container max width offset cf">'; |
|
| 178 | + } elseif ($stack == 'icon') { |
|
| 179 | + echo '<div class="x-main full" role="main">'; |
|
| 180 | + } elseif ($stack == 'ethos') { |
|
| 181 | + echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">'; |
|
| 182 | + } |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** |
@@ -190,12 +190,12 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | function geodir_x_action_wrapper_close() |
| 192 | 192 | { |
| 193 | - global $stack; |
|
| 194 | - if ($stack == 'ethos') { |
|
| 195 | - echo '</div></div>'; |
|
| 196 | - } else { |
|
| 197 | - echo '</div>'; |
|
| 198 | - } |
|
| 193 | + global $stack; |
|
| 194 | + if ($stack == 'ethos') { |
|
| 195 | + echo '</div></div>'; |
|
| 196 | + } else { |
|
| 197 | + echo '</div>'; |
|
| 198 | + } |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | function geodir_x_action_wrapper_content_open($type = '', $id = '', $class = '') |
| 211 | 211 | { |
| 212 | - echo '<div class="x-main left ' . $class . '" role="main">'; |
|
| 212 | + echo '<div class="x-main left ' . $class . '" role="main">'; |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | function geodir_x_action_wrapper_content_close() |
| 222 | 222 | { |
| 223 | - echo '</div>'; |
|
| 223 | + echo '</div>'; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | function geodir_x_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
| 237 | 237 | { |
| 238 | - echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">'; |
|
| 238 | + echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">'; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | function geodir_x_action_sidebar_right_close($type = '') |
| 249 | 249 | { |
| 250 | - echo '</aside>'; |
|
| 250 | + echo '</aside>'; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | add_filter('geodir_breadcrumb', 'geodir_x_breadcrumb'); |
@@ -261,12 +261,12 @@ discard block |
||
| 261 | 261 | */ |
| 262 | 262 | function geodir_x_breadcrumb($breadcrumb) |
| 263 | 263 | { |
| 264 | - $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb); |
|
| 265 | - $breadcrumb = str_replace('<li>', '', $breadcrumb); |
|
| 266 | - $breadcrumb = str_replace('</li>', '', $breadcrumb); |
|
| 267 | - $breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb); |
|
| 268 | - $breadcrumb = str_replace('</ul></div>', '', $breadcrumb); |
|
| 269 | - return $breadcrumb; |
|
| 264 | + $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb); |
|
| 265 | + $breadcrumb = str_replace('<li>', '', $breadcrumb); |
|
| 266 | + $breadcrumb = str_replace('</li>', '', $breadcrumb); |
|
| 267 | + $breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb); |
|
| 268 | + $breadcrumb = str_replace('</ul></div>', '', $breadcrumb); |
|
| 269 | + return $breadcrumb; |
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | add_filter('geodir_breadcrumb_separator', 'geodir_x_breadcrumb_separator'); |
@@ -280,125 +280,125 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | function geodir_x_breadcrumb_separator($separator) |
| 282 | 282 | { |
| 283 | - $separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator); |
|
| 284 | - return $separator; |
|
| 283 | + $separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator); |
|
| 284 | + return $separator; |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | if (!function_exists('x_breadcrumbs')) : |
| 288 | - /** |
|
| 289 | - * breadcrumbs. |
|
| 290 | - * |
|
| 291 | - * @since 1.0.0 |
|
| 292 | - * @package GeoDirectory |
|
| 293 | - */ |
|
| 294 | - function x_breadcrumbs() |
|
| 295 | - { |
|
| 296 | - |
|
| 297 | - if (x_get_option('x_breadcrumb_display', '1')) { |
|
| 298 | - |
|
| 299 | - // |
|
| 300 | - // 1. Delimiter between crumbs. |
|
| 301 | - // 2. Output text for the "Home" link. |
|
| 302 | - // 3. Link to the home page. |
|
| 303 | - // 4. Tag before the current crumb. |
|
| 304 | - // 5. Tag after the current crumb. |
|
| 305 | - // 6. Get page title. |
|
| 306 | - // 7. Get blog title. |
|
| 307 | - // 8. Get shop title. |
|
| 308 | - // |
|
| 309 | - |
|
| 310 | - GLOBAL $post,$wp; |
|
| 311 | - |
|
| 312 | - if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) { |
|
| 313 | - geodir_breadcrumb(); |
|
| 314 | - } else { |
|
| 315 | - |
|
| 316 | - $stack = x_get_stack(); |
|
| 317 | - $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1 |
|
| 318 | - $home_text = '<span class="home"><i class="x-icon-home"></i></span>'; // 2 |
|
| 319 | - $home_link = home_url(); // 3 |
|
| 320 | - $current_before = '<span class="current">'; // 4 |
|
| 321 | - $current_after = '</span>'; // 5 |
|
| 322 | - $page_title = get_the_title(); // 6 |
|
| 323 | - $blog_title = get_the_title(get_option('page_for_posts', true)); // 7 |
|
| 324 | - $shop_title = get_theme_mod('x_' . $stack . '_shop_title'); // 8 |
|
| 325 | - |
|
| 326 | - if (function_exists('woocommerce_get_page_id')) { |
|
| 327 | - $shop_url = x_get_shop_link(); |
|
| 328 | - $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>'; |
|
| 329 | - } |
|
| 330 | - |
|
| 331 | - if (is_front_page()) { |
|
| 332 | - echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>'; |
|
| 333 | - } elseif (is_home()) { |
|
| 334 | - echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>'; |
|
| 335 | - } else { |
|
| 336 | - echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter; |
|
| 337 | - if (is_category()) { |
|
| 338 | - $the_cat = get_category(get_query_var('cat'), false); |
|
| 339 | - if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter); |
|
| 340 | - echo $current_before . single_cat_title('', false) . $current_after; |
|
| 341 | - } elseif (x_is_product_category()) { |
|
| 342 | - echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after; |
|
| 343 | - } elseif (x_is_product_tag()) { |
|
| 344 | - echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after; |
|
| 345 | - } elseif (is_search()) { |
|
| 346 | - echo $current_before . __('Search Results for ', '__x__') . '“' . get_search_query() . '”' . $current_after; |
|
| 347 | - } elseif (is_singular('post')) { |
|
| 348 | - if (get_option('page_for_posts') == is_front_page()) { |
|
| 349 | - echo $current_before . $page_title . $current_after; |
|
| 350 | - } else { |
|
| 351 | - echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
| 352 | - } |
|
| 353 | - } elseif (x_is_portfolio()) { |
|
| 354 | - echo $current_before . get_the_title() . $current_after; |
|
| 355 | - } elseif (x_is_portfolio_item()) { |
|
| 356 | - $link = x_get_parent_portfolio_link(); |
|
| 357 | - $title = x_get_parent_portfolio_title(); |
|
| 358 | - echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
| 359 | - } elseif (x_is_product()) { |
|
| 360 | - echo $shop_link . $delimiter . $current_before . $page_title . $current_after; |
|
| 361 | - } elseif (is_page() && !$post->post_parent) { |
|
| 362 | - echo $current_before . $page_title . $current_after; |
|
| 363 | - } elseif (is_page() && $post->post_parent) { |
|
| 364 | - $parent_id = $post->post_parent; |
|
| 365 | - $breadcrumbs = array(); |
|
| 366 | - while ($parent_id) { |
|
| 367 | - $page = get_page($parent_id); |
|
| 368 | - $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>'; |
|
| 369 | - $parent_id = $page->post_parent; |
|
| 370 | - } |
|
| 371 | - $breadcrumbs = array_reverse($breadcrumbs); |
|
| 372 | - for ($i = 0; $i < count($breadcrumbs); $i++) { |
|
| 373 | - echo $breadcrumbs[$i]; |
|
| 374 | - if ($i != count($breadcrumbs) - 1) echo $delimiter; |
|
| 375 | - } |
|
| 376 | - echo $delimiter . $current_before . $page_title . $current_after; |
|
| 377 | - } elseif (is_tag()) { |
|
| 378 | - echo $current_before . single_tag_title('', false) . $current_after; |
|
| 379 | - } elseif (is_author()) { |
|
| 380 | - GLOBAL $author; |
|
| 381 | - $userdata = get_userdata($author); |
|
| 382 | - echo $current_before . __('Posts by ', '__x__') . '“' . $userdata->display_name . $current_after . '”'; |
|
| 383 | - } elseif (is_404()) { |
|
| 384 | - echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after; |
|
| 385 | - } elseif (is_archive()) { |
|
| 386 | - if (x_is_shop()) { |
|
| 387 | - echo $current_before . $shop_title . $current_after; |
|
| 388 | - } else { |
|
| 389 | - echo $current_before . __('Archives ', '__x__') . $current_after; |
|
| 390 | - } |
|
| 391 | - } |
|
| 392 | - if (get_query_var('paged')) { |
|
| 393 | - echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>'; |
|
| 394 | - } |
|
| 395 | - echo '</div>'; |
|
| 396 | - } |
|
| 397 | - |
|
| 398 | - } |
|
| 399 | - |
|
| 400 | - } |
|
| 401 | - } // ends my geodir check |
|
| 288 | + /** |
|
| 289 | + * breadcrumbs. |
|
| 290 | + * |
|
| 291 | + * @since 1.0.0 |
|
| 292 | + * @package GeoDirectory |
|
| 293 | + */ |
|
| 294 | + function x_breadcrumbs() |
|
| 295 | + { |
|
| 296 | + |
|
| 297 | + if (x_get_option('x_breadcrumb_display', '1')) { |
|
| 298 | + |
|
| 299 | + // |
|
| 300 | + // 1. Delimiter between crumbs. |
|
| 301 | + // 2. Output text for the "Home" link. |
|
| 302 | + // 3. Link to the home page. |
|
| 303 | + // 4. Tag before the current crumb. |
|
| 304 | + // 5. Tag after the current crumb. |
|
| 305 | + // 6. Get page title. |
|
| 306 | + // 7. Get blog title. |
|
| 307 | + // 8. Get shop title. |
|
| 308 | + // |
|
| 309 | + |
|
| 310 | + GLOBAL $post,$wp; |
|
| 311 | + |
|
| 312 | + if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) { |
|
| 313 | + geodir_breadcrumb(); |
|
| 314 | + } else { |
|
| 315 | + |
|
| 316 | + $stack = x_get_stack(); |
|
| 317 | + $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1 |
|
| 318 | + $home_text = '<span class="home"><i class="x-icon-home"></i></span>'; // 2 |
|
| 319 | + $home_link = home_url(); // 3 |
|
| 320 | + $current_before = '<span class="current">'; // 4 |
|
| 321 | + $current_after = '</span>'; // 5 |
|
| 322 | + $page_title = get_the_title(); // 6 |
|
| 323 | + $blog_title = get_the_title(get_option('page_for_posts', true)); // 7 |
|
| 324 | + $shop_title = get_theme_mod('x_' . $stack . '_shop_title'); // 8 |
|
| 325 | + |
|
| 326 | + if (function_exists('woocommerce_get_page_id')) { |
|
| 327 | + $shop_url = x_get_shop_link(); |
|
| 328 | + $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>'; |
|
| 329 | + } |
|
| 330 | + |
|
| 331 | + if (is_front_page()) { |
|
| 332 | + echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>'; |
|
| 333 | + } elseif (is_home()) { |
|
| 334 | + echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>'; |
|
| 335 | + } else { |
|
| 336 | + echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter; |
|
| 337 | + if (is_category()) { |
|
| 338 | + $the_cat = get_category(get_query_var('cat'), false); |
|
| 339 | + if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter); |
|
| 340 | + echo $current_before . single_cat_title('', false) . $current_after; |
|
| 341 | + } elseif (x_is_product_category()) { |
|
| 342 | + echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after; |
|
| 343 | + } elseif (x_is_product_tag()) { |
|
| 344 | + echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after; |
|
| 345 | + } elseif (is_search()) { |
|
| 346 | + echo $current_before . __('Search Results for ', '__x__') . '“' . get_search_query() . '”' . $current_after; |
|
| 347 | + } elseif (is_singular('post')) { |
|
| 348 | + if (get_option('page_for_posts') == is_front_page()) { |
|
| 349 | + echo $current_before . $page_title . $current_after; |
|
| 350 | + } else { |
|
| 351 | + echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
| 352 | + } |
|
| 353 | + } elseif (x_is_portfolio()) { |
|
| 354 | + echo $current_before . get_the_title() . $current_after; |
|
| 355 | + } elseif (x_is_portfolio_item()) { |
|
| 356 | + $link = x_get_parent_portfolio_link(); |
|
| 357 | + $title = x_get_parent_portfolio_title(); |
|
| 358 | + echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
| 359 | + } elseif (x_is_product()) { |
|
| 360 | + echo $shop_link . $delimiter . $current_before . $page_title . $current_after; |
|
| 361 | + } elseif (is_page() && !$post->post_parent) { |
|
| 362 | + echo $current_before . $page_title . $current_after; |
|
| 363 | + } elseif (is_page() && $post->post_parent) { |
|
| 364 | + $parent_id = $post->post_parent; |
|
| 365 | + $breadcrumbs = array(); |
|
| 366 | + while ($parent_id) { |
|
| 367 | + $page = get_page($parent_id); |
|
| 368 | + $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>'; |
|
| 369 | + $parent_id = $page->post_parent; |
|
| 370 | + } |
|
| 371 | + $breadcrumbs = array_reverse($breadcrumbs); |
|
| 372 | + for ($i = 0; $i < count($breadcrumbs); $i++) { |
|
| 373 | + echo $breadcrumbs[$i]; |
|
| 374 | + if ($i != count($breadcrumbs) - 1) echo $delimiter; |
|
| 375 | + } |
|
| 376 | + echo $delimiter . $current_before . $page_title . $current_after; |
|
| 377 | + } elseif (is_tag()) { |
|
| 378 | + echo $current_before . single_tag_title('', false) . $current_after; |
|
| 379 | + } elseif (is_author()) { |
|
| 380 | + GLOBAL $author; |
|
| 381 | + $userdata = get_userdata($author); |
|
| 382 | + echo $current_before . __('Posts by ', '__x__') . '“' . $userdata->display_name . $current_after . '”'; |
|
| 383 | + } elseif (is_404()) { |
|
| 384 | + echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after; |
|
| 385 | + } elseif (is_archive()) { |
|
| 386 | + if (x_is_shop()) { |
|
| 387 | + echo $current_before . $shop_title . $current_after; |
|
| 388 | + } else { |
|
| 389 | + echo $current_before . __('Archives ', '__x__') . $current_after; |
|
| 390 | + } |
|
| 391 | + } |
|
| 392 | + if (get_query_var('paged')) { |
|
| 393 | + echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>'; |
|
| 394 | + } |
|
| 395 | + echo '</div>'; |
|
| 396 | + } |
|
| 397 | + |
|
| 398 | + } |
|
| 399 | + |
|
| 400 | + } |
|
| 401 | + } // ends my geodir check |
|
| 402 | 402 | endif; |
| 403 | 403 | |
| 404 | 404 | |
@@ -413,8 +413,8 @@ discard block |
||
| 413 | 413 | */ |
| 414 | 414 | function geodir_x_location_switcher_menu_li_class($class) |
| 415 | 415 | { |
| 416 | - $class .= " menu-item-has-children "; |
|
| 417 | - return $class; |
|
| 416 | + $class .= " menu-item-has-children "; |
|
| 417 | + return $class; |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | add_filter('geodir_sub_menu_li_class', 'geodir_x_sub_menu_li_class', 10, 1); |
@@ -428,6 +428,6 @@ discard block |
||
| 428 | 428 | */ |
| 429 | 429 | function geodir_x_sub_menu_li_class($class) |
| 430 | 430 | { |
| 431 | - $class .= " menu-item-has-children "; |
|
| 432 | - return $class; |
|
| 431 | + $class .= " menu-item-has-children "; |
|
| 432 | + return $class; |
|
| 433 | 433 | } |
| 434 | 434 | \ No newline at end of file |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | * If user is not signed in, redirect home. |
| 14 | 14 | */ |
| 15 | 15 | if (get_current_user_id()) { |
| 16 | - wp_redirect(home_url(), 302); |
|
| 17 | - exit; |
|
| 16 | + wp_redirect(home_url(), 302); |
|
| 17 | + exit; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // call header |
@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') {
|
| 13 | - $redirect_to = $_GET['redirect_to']; |
|
| 13 | + $redirect_to = $_GET['redirect_to']; |
|
| 14 | 14 | } else {
|
| 15 | - //echo $_SERVER['HTTP_HOST'] ; |
|
| 16 | - $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 17 | - if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 18 | - $redirect_to = home_url(); |
|
| 19 | - } |
|
| 15 | + //echo $_SERVER['HTTP_HOST'] ; |
|
| 16 | + $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 17 | + if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 18 | + $redirect_to = home_url(); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | |
@@ -38,36 +38,36 @@ discard block |
||
| 38 | 38 | <h4> |
| 39 | 39 | <?php |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Filter the `SIGN_IN_PAGE_TITLE` title text on login form template. |
|
| 43 | - * |
|
| 44 | - * @since 1.0.0 |
|
| 45 | - */ |
|
| 46 | - echo apply_filters('geodir_login_page_title', SIGN_IN_PAGE_TITLE);
|
|
| 41 | + /** |
|
| 42 | + * Filter the `SIGN_IN_PAGE_TITLE` title text on login form template. |
|
| 43 | + * |
|
| 44 | + * @since 1.0.0 |
|
| 45 | + */ |
|
| 46 | + echo apply_filters('geodir_login_page_title', SIGN_IN_PAGE_TITLE);
|
|
| 47 | 47 | |
| 48 | - ?> |
|
| 48 | + ?> |
|
| 49 | 49 | </h4> |
| 50 | 50 | <?php |
| 51 | - if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'fw') {
|
|
| 52 | - echo "<p class=\"error_msg\"> " . INVALID_USER_FPW_MSG . " </p>"; |
|
| 53 | - } elseif (isset($_REQUEST['logemsg']) && $_REQUEST['logemsg'] == 1) {
|
|
| 54 | - echo "<p class=\"error_msg\"> " . INVALID_USER_PW_MSG . " </p>"; |
|
| 55 | - } |
|
| 51 | + if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'fw') {
|
|
| 52 | + echo "<p class=\"error_msg\"> " . INVALID_USER_FPW_MSG . " </p>"; |
|
| 53 | + } elseif (isset($_REQUEST['logemsg']) && $_REQUEST['logemsg'] == 1) {
|
|
| 54 | + echo "<p class=\"error_msg\"> " . INVALID_USER_PW_MSG . " </p>"; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - if (isset($_REQUEST['checkemail']) && $_REQUEST['checkemail'] == 'confirm') |
|
| 58 | - echo '<p class="sucess_msg">' . PW_SEND_CONFIRM_MSG . '</p>'; |
|
| 57 | + if (isset($_REQUEST['checkemail']) && $_REQUEST['checkemail'] == 'confirm') |
|
| 58 | + echo '<p class="sucess_msg">' . PW_SEND_CONFIRM_MSG . '</p>'; |
|
| 59 | 59 | |
| 60 | - ?> |
|
| 60 | + ?> |
|
| 61 | 61 | <form name="cus_loginform" id="cus_loginform" action="<?php echo esc_url(geodir_curPageURL()); ?>" |
| 62 | 62 | method="post"> |
| 63 | 63 | |
| 64 | 64 | <div class="form_row clearfix"> |
| 65 | 65 | <input placeholder='<?php echo USERNAME_TEXT; ?>' type="text" name="log" id="user_login" |
| 66 | 66 | value="<?php global $user_login; |
| 67 | - if (!isset($user_login)) {
|
|
| 68 | - $user_login = ''; |
|
| 69 | - } |
|
| 70 | - echo esc_attr($user_login); ?>" size="20" class="textfield"/> |
|
| 67 | + if (!isset($user_login)) {
|
|
| 68 | + $user_login = ''; |
|
| 69 | + } |
|
| 70 | + echo esc_attr($user_login); ?>" size="20" class="textfield"/> |
|
| 71 | 71 | <span class="user_loginInfo"></span> |
| 72 | 72 | </div> |
| 73 | 73 | |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | </div> |
| 79 | 79 | |
| 80 | 80 | <?php |
| 81 | - /** |
|
| 82 | - * This is a default WordPress action that calls any additional elements needed for any login forms. |
|
| 83 | - * |
|
| 84 | - * We use this action before the remember me checkbox on the sigin form. |
|
| 85 | - * |
|
| 86 | - * @since 1.0.0 |
|
| 87 | - */ |
|
| 88 | - do_action('login_form'); ?>
|
|
| 81 | + /** |
|
| 82 | + * This is a default WordPress action that calls any additional elements needed for any login forms. |
|
| 83 | + * |
|
| 84 | + * We use this action before the remember me checkbox on the sigin form. |
|
| 85 | + * |
|
| 86 | + * @since 1.0.0 |
|
| 87 | + */ |
|
| 88 | + do_action('login_form'); ?>
|
|
| 89 | 89 | <p class="rember"> |
| 90 | 90 | <input name="rememberme" type="checkbox" id="rememberme" value="forever" class="fl"/> |
| 91 | 91 | <?php echo REMEMBER_ON_COMPUTER_TEXT; ?> |
@@ -109,12 +109,12 @@ discard block |
||
| 109 | 109 | <input placeholder='<?php echo USERNAME_EMAIL_TEXT; ?>' type="text" name="user_login" |
| 110 | 110 | value="<?php echo esc_attr($user_login); ?>" size="20" class="user_login1 textfield"/> |
| 111 | 111 | <?php |
| 112 | - /** |
|
| 113 | - * Called before the get new password button in the login box template. |
|
| 114 | - * |
|
| 115 | - * @since 1.0.0 |
|
| 116 | - */ |
|
| 117 | - do_action('lostpassword_form'); ?>
|
|
| 112 | + /** |
|
| 113 | + * Called before the get new password button in the login box template. |
|
| 114 | + * |
|
| 115 | + * @since 1.0.0 |
|
| 116 | + */ |
|
| 117 | + do_action('lostpassword_form'); ?>
|
|
| 118 | 118 | </div> |
| 119 | 119 | <input type="submit" name="get_new_password" value="<?php echo GET_NEW_PW_TEXT; ?>" class="geodir_button"/> |
| 120 | 120 | </form> |
@@ -15,29 +15,29 @@ discard block |
||
| 15 | 15 | <?php |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - global $wpdb; |
|
| 18 | + global $wpdb; |
|
| 19 | 19 | |
| 20 | - $post_id = $_REQUEST['pid']; |
|
| 21 | - $post_info = get_post($post_id); |
|
| 20 | + $post_id = $_REQUEST['pid']; |
|
| 21 | + $post_info = get_post($post_id); |
|
| 22 | 22 | |
| 23 | - $posted_date = $post_info->post_date; |
|
| 24 | - $productlink = get_permalink($post_id); |
|
| 25 | - $siteName = get_bloginfo('name');
|
|
| 26 | - $siteurl = home_url(); |
|
| 27 | - $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>'; |
|
| 23 | + $posted_date = $post_info->post_date; |
|
| 24 | + $productlink = get_permalink($post_id); |
|
| 25 | + $siteName = get_bloginfo('name');
|
|
| 26 | + $siteurl = home_url(); |
|
| 27 | + $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>'; |
|
| 28 | 28 | |
| 29 | - $loginurl = geodir_login_url(); |
|
| 30 | - $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
| 29 | + $loginurl = geodir_login_url(); |
|
| 30 | + $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
| 31 | 31 | |
| 32 | - $post_author = $post_info->post_author; |
|
| 32 | + $post_author = $post_info->post_author; |
|
| 33 | 33 | |
| 34 | - $user_info = get_userdata($post_author); |
|
| 35 | - $username = $user_info->user_login; |
|
| 36 | - $user_email = $user_info->user_email; |
|
| 34 | + $user_info = get_userdata($post_author); |
|
| 35 | + $username = $user_info->user_login; |
|
| 36 | + $user_email = $user_info->user_email; |
|
| 37 | 37 | |
| 38 | - $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
|
|
| 38 | + $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
|
|
| 39 | 39 | |
| 40 | - /* |
|
| 40 | + /* |
|
| 41 | 41 | * Filter the success page message before variable replacements. |
| 42 | 42 | * |
| 43 | 43 | * @since 1.5.7 |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | * @param object $post_info Post object. |
| 46 | 46 | * @param object $user_info User object. |
| 47 | 47 | */ |
| 48 | - $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
|
|
| 48 | + $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
|
|
| 49 | 49 | |
| 50 | - $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
|
|
| 51 | - $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date); |
|
| 52 | - $message = str_replace($search_array, $replace_array, $message); |
|
| 50 | + $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
|
|
| 51 | + $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date); |
|
| 52 | + $message = str_replace($search_array, $replace_array, $message); |
|
| 53 | 53 | |
| 54 | - /* |
|
| 54 | + /* |
|
| 55 | 55 | * Filter the success page message after variable replacements. |
| 56 | 56 | * |
| 57 | 57 | * @since 1.5.7 |
@@ -59,15 +59,15 @@ discard block |
||
| 59 | 59 | * @param object $post_info Post object. |
| 60 | 60 | * @param object $user_info User object. |
| 61 | 61 | */ |
| 62 | - $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
|
|
| 62 | + $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
|
|
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - ?> |
|
| 66 | + ?> |
|
| 67 | 67 | |
| 68 | 68 | <?php |
| 69 | 69 | |
| 70 | - /* |
|
| 70 | + /* |
|
| 71 | 71 | * Action called before the success page message wrapper. |
| 72 | 72 | * |
| 73 | 73 | * @since 1.5.7 |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | * @param object $post_info Post object. |
| 76 | 76 | * @param object $user_info User object. |
| 77 | 77 | */ |
| 78 | - do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 79 | - echo '<h5 class="geodir_information">'; |
|
| 80 | - echo $message; |
|
| 81 | - echo '</h5>'; |
|
| 82 | - /* |
|
| 78 | + do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 79 | + echo '<h5 class="geodir_information">'; |
|
| 80 | + echo $message; |
|
| 81 | + echo '</h5>'; |
|
| 82 | + /* |
|
| 83 | 83 | * Action called after the success page message wrapper. |
| 84 | 84 | * |
| 85 | 85 | * @since 1.5.7 |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | * @param object $post_info Post object. |
| 88 | 88 | * @param object $user_info User object. |
| 89 | 89 | */ |
| 90 | - do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 90 | + do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 91 | 91 | |
| 92 | - ?> |
|
| 92 | + ?> |
|
| 93 | 93 | |
| 94 | 94 | </div> |
| 95 | 95 | \ No newline at end of file |
@@ -14,160 +14,160 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class geodir_related_listing_postview extends WP_Widget |
| 16 | 16 | { |
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * Register the related listing widget. |
| 19 | 19 | * |
| 20 | 20 | * @since 1.0.0 |
| 21 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 21 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 22 | 22 | */ |
| 23 | - public function __construct() { |
|
| 24 | - $widget_ops = array('classname' => 'geodir_related_listing_post_view', 'description' => __('GD > Related Listing', 'geodirectory')); |
|
| 25 | - parent::__construct( |
|
| 26 | - 'post_related_listing', // Base ID |
|
| 27 | - __('GD > Related Listing', 'geodirectory'), // Name |
|
| 28 | - $widget_ops// Args |
|
| 29 | - ); |
|
| 30 | - } |
|
| 23 | + public function __construct() { |
|
| 24 | + $widget_ops = array('classname' => 'geodir_related_listing_post_view', 'description' => __('GD > Related Listing', 'geodirectory')); |
|
| 25 | + parent::__construct( |
|
| 26 | + 'post_related_listing', // Base ID |
|
| 27 | + __('GD > Related Listing', 'geodirectory'), // Name |
|
| 28 | + $widget_ops// Args |
|
| 29 | + ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Front-end display content for related listing widget. |
| 34 | 34 | * |
| 35 | 35 | * @since 1.0.0 |
| 36 | - * @since 1.5.1 Declare function public. |
|
| 36 | + * @since 1.5.1 Declare function public. |
|
| 37 | 37 | * |
| 38 | 38 | * @param array $args Widget arguments. |
| 39 | 39 | * @param array $instance Saved values from database. |
| 40 | 40 | */ |
| 41 | - public function widget($args, $instance) |
|
| 42 | - { |
|
| 41 | + public function widget($args, $instance) |
|
| 42 | + { |
|
| 43 | 43 | |
| 44 | - // prints the widget |
|
| 45 | - extract($args, EXTR_SKIP); |
|
| 44 | + // prints the widget |
|
| 45 | + extract($args, EXTR_SKIP); |
|
| 46 | 46 | |
| 47 | - /** This filter is documented in geodirectory_widgets.php */ |
|
| 48 | - $title = empty($instance['title']) ? __('Related Listing', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
|
| 47 | + /** This filter is documented in geodirectory_widgets.php */ |
|
| 48 | + $title = empty($instance['title']) ? __('Related Listing', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
|
| 49 | 49 | |
| 50 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 50 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 51 | 51 | $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']); |
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Filter the relation type to get related listing. |
|
| 55 | - * |
|
| 56 | - * @since 1.0.0 |
|
| 57 | - * @param string $instance['relate_to'] Can be tags or category. |
|
| 58 | - */ |
|
| 53 | + /** |
|
| 54 | + * Filter the relation type to get related listing. |
|
| 55 | + * |
|
| 56 | + * @since 1.0.0 |
|
| 57 | + * @param string $instance['relate_to'] Can be tags or category. |
|
| 58 | + */ |
|
| 59 | 59 | $relate_to = empty($instance['relate_to']) ? 'category' : apply_filters('widget_relate_to', $instance['relate_to']); |
| 60 | 60 | |
| 61 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 61 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 62 | 62 | $layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']); |
| 63 | 63 | |
| 64 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 64 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 65 | 65 | $add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']); |
| 66 | 66 | |
| 67 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 67 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 68 | 68 | $listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']); |
| 69 | 69 | |
| 70 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 70 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 71 | 71 | $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']); |
| 72 | 72 | |
| 73 | - /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 73 | + /** This filter is documented in geodirectory-functions/general_functions.php */ |
|
| 74 | 74 | $character_count = empty($instance['character_count']) ? 20 : apply_filters('widget_list_character_count', $instance['character_count']); |
| 75 | 75 | |
| 76 | - $arr = array( |
|
| 77 | - 'before_title' => $before_title, |
|
| 78 | - 'after_title' => $after_title, |
|
| 79 | - 'title' => $title, |
|
| 80 | - 'post_number' => $post_number, |
|
| 81 | - 'relate_to' => $relate_to, |
|
| 82 | - 'layout' => $layout, |
|
| 83 | - 'add_location_filter' => $add_location_filter, |
|
| 84 | - 'listing_width' => $listing_width, |
|
| 85 | - 'list_sort' => $list_sort, |
|
| 86 | - 'character_count' => $character_count, |
|
| 87 | - 'is_widget' => '1' |
|
| 88 | - ); |
|
| 89 | - |
|
| 90 | - if ($widget_display = geodir_related_posts_display($arr)) { |
|
| 91 | - |
|
| 92 | - echo $before_widget; |
|
| 93 | - echo $widget_display; |
|
| 94 | - echo $after_widget; |
|
| 95 | - } |
|
| 96 | - } |
|
| 76 | + $arr = array( |
|
| 77 | + 'before_title' => $before_title, |
|
| 78 | + 'after_title' => $after_title, |
|
| 79 | + 'title' => $title, |
|
| 80 | + 'post_number' => $post_number, |
|
| 81 | + 'relate_to' => $relate_to, |
|
| 82 | + 'layout' => $layout, |
|
| 83 | + 'add_location_filter' => $add_location_filter, |
|
| 84 | + 'listing_width' => $listing_width, |
|
| 85 | + 'list_sort' => $list_sort, |
|
| 86 | + 'character_count' => $character_count, |
|
| 87 | + 'is_widget' => '1' |
|
| 88 | + ); |
|
| 89 | + |
|
| 90 | + if ($widget_display = geodir_related_posts_display($arr)) { |
|
| 91 | + |
|
| 92 | + echo $before_widget; |
|
| 93 | + echo $widget_display; |
|
| 94 | + echo $after_widget; |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Sanitize related listing widget form values as they are saved. |
| 100 | 100 | * |
| 101 | 101 | * @since 1.0.0 |
| 102 | - * @since 1.5.1 Declare function public. |
|
| 102 | + * @since 1.5.1 Declare function public. |
|
| 103 | 103 | * |
| 104 | 104 | * @param array $new_instance Values just sent to be saved. |
| 105 | 105 | * @param array $old_instance Previously saved values from database. |
| 106 | 106 | * |
| 107 | 107 | * @return array Updated safe values to be saved. |
| 108 | 108 | */ |
| 109 | - public function update($new_instance, $old_instance) |
|
| 110 | - { |
|
| 111 | - //save the widget |
|
| 112 | - $instance = $old_instance; |
|
| 113 | - |
|
| 114 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 115 | - $instance['post_number'] = strip_tags($new_instance['post_number']); |
|
| 116 | - $instance['relate_to'] = strip_tags($new_instance['relate_to']); |
|
| 117 | - $instance['layout'] = strip_tags($new_instance['layout']); |
|
| 118 | - $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
|
| 119 | - $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
|
| 120 | - $instance['character_count'] = $new_instance['character_count']; |
|
| 121 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 122 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 123 | - else |
|
| 124 | - $instance['add_location_filter'] = '0'; |
|
| 125 | - |
|
| 126 | - return $instance; |
|
| 127 | - } |
|
| 109 | + public function update($new_instance, $old_instance) |
|
| 110 | + { |
|
| 111 | + //save the widget |
|
| 112 | + $instance = $old_instance; |
|
| 113 | + |
|
| 114 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 115 | + $instance['post_number'] = strip_tags($new_instance['post_number']); |
|
| 116 | + $instance['relate_to'] = strip_tags($new_instance['relate_to']); |
|
| 117 | + $instance['layout'] = strip_tags($new_instance['layout']); |
|
| 118 | + $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
|
| 119 | + $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
|
| 120 | + $instance['character_count'] = $new_instance['character_count']; |
|
| 121 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 122 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 123 | + else |
|
| 124 | + $instance['add_location_filter'] = '0'; |
|
| 125 | + |
|
| 126 | + return $instance; |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | 130 | * Back-end related listing widget settings form. |
| 131 | 131 | * |
| 132 | 132 | * @since 1.0.0 |
| 133 | - * @since 1.5.1 Declare function public. |
|
| 133 | + * @since 1.5.1 Declare function public. |
|
| 134 | 134 | * |
| 135 | 135 | * @param array $instance Previously saved values from database. |
| 136 | 136 | */ |
| 137 | - public function form($instance) |
|
| 138 | - { |
|
| 139 | - //widgetform in backend |
|
| 140 | - $instance = wp_parse_args((array)$instance, |
|
| 141 | - array('title' => '', |
|
| 142 | - 'list_sort' => '', |
|
| 143 | - 'list_order' => '', |
|
| 144 | - 'post_number' => '5', |
|
| 145 | - 'relate_to' => '', |
|
| 146 | - 'layout' => 'gridview_onehalf', |
|
| 147 | - 'listing_width' => '', |
|
| 148 | - 'add_location_filter' => '1', |
|
| 149 | - 'character_count' => '20') |
|
| 150 | - ); |
|
| 137 | + public function form($instance) |
|
| 138 | + { |
|
| 139 | + //widgetform in backend |
|
| 140 | + $instance = wp_parse_args((array)$instance, |
|
| 141 | + array('title' => '', |
|
| 142 | + 'list_sort' => '', |
|
| 143 | + 'list_order' => '', |
|
| 144 | + 'post_number' => '5', |
|
| 145 | + 'relate_to' => '', |
|
| 146 | + 'layout' => 'gridview_onehalf', |
|
| 147 | + 'listing_width' => '', |
|
| 148 | + 'add_location_filter' => '1', |
|
| 149 | + 'character_count' => '20') |
|
| 150 | + ); |
|
| 151 | 151 | |
| 152 | - $title = strip_tags($instance['title']); |
|
| 152 | + $title = strip_tags($instance['title']); |
|
| 153 | 153 | |
| 154 | - $list_sort = strip_tags($instance['list_sort']); |
|
| 154 | + $list_sort = strip_tags($instance['list_sort']); |
|
| 155 | 155 | |
| 156 | - $list_order = strip_tags($instance['list_order']); |
|
| 156 | + $list_order = strip_tags($instance['list_order']); |
|
| 157 | 157 | |
| 158 | - $post_number = strip_tags($instance['post_number']); |
|
| 158 | + $post_number = strip_tags($instance['post_number']); |
|
| 159 | 159 | |
| 160 | - $relate_to = strip_tags($instance['relate_to']); |
|
| 160 | + $relate_to = strip_tags($instance['relate_to']); |
|
| 161 | 161 | |
| 162 | - $layout = strip_tags($instance['layout']); |
|
| 162 | + $layout = strip_tags($instance['layout']); |
|
| 163 | 163 | |
| 164 | - $listing_width = strip_tags($instance['listing_width']); |
|
| 164 | + $listing_width = strip_tags($instance['listing_width']); |
|
| 165 | 165 | |
| 166 | - $add_location_filter = strip_tags($instance['add_location_filter']); |
|
| 166 | + $add_location_filter = strip_tags($instance['add_location_filter']); |
|
| 167 | 167 | |
| 168 | - $character_count = $instance['character_count']; |
|
| 168 | + $character_count = $instance['character_count']; |
|
| 169 | 169 | |
| 170 | - ?> |
|
| 170 | + ?> |
|
| 171 | 171 | <p> |
| 172 | 172 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
| 173 | 173 | |
@@ -184,24 +184,24 @@ discard block |
||
| 184 | 184 | name="<?php echo $this->get_field_name('list_sort'); ?>"> |
| 185 | 185 | |
| 186 | 186 | <option <?php if ($list_sort == 'latest') { |
| 187 | - echo 'selected="selected"'; |
|
| 188 | - } ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option> |
|
| 187 | + echo 'selected="selected"'; |
|
| 188 | + } ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option> |
|
| 189 | 189 | |
| 190 | 190 | <option <?php if ($list_sort == 'featured') { |
| 191 | - echo 'selected="selected"'; |
|
| 192 | - } ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option> |
|
| 191 | + echo 'selected="selected"'; |
|
| 192 | + } ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option> |
|
| 193 | 193 | |
| 194 | 194 | <option <?php if ($list_sort == 'high_review') { |
| 195 | - echo 'selected="selected"'; |
|
| 196 | - } ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option> |
|
| 195 | + echo 'selected="selected"'; |
|
| 196 | + } ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option> |
|
| 197 | 197 | |
| 198 | 198 | <option <?php if ($list_sort == 'high_rating') { |
| 199 | - echo 'selected="selected"'; |
|
| 200 | - } ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option> |
|
| 199 | + echo 'selected="selected"'; |
|
| 200 | + } ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option> |
|
| 201 | 201 | |
| 202 | 202 | <option <?php if ($list_sort == 'random') { |
| 203 | - echo 'selected="selected"'; |
|
| 204 | - } ?> value="random"><?php _e('Random', 'geodirectory'); ?></option> |
|
| 203 | + echo 'selected="selected"'; |
|
| 204 | + } ?> value="random"><?php _e('Random', 'geodirectory'); ?></option> |
|
| 205 | 205 | |
| 206 | 206 | </select> |
| 207 | 207 | </label> |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | <select class="widefat" id="<?php echo $this->get_field_id('relate_to'); ?>" |
| 222 | 222 | name="<?php echo $this->get_field_name('relate_to'); ?>"> |
| 223 | 223 | <option <?php if ($relate_to == 'category') { |
| 224 | - echo 'selected="selected"'; |
|
| 225 | - } ?> value="category"><?php _e('Categories', 'geodirectory'); ?></option> |
|
| 224 | + echo 'selected="selected"'; |
|
| 225 | + } ?> value="category"><?php _e('Categories', 'geodirectory'); ?></option> |
|
| 226 | 226 | <option <?php if ($relate_to == 'tags') { |
| 227 | - echo 'selected="selected"'; |
|
| 228 | - } ?> value="tags"><?php _e('Tags', 'geodirectory'); ?></option> |
|
| 227 | + echo 'selected="selected"'; |
|
| 228 | + } ?> value="tags"><?php _e('Tags', 'geodirectory'); ?></option> |
|
| 229 | 229 | </select> |
| 230 | 230 | </label> |
| 231 | 231 | </p> |
@@ -236,24 +236,24 @@ discard block |
||
| 236 | 236 | <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>" |
| 237 | 237 | name="<?php echo $this->get_field_name('layout'); ?>"> |
| 238 | 238 | <option <?php if ($layout == 'gridview_onehalf') { |
| 239 | - echo 'selected="selected"'; |
|
| 240 | - } ?> |
|
| 239 | + echo 'selected="selected"'; |
|
| 240 | + } ?> |
|
| 241 | 241 | value="gridview_onehalf"><?php _e('Grid View (Two Columns)', 'geodirectory'); ?></option> |
| 242 | 242 | <option <?php if ($layout == 'gridview_onethird') { |
| 243 | - echo 'selected="selected"'; |
|
| 244 | - } ?> |
|
| 243 | + echo 'selected="selected"'; |
|
| 244 | + } ?> |
|
| 245 | 245 | value="gridview_onethird"><?php _e('Grid View (Three Columns)', 'geodirectory'); ?></option> |
| 246 | 246 | <option <?php if ($layout == 'gridview_onefourth') { |
| 247 | - echo 'selected="selected"'; |
|
| 248 | - } ?> |
|
| 247 | + echo 'selected="selected"'; |
|
| 248 | + } ?> |
|
| 249 | 249 | value="gridview_onefourth"><?php _e('Grid View (Four Columns)', 'geodirectory'); ?></option> |
| 250 | 250 | <option <?php if ($layout == 'gridview_onefifth') { |
| 251 | - echo 'selected="selected"'; |
|
| 252 | - } ?> |
|
| 251 | + echo 'selected="selected"'; |
|
| 252 | + } ?> |
|
| 253 | 253 | value="gridview_onefifth"><?php _e('Grid View (Five Columns)', 'geodirectory'); ?></option> |
| 254 | 254 | <option <?php if ($layout == 'list') { |
| 255 | - echo 'selected="selected"'; |
|
| 256 | - } ?> value="list"><?php _e('List view', 'geodirectory'); ?></option> |
|
| 255 | + echo 'selected="selected"'; |
|
| 256 | + } ?> value="list"><?php _e('List view', 'geodirectory'); ?></option> |
|
| 257 | 257 | |
| 258 | 258 | </select> |
| 259 | 259 | </label> |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | </p> |
| 286 | 286 | |
| 287 | 287 | <?php |
| 288 | - } |
|
| 288 | + } |
|
| 289 | 289 | } // class geodir_related_listing_postview |
| 290 | 290 | |
| 291 | 291 | register_widget('geodir_related_listing_postview'); |
| 292 | 292 | \ No newline at end of file |
@@ -14,37 +14,37 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class geodir_recent_reviews_widget extends WP_Widget |
| 16 | 16 | {
|
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * Register the recent reviews widget. |
| 19 | 19 | * |
| 20 | 20 | * @since 1.0.0 |
| 21 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 21 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 22 | 22 | */ |
| 23 | - public function __construct() {
|
|
| 24 | - $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
|
|
| 25 | - parent::__construct( |
|
| 26 | - 'geodir_recent_reviews', // Base ID |
|
| 27 | - __('GD > Recent Reviews', 'geodirectory'), // Name
|
|
| 28 | - $widget_ops// Args |
|
| 29 | - ); |
|
| 30 | - } |
|
| 23 | + public function __construct() {
|
|
| 24 | + $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
|
|
| 25 | + parent::__construct( |
|
| 26 | + 'geodir_recent_reviews', // Base ID |
|
| 27 | + __('GD > Recent Reviews', 'geodirectory'), // Name
|
|
| 28 | + $widget_ops// Args |
|
| 29 | + ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Front-end display content for recent reviews widget. |
| 34 | 34 | * |
| 35 | 35 | * @since 1.0.0 |
| 36 | - * @since 1.5.1 Declare function public. |
|
| 36 | + * @since 1.5.1 Declare function public. |
|
| 37 | 37 | * |
| 38 | 38 | * @param array $args Widget arguments. |
| 39 | 39 | * @param array $instance Saved values from database. |
| 40 | 40 | */ |
| 41 | 41 | public function widget($args, $instance) |
| 42 | - {
|
|
| 43 | - // prints the widget |
|
| 44 | - extract($args, EXTR_SKIP); |
|
| 42 | + {
|
|
| 43 | + // prints the widget |
|
| 44 | + extract($args, EXTR_SKIP); |
|
| 45 | 45 | |
| 46 | - /** This filter is documented in geodirectory_widgets.php */ |
|
| 47 | - $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 46 | + /** This filter is documented in geodirectory_widgets.php */ |
|
| 47 | + $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Filter the number of reviews to display. |
@@ -63,35 +63,35 @@ discard block |
||
| 63 | 63 | * @param int $g_size Height and width of the avatar image in pixels. Default 30. |
| 64 | 64 | */ |
| 65 | 65 | $g_size = apply_filters('geodir_recent_reviews_g_size', 30);
|
| 66 | - /** |
|
| 67 | - * Filter the excerpt length |
|
| 68 | - * |
|
| 69 | - * @since 1.0.0 |
|
| 70 | - * |
|
| 71 | - * @param int $excerpt_length Excerpt length. Default 100. |
|
| 72 | - */ |
|
| 73 | - $excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
|
|
| 74 | - $comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false); |
|
| 66 | + /** |
|
| 67 | + * Filter the excerpt length |
|
| 68 | + * |
|
| 69 | + * @since 1.0.0 |
|
| 70 | + * |
|
| 71 | + * @param int $excerpt_length Excerpt length. Default 100. |
|
| 72 | + */ |
|
| 73 | + $excerpt_length = apply_filters('geodir_recent_reviews_excerpt_length', 100);
|
|
| 74 | + $comments_li = geodir_get_recent_reviews($g_size, $count, $excerpt_length, false); |
|
| 75 | 75 | |
| 76 | - if ($comments_li) {
|
|
| 77 | - echo $before_widget; |
|
| 78 | - ?> |
|
| 76 | + if ($comments_li) {
|
|
| 77 | + echo $before_widget; |
|
| 78 | + ?> |
|
| 79 | 79 | <div class="widget geodir_recent_reviews_section"> |
| 80 | 80 | <?php if ($title) {
|
| 81 | - echo $before_title . $title . $after_title; |
|
| 82 | - } ?> |
|
| 81 | + echo $before_title . $title . $after_title; |
|
| 82 | + } ?> |
|
| 83 | 83 | <ul class="geodir_recent_reviews"><?php echo $comments_li; ?></ul> |
| 84 | 84 | </div> |
| 85 | 85 | <?php |
| 86 | - echo $after_widget; |
|
| 87 | - } |
|
| 88 | - } |
|
| 86 | + echo $after_widget; |
|
| 87 | + } |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Sanitize recent reviews widget form values as they are saved. |
| 92 | 92 | * |
| 93 | 93 | * @since 1.0.0 |
| 94 | - * @since 1.5.1 Declare function public. |
|
| 94 | + * @since 1.5.1 Declare function public. |
|
| 95 | 95 | * |
| 96 | 96 | * @param array $new_instance Values just sent to be saved. |
| 97 | 97 | * @param array $old_instance Previously saved values from database. |
@@ -99,29 +99,29 @@ discard block |
||
| 99 | 99 | * @return array Updated safe values to be saved. |
| 100 | 100 | */ |
| 101 | 101 | public function update($new_instance, $old_instance) |
| 102 | - {
|
|
| 103 | - //save the widget |
|
| 104 | - $instance = $old_instance; |
|
| 105 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 106 | - $instance['count'] = strip_tags($new_instance['count']); |
|
| 107 | - return $instance; |
|
| 108 | - } |
|
| 102 | + {
|
|
| 103 | + //save the widget |
|
| 104 | + $instance = $old_instance; |
|
| 105 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 106 | + $instance['count'] = strip_tags($new_instance['count']); |
|
| 107 | + return $instance; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | * Back-end recent reviews widget settings form. |
| 112 | 112 | * |
| 113 | 113 | * @since 1.0.0 |
| 114 | - * @since 1.5.1 Declare function public. |
|
| 114 | + * @since 1.5.1 Declare function public. |
|
| 115 | 115 | * |
| 116 | 116 | * @param array $instance Previously saved values from database. |
| 117 | 117 | */ |
| 118 | 118 | public function form($instance) |
| 119 | - {
|
|
| 120 | - //widgetform in backend |
|
| 121 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 122 | - $title = strip_tags($instance['title']); |
|
| 123 | - $count = strip_tags($instance['count']); |
|
| 124 | - ?> |
|
| 119 | + {
|
|
| 120 | + //widgetform in backend |
|
| 121 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 122 | + $title = strip_tags($instance['title']); |
|
| 123 | + $count = strip_tags($instance['count']); |
|
| 124 | + ?> |
|
| 125 | 125 | <p><label for="<?php echo $this->get_field_id('title'); ?>">Widget Title: <input class="widefat"
|
| 126 | 126 | id="<?php echo $this->get_field_id('title'); ?>"
|
| 127 | 127 | name="<?php echo $this->get_field_name('title'); ?>"
|
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | value="<?php echo esc_attr($count); ?>"/></label> |
| 136 | 136 | </p> |
| 137 | 137 | <?php |
| 138 | - } |
|
| 138 | + } |
|
| 139 | 139 | } // class geodir_recent_reviews_widget |
| 140 | 140 | |
| 141 | 141 | register_widget('geodir_recent_reviews_widget'); |
| 142 | 142 | \ No newline at end of file |
@@ -16,126 +16,126 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class geodir_homepage_map extends WP_Widget |
| 18 | 18 | {
|
| 19 | - /** |
|
| 19 | + /** |
|
| 20 | 20 | * Register the home page map widget. |
| 21 | 21 | * |
| 22 | 22 | * @since 1.0.0 |
| 23 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 23 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 24 | 24 | */ |
| 25 | - public function __construct() {
|
|
| 26 | - $widget_ops = array('classname' => 'widget Google Map in Home page', 'description' => __('Google Map in Home page. It will show you google map V3 for Home page with category checkbox selection.', 'geodirectory'));
|
|
| 27 | - parent::__construct( |
|
| 28 | - 'geodir_map_v3_home_map', // Base ID |
|
| 29 | - __('GD > GMap - Home page', 'geodirectory'), // Name
|
|
| 30 | - $widget_ops// Args |
|
| 31 | - ); |
|
| 32 | - } |
|
| 25 | + public function __construct() {
|
|
| 26 | + $widget_ops = array('classname' => 'widget Google Map in Home page', 'description' => __('Google Map in Home page. It will show you google map V3 for Home page with category checkbox selection.', 'geodirectory'));
|
|
| 27 | + parent::__construct( |
|
| 28 | + 'geodir_map_v3_home_map', // Base ID |
|
| 29 | + __('GD > GMap - Home page', 'geodirectory'), // Name
|
|
| 30 | + $widget_ops// Args |
|
| 31 | + ); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Front-end display content for home page map widget. |
| 36 | 36 | * |
| 37 | 37 | * @since 1.0.0 |
| 38 | - * @since 1.5.1 Declare function public. |
|
| 38 | + * @since 1.5.1 Declare function public. |
|
| 39 | 39 | * |
| 40 | 40 | * @param array $args Widget arguments. |
| 41 | 41 | * @param array $instance Saved values from database. |
| 42 | 42 | */ |
| 43 | - public function widget($args, $instance) |
|
| 44 | - {
|
|
| 45 | - extract($args, EXTR_SKIP); |
|
| 46 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 47 | - $width = empty($instance['width']) ? '100%' : apply_filters('widget_width', $instance['width']);
|
|
| 48 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 49 | - $height = empty($instance['heigh']) ? '425' : apply_filters('widget_heigh', $instance['heigh']);
|
|
| 50 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 51 | - $maptype = empty($instance['maptype']) ? 'ROADMAP' : apply_filters('widget_maptype', $instance['maptype']);
|
|
| 52 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 53 | - $zoom = empty($instance['zoom']) ? '13' : apply_filters('widget_zoom', $instance['zoom']);
|
|
| 54 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 55 | - $autozoom = empty($instance['autozoom']) ? '' : apply_filters('widget_autozoom', $instance['autozoom']);
|
|
| 56 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 57 | - $child_collapse = empty($instance['child_collapse']) ? '0' : apply_filters('widget_child_collapse', $instance['child_collapse']);
|
|
| 58 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 59 | - $scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']);
|
|
| 43 | + public function widget($args, $instance) |
|
| 44 | + {
|
|
| 45 | + extract($args, EXTR_SKIP); |
|
| 46 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 47 | + $width = empty($instance['width']) ? '100%' : apply_filters('widget_width', $instance['width']);
|
|
| 48 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 49 | + $height = empty($instance['heigh']) ? '425' : apply_filters('widget_heigh', $instance['heigh']);
|
|
| 50 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 51 | + $maptype = empty($instance['maptype']) ? 'ROADMAP' : apply_filters('widget_maptype', $instance['maptype']);
|
|
| 52 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 53 | + $zoom = empty($instance['zoom']) ? '13' : apply_filters('widget_zoom', $instance['zoom']);
|
|
| 54 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 55 | + $autozoom = empty($instance['autozoom']) ? '' : apply_filters('widget_autozoom', $instance['autozoom']);
|
|
| 56 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 57 | + $child_collapse = empty($instance['child_collapse']) ? '0' : apply_filters('widget_child_collapse', $instance['child_collapse']);
|
|
| 58 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 59 | + $scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']);
|
|
| 60 | 60 | |
| 61 | - $map_args = array(); |
|
| 62 | - $map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']); //'home_map_canvas'.$str ;
|
|
| 63 | - $map_args['width'] = $width; |
|
| 64 | - $map_args['height'] = $height; |
|
| 65 | - $map_args['maptype'] = $maptype; |
|
| 66 | - $map_args['scrollwheel'] = $scrollwheel; |
|
| 67 | - $map_args['zoom'] = $zoom; |
|
| 68 | - $map_args['autozoom'] = $autozoom; |
|
| 69 | - $map_args['child_collapse'] = $child_collapse; |
|
| 70 | - $map_args['enable_cat_filters'] = true; |
|
| 71 | - $map_args['enable_text_search'] = true; |
|
| 72 | - $map_args['enable_post_type_filters'] = true; |
|
| 73 | - /** This action is documented in geodirectory_shortcodes.php */ |
|
| 74 | - $map_args['enable_location_filters'] = apply_filters('geodir_home_map_enable_location_filters', false);
|
|
| 75 | - $map_args['enable_jason_on_load'] = false; |
|
| 76 | - $map_args['enable_marker_cluster'] = false; |
|
| 77 | - $map_args['enable_map_resize_button'] = true; |
|
| 78 | - $map_args['map_class_name'] = 'geodir-map-home-page'; |
|
| 61 | + $map_args = array(); |
|
| 62 | + $map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']); //'home_map_canvas'.$str ;
|
|
| 63 | + $map_args['width'] = $width; |
|
| 64 | + $map_args['height'] = $height; |
|
| 65 | + $map_args['maptype'] = $maptype; |
|
| 66 | + $map_args['scrollwheel'] = $scrollwheel; |
|
| 67 | + $map_args['zoom'] = $zoom; |
|
| 68 | + $map_args['autozoom'] = $autozoom; |
|
| 69 | + $map_args['child_collapse'] = $child_collapse; |
|
| 70 | + $map_args['enable_cat_filters'] = true; |
|
| 71 | + $map_args['enable_text_search'] = true; |
|
| 72 | + $map_args['enable_post_type_filters'] = true; |
|
| 73 | + /** This action is documented in geodirectory_shortcodes.php */ |
|
| 74 | + $map_args['enable_location_filters'] = apply_filters('geodir_home_map_enable_location_filters', false);
|
|
| 75 | + $map_args['enable_jason_on_load'] = false; |
|
| 76 | + $map_args['enable_marker_cluster'] = false; |
|
| 77 | + $map_args['enable_map_resize_button'] = true; |
|
| 78 | + $map_args['map_class_name'] = 'geodir-map-home-page'; |
|
| 79 | 79 | |
| 80 | - $is_geodir_home_map_widget = true; |
|
| 81 | - $map_args['is_geodir_home_map_widget'] = $is_geodir_home_map_widget; |
|
| 80 | + $is_geodir_home_map_widget = true; |
|
| 81 | + $map_args['is_geodir_home_map_widget'] = $is_geodir_home_map_widget; |
|
| 82 | 82 | |
| 83 | - geodir_draw_map($map_args); |
|
| 83 | + geodir_draw_map($map_args); |
|
| 84 | 84 | |
| 85 | - /* home map post type slider */ |
|
| 86 | - if ($is_geodir_home_map_widget) {
|
|
| 87 | - add_action('wp_footer', array($this, 'geodir_home_map_add_script'), 100);
|
|
| 88 | - } |
|
| 85 | + /* home map post type slider */ |
|
| 86 | + if ($is_geodir_home_map_widget) {
|
|
| 87 | + add_action('wp_footer', array($this, 'geodir_home_map_add_script'), 100);
|
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - } |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * Sanitize home page map widget form values as they are saved. |
| 94 | 94 | * |
| 95 | 95 | * @since 1.0.0 |
| 96 | - * @since 1.5.1 Declare function public. |
|
| 96 | + * @since 1.5.1 Declare function public. |
|
| 97 | 97 | * |
| 98 | 98 | * @param array $new_instance Values just sent to be saved. |
| 99 | 99 | * @param array $old_instance Previously saved values from database. |
| 100 | 100 | * |
| 101 | 101 | * @return array Updated safe values to be saved. |
| 102 | 102 | */ |
| 103 | - public function update($new_instance, $old_instance) |
|
| 104 | - {
|
|
| 105 | - //save the widget |
|
| 106 | - $instance = $old_instance; |
|
| 107 | - $instance['width'] = strip_tags($new_instance['width']); |
|
| 108 | - $instance['heigh'] = ($new_instance['heigh']); |
|
| 109 | - $instance['maptype'] = ($new_instance['maptype']); |
|
| 110 | - $instance['zoom'] = ($new_instance['zoom']); |
|
| 111 | - $instance['autozoom'] = isset($new_instance['autozoom']) ? $new_instance['autozoom'] : ''; |
|
| 112 | - $instance['child_collapse'] = isset($new_instance['child_collapse']) ? ($new_instance['child_collapse']) : ''; |
|
| 113 | - $instance['scrollwheel'] = isset($new_instance['scrollwheel']) ? ($new_instance['scrollwheel']) : ''; |
|
| 103 | + public function update($new_instance, $old_instance) |
|
| 104 | + {
|
|
| 105 | + //save the widget |
|
| 106 | + $instance = $old_instance; |
|
| 107 | + $instance['width'] = strip_tags($new_instance['width']); |
|
| 108 | + $instance['heigh'] = ($new_instance['heigh']); |
|
| 109 | + $instance['maptype'] = ($new_instance['maptype']); |
|
| 110 | + $instance['zoom'] = ($new_instance['zoom']); |
|
| 111 | + $instance['autozoom'] = isset($new_instance['autozoom']) ? $new_instance['autozoom'] : ''; |
|
| 112 | + $instance['child_collapse'] = isset($new_instance['child_collapse']) ? ($new_instance['child_collapse']) : ''; |
|
| 113 | + $instance['scrollwheel'] = isset($new_instance['scrollwheel']) ? ($new_instance['scrollwheel']) : ''; |
|
| 114 | 114 | |
| 115 | - return $instance; |
|
| 116 | - } |
|
| 115 | + return $instance; |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | 119 | * Back-end home page map widget settings form. |
| 120 | 120 | * |
| 121 | 121 | * @since 1.0.0 |
| 122 | - * @since 1.5.1 Declare function public. |
|
| 122 | + * @since 1.5.1 Declare function public. |
|
| 123 | 123 | * |
| 124 | 124 | * @param array $instance Previously saved values from database. |
| 125 | 125 | */ |
| 126 | - public function form($instance) |
|
| 127 | - {
|
|
| 128 | - //widgetform in backend |
|
| 126 | + public function form($instance) |
|
| 127 | + {
|
|
| 128 | + //widgetform in backend |
|
| 129 | 129 | |
| 130 | - $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'child_collapse' => '0', 'scrollwheel' => '0'));
|
|
| 131 | - $width = strip_tags($instance['width']); |
|
| 132 | - $heigh = strip_tags($instance['heigh']); |
|
| 133 | - $maptype = strip_tags($instance['maptype']); |
|
| 134 | - $zoom = strip_tags($instance['zoom']); |
|
| 135 | - $autozoom = strip_tags($instance['autozoom']); |
|
| 136 | - $child_collapse = strip_tags($instance['child_collapse']); |
|
| 137 | - $scrollwheel = strip_tags($instance['scrollwheel']); |
|
| 138 | - ?> |
|
| 130 | + $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'child_collapse' => '0', 'scrollwheel' => '0'));
|
|
| 131 | + $width = strip_tags($instance['width']); |
|
| 132 | + $heigh = strip_tags($instance['heigh']); |
|
| 133 | + $maptype = strip_tags($instance['maptype']); |
|
| 134 | + $zoom = strip_tags($instance['zoom']); |
|
| 135 | + $autozoom = strip_tags($instance['autozoom']); |
|
| 136 | + $child_collapse = strip_tags($instance['child_collapse']); |
|
| 137 | + $scrollwheel = strip_tags($instance['scrollwheel']); |
|
| 138 | + ?> |
|
| 139 | 139 | |
| 140 | 140 | <p> |
| 141 | 141 | <label |
@@ -164,14 +164,14 @@ discard block |
||
| 164 | 164 | name="<?php echo $this->get_field_name('maptype'); ?>">
|
| 165 | 165 | |
| 166 | 166 | <option <?php if (isset($maptype) && $maptype == 'ROADMAP') {
|
| 167 | - echo 'selected="selected"'; |
|
| 168 | - } ?> value="ROADMAP"><?php _e('Road Map', 'geodirectory'); ?></option>
|
|
| 167 | + echo 'selected="selected"'; |
|
| 168 | + } ?> value="ROADMAP"><?php _e('Road Map', 'geodirectory'); ?></option>
|
|
| 169 | 169 | <option <?php if (isset($maptype) && $maptype == 'SATELLITE') {
|
| 170 | - echo 'selected="selected"'; |
|
| 171 | - } ?> value="SATELLITE"><?php _e('Satellite Map', 'geodirectory'); ?></option>
|
|
| 170 | + echo 'selected="selected"'; |
|
| 171 | + } ?> value="SATELLITE"><?php _e('Satellite Map', 'geodirectory'); ?></option>
|
|
| 172 | 172 | <option <?php if (isset($maptype) && $maptype == 'HYBRID') {
|
| 173 | - echo 'selected="selected"'; |
|
| 174 | - } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
|
|
| 173 | + echo 'selected="selected"'; |
|
| 174 | + } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
|
|
| 175 | 175 | <option <?php selected($maptype, 'TERRAIN');?> |
| 176 | 176 | value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option>
|
| 177 | 177 | </select> |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | </p> |
| 180 | 180 | |
| 181 | 181 | <?php |
| 182 | - $map_zoom_level = geodir_map_zoom_level(); |
|
| 183 | - ?> |
|
| 182 | + $map_zoom_level = geodir_map_zoom_level(); |
|
| 183 | + ?> |
|
| 184 | 184 | |
| 185 | 185 | <p> |
| 186 | 186 | <label |
@@ -189,14 +189,14 @@ discard block |
||
| 189 | 189 | <select class="widefat" id="<?php echo $this->get_field_id('zoom'); ?>"
|
| 190 | 190 | name="<?php echo $this->get_field_name('zoom'); ?>"> <?php
|
| 191 | 191 | |
| 192 | - foreach ($map_zoom_level as $level) {
|
|
| 193 | - $selected = ''; |
|
| 194 | - if ($level == $zoom) |
|
| 195 | - $selected = 'selected="selected"'; |
|
| 192 | + foreach ($map_zoom_level as $level) {
|
|
| 193 | + $selected = ''; |
|
| 194 | + if ($level == $zoom) |
|
| 195 | + $selected = 'selected="selected"'; |
|
| 196 | 196 | |
| 197 | - echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>'; |
|
| 197 | + echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>'; |
|
| 198 | 198 | |
| 199 | - } ?> |
|
| 199 | + } ?> |
|
| 200 | 200 | |
| 201 | 201 | </select> |
| 202 | 202 | </label> |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | : |
| 210 | 210 | <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('autozoom'); ?>"
|
| 211 | 211 | name="<?php echo $this->get_field_name('autozoom'); ?>"<?php if ($autozoom) {
|
| 212 | - echo 'checked="checked"'; |
|
| 213 | - } ?> /></label> |
|
| 212 | + echo 'checked="checked"'; |
|
| 213 | + } ?> /></label> |
|
| 214 | 214 | </p> |
| 215 | 215 | |
| 216 | 216 | <p> |
@@ -234,17 +234,17 @@ discard block |
||
| 234 | 234 | </p> |
| 235 | 235 | |
| 236 | 236 | <?php |
| 237 | - } |
|
| 237 | + } |
|
| 238 | 238 | |
| 239 | - /** |
|
| 239 | + /** |
|
| 240 | 240 | * Adds the javascript in the footer for home page map widget. |
| 241 | 241 | * |
| 242 | 242 | * @since 1.0.0 |
| 243 | - * @since 1.5.1 Declare function public. |
|
| 243 | + * @since 1.5.1 Declare function public. |
|
| 244 | 244 | */ |
| 245 | - public function geodir_home_map_add_script() |
|
| 246 | - {
|
|
| 247 | - ?> |
|
| 245 | + public function geodir_home_map_add_script() |
|
| 246 | + {
|
|
| 247 | + ?> |
|
| 248 | 248 | <script type="text/javascript"> |
| 249 | 249 | jQuery(document).ready(function () {
|
| 250 | 250 | geoDirMapSlide(); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | </script> |
| 319 | 319 | <?php |
| 320 | - } |
|
| 320 | + } |
|
| 321 | 321 | } // class geodir_homepage_map |
| 322 | 322 | |
| 323 | 323 | register_widget('geodir_homepage_map');
|