Changeset 1928419
- Timestamp:
- 08/22/2018 04:59:23 AM (7 years ago)
- Location:
- wp-restaurant-listings/trunk
- Files:
-
- 54 edited
-
assets/js/ajax-filters.js (modified) (5 diffs)
-
assets/js/ajax-filters.min.js (modified) (1 diff)
-
includes/3rd-party/polylang.php (modified) (2 diffs)
-
includes/abstracts/abstract-wp-restaurant-listings-form.php (modified) (4 diffs)
-
includes/admin/class-wp-restaurant-listings-admin.php (modified) (2 diffs)
-
includes/admin/class-wp-restaurant-listings-setup.php (modified) (7 diffs)
-
includes/admin/class-wp-restaurant-listings-writepanels.php (modified) (11 diffs)
-
includes/class-wp-restaurant-listings.php (modified) (2 diffs)
-
includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php (modified) (12 diffs)
-
includes/widgets/class-wp-restaurant-listings-widget-featured-restaurants.php (modified) (2 diffs)
-
includes/widgets/class-wp-restaurant-listings-widget-recent-restaurants.php (modified) (2 diffs)
-
languages/wp-restaurant-listings.pot (modified) (25 diffs)
-
license.txt (modified) (1 diff)
-
package.json (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
templates/account-signin.php (modified) (3 diffs)
-
templates/content-no-restaurants-found.php (modified) (1 diff)
-
templates/content-restaurant_listings.php (modified) (1 diff)
-
templates/content-single-restaurant_listings-meta.php (modified) (1 diff)
-
templates/content-single-restaurant_listings-restaurant.php (modified) (1 diff)
-
templates/content-single-restaurant_listings.php (modified) (1 diff)
-
templates/content-summary-restaurant_listings.php (modified) (1 diff)
-
templates/content-widget-no-restaurants-found.php (modified) (1 diff)
-
templates/content-widget-restaurant_listings.php (modified) (1 diff)
-
templates/form-fields/business-hours-field.php (modified) (1 diff)
-
templates/form-fields/checkbox-field.php (modified) (1 diff)
-
templates/form-fields/file-field.php (modified) (1 diff)
-
templates/form-fields/multiselect-field.php (modified) (1 diff)
-
templates/form-fields/password-field.php (modified) (1 diff)
-
templates/form-fields/radio-field.php (modified) (2 diffs)
-
templates/form-fields/select-field.php (modified) (1 diff)
-
templates/form-fields/term-checklist-field.php (modified) (1 diff)
-
templates/form-fields/term-multiselect-field.php (modified) (1 diff)
-
templates/form-fields/term-select-field.php (modified) (1 diff)
-
templates/form-fields/text-field.php (modified) (1 diff)
-
templates/form-fields/textarea-field.php (modified) (1 diff)
-
templates/form-fields/uploaded-file-html.php (modified) (1 diff)
-
templates/form-fields/wp-editor-field.php (modified) (1 diff)
-
templates/pagination.php (modified) (1 diff)
-
templates/restaurant-dashboard-login.php (modified) (1 diff)
-
templates/restaurant-dashboard.php (modified) (1 diff)
-
templates/restaurant-filter-restaurant-types.php (modified) (1 diff)
-
templates/restaurant-filters.php (modified) (1 diff)
-
templates/restaurant-gallery-photoswipe.php (modified) (1 diff)
-
templates/restaurant-listings-end.php (modified) (1 diff)
-
templates/restaurant-listings-start.php (modified) (1 diff)
-
templates/restaurant-pagination.php (modified) (1 diff)
-
templates/restaurant-preview.php (modified) (1 diff)
-
templates/restaurant-submit.php (modified) (1 diff)
-
templates/restaurant-submitted.php (modified) (1 diff)
-
templates/single-restaurant_listings-reviews.php (modified) (1 diff)
-
wp-restaurant-listings-functions.php (modified) (9 diffs)
-
wp-restaurant-listings-template.php (modified) (2 diffs)
-
wp-restaurant-listings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-restaurant-listings/trunk/assets/js/ajax-filters.js
r1851196 r1928419 1 1 /* global restaurant_listings_ajax_filters */ 2 jQuery( document ).ready( function ( $) {2 jQuery(document).ready(function ($) { 3 3 4 4 var xhr = []; 5 5 6 $( '.restaurant_listings' ).on( 'update_results', function ( event, page, append, loading_previous) {7 var data = '';8 var target = $( this);9 var form = target.find( '.restaurant_filters');10 var showing = target.find( '.showing_restaurants');11 var results = target.find( '.restaurant_listings');12 var per_page = target.data( 'per_page');13 var orderby = target.data( 'orderby');14 var order = target.data( 'order');15 var featured = target.data( 'featured');16 var restaurant_types = target.data( 'restaurant_types');17 var post_status = target.data( 'post_status');18 var index = $( 'div.restaurant_listings').index(this);6 $('.restaurant_listings').on('update_results', function (event, page, append, loading_previous) { 7 var data = ''; 8 var target = $(this); 9 var form = target.find('.restaurant_filters'); 10 var showing = target.find('.showing_restaurants'); 11 var results = target.find('.restaurant_listings'); 12 var per_page = target.data('per_page'); 13 var orderby = target.data('orderby'); 14 var order = target.data('order'); 15 var featured = target.data('featured'); 16 var restaurant_types = target.data('restaurant_types'); 17 var post_status = target.data('post_status'); 18 var index = $('div.restaurant_listings').index(this); 19 19 var categories, keywords, location, price_range; 20 20 21 if ( index < 0) {21 if(index < 0) { 22 22 return; 23 23 } 24 24 25 if ( xhr[index]) {25 if(xhr[index]) { 26 26 xhr[index].abort(); 27 27 } 28 28 29 if ( ! append) {30 $( results ).addClass( 'loading');31 $( 'li.restaurant_listings, li.no_restaurant_listings_found', results ).css( 'visibility', 'hidden');29 if(!append) { 30 $(results).addClass('loading'); 31 $('li.restaurant_listings, li.no_restaurant_listings_found', results).css('visibility', 'hidden'); 32 32 33 33 // Not appending. If page > 1, we should show a load previous button so the user can get to earlier-page listings if needed 34 if ( page > 1 && true !== target.data( 'show_pagination' )) {35 $( results ).before( '<a class="load_more_restaurants load_previous" href="#"><strong>' + restaurant_listings_ajax_filters.i18n_load_prev_listings + '</strong></a>');34 if(page > 1 && true !== target.data('show_pagination')) { 35 $(results).before('<a class="load_more_restaurants load_previous" href="#"><strong>' + restaurant_listings_ajax_filters.i18n_load_prev_listings + '</strong></a>'); 36 36 } else { 37 target.find( '.load_previous').remove();38 } 39 40 target.find( '.load_more_restaurants' ).data( 'page', page);41 } 42 43 if ( true === target.data( 'show_filters' )) {37 target.find('.load_previous').remove(); 38 } 39 40 target.find('.load_more_restaurants').data('page', page); 41 } 42 43 if(true === target.data('show_filters')) { 44 44 45 45 var filter_restaurant_type = []; 46 46 47 $( ':input[name="filter_restaurant_type[]"]:checked, :input[name="filter_restaurant_type[]"][type="hidden"], :input[name="filter_restaurant_type"]', form ).each(function () {48 filter_restaurant_type.push( $( this ).val());49 } );50 51 categories = form.find( ':input[name^="search_categories"]' ).map(function () {52 return $( this).val();53 } ).get();54 keywords = '';55 location = '';56 price_range = form.find( ':input[name="search_price_range"]').val();57 var $keywords = form.find( ':input[name="search_keywords"]');58 var $location = form.find( ':input[name="search_location"]');47 $(':input[name="filter_restaurant_type[]"]:checked, :input[name="filter_restaurant_type[]"][type="hidden"], :input[name="filter_restaurant_type"]', form).each(function () { 48 filter_restaurant_type.push($(this).val()); 49 }); 50 51 categories = form.find(':input[name^="search_categories"]').map(function () { 52 return $(this).val(); 53 }).get(); 54 keywords = ''; 55 location = ''; 56 price_range = form.find(':input[name="search_price_range"]').val(); 57 var $keywords = form.find(':input[name="search_keywords"]'); 58 var $location = form.find(':input[name="search_location"]'); 59 59 60 60 // Workaround placeholder scripts 61 if ( $keywords.val() !== $keywords.attr( 'placeholder' )) {61 if($keywords.val() !== $keywords.attr('placeholder')) { 62 62 keywords = $keywords.val(); 63 63 } 64 64 65 if ( $location.val() !== $location.attr( 'placeholder' )) {65 if($location.val() !== $location.attr('placeholder')) { 66 66 location = $location.val(); 67 67 } … … 80 80 page: page, 81 81 featured: featured, 82 show_pagination: target.data( 'show_pagination'),82 show_pagination: target.data('show_pagination'), 83 83 form_data: form.serialize() 84 84 }; … … 86 86 } else { 87 87 88 categories = target.data( 'categories');89 keywords = target.data( 'keywords');90 location = target.data( 'location');88 categories = target.data('categories'); 89 keywords = target.data('keywords'); 90 location = target.data('location'); 91 91 price_range = target.data('price_range'); 92 92 93 if ( categories) {94 categories = categories.split( ',');93 if(categories) { 94 categories = categories.split(','); 95 95 } 96 96 … … 108 108 page: page, 109 109 featured: featured, 110 show_pagination: target.data( 'show_pagination')110 show_pagination: target.data('show_pagination') 111 111 }; 112 112 113 113 } 114 114 115 xhr[index] = $.ajax( {115 xhr[index] = $.ajax({ 116 116 type: 'POST', 117 url: restaurant_listings_ajax_filters.ajax_url.toString().replace( '%%endpoint%%', 'get_listings'),117 url: restaurant_listings_ajax_filters.ajax_url.toString().replace('%%endpoint%%', 'get_listings'), 118 118 data: data, 119 success: function ( result) {120 if ( result) {119 success: function (result) { 120 if(result) { 121 121 try { 122 if ( result.showing) {123 $( showing ).show().html( '<span>' + result.showing + '</span>' + result.showing_links);122 if(result.showing) { 123 $(showing).show().html('<span>' + result.showing + '</span>' + result.showing_links); 124 124 } else { 125 $( showing).hide();126 } 127 128 if ( result.showing_all) {129 $( showing ).addClass( 'wp-restaurant-listings-showing-all');125 $(showing).hide(); 126 } 127 128 if(result.showing_all) { 129 $(showing).addClass('wp-restaurant-listings-showing-all'); 130 130 } else { 131 $( showing ).removeClass( 'wp-restaurant-listings-showing-all');132 } 133 134 if ( result.html) {135 if ( append && loading_previous) {136 $( results ).prepend( result.html);137 } else if ( append) {138 $( results ).append( result.html);131 $(showing).removeClass('wp-restaurant-listings-showing-all'); 132 } 133 134 if(result.html) { 135 if(append && loading_previous) { 136 $(results).prepend(result.html); 137 } else if(append) { 138 $(results).append(result.html); 139 139 } else { 140 $( results ).html( result.html);140 $(results).html(result.html); 141 141 } 142 142 } 143 143 144 if ( true === target.data( 'show_pagination' )) {144 if(true === target.data('show_pagination')) { 145 145 target.find('.restaurant-listings-pagination').remove(); 146 146 147 if ( result.pagination) {148 target.append( result.pagination);147 if(result.pagination) { 148 target.append(result.pagination); 149 149 } 150 150 } else { 151 if ( ! result.found_restaurants || result.max_num_pages <= page) {152 $( '.load_more_restaurants:not(.load_previous)', target).hide();153 } else if ( ! loading_previous) {154 $( '.load_more_restaurants', target).show();151 if(!result.found_restaurants || result.max_num_pages <= page) { 152 $('.load_more_restaurants:not(.load_previous)', target).hide(); 153 } else if(!loading_previous) { 154 $('.load_more_restaurants', target).show(); 155 155 } 156 $( '.load_more_restaurants', target ).removeClass( 'loading');157 $( 'li.restaurant_listings', results ).css( 'visibility', 'visible');158 } 159 160 $( results ).removeClass( 'loading');161 162 target.triggerHandler( 'updated_results', result);163 164 } catch ( err) {165 if ( window.console) {166 window.console.log( err);156 $('.load_more_restaurants', target).removeClass('loading'); 157 $('li.restaurant_listings', results).css('visibility', 'visible'); 158 } 159 160 $(results).removeClass('loading'); 161 162 target.triggerHandler('updated_results', result); 163 164 } catch(err) { 165 if(window.console) { 166 window.console.log(err); 167 167 } 168 168 } 169 169 } 170 170 }, 171 error: function ( jqXHR, textStatus, error) {172 if ( window.console && 'abort' !== textStatus) {173 window.console.log( textStatus + ': ' + error);171 error: function (jqXHR, textStatus, error) { 172 if(window.console && 'abort' !== textStatus) { 173 window.console.log(textStatus + ': ' + error); 174 174 } 175 175 }, 176 176 statusCode: { 177 404: function () {178 if ( window.console) {179 window.console.log( 'Error 404: Ajax Endpoint cannot be reached. Go to Settings > Permalinks and save to resolve.');177 404: function () { 178 if(window.console) { 179 window.console.log('Error 404: Ajax Endpoint cannot be reached. Go to Settings > Permalinks and save to resolve.'); 180 180 } 181 181 } 182 182 } 183 } );184 } );185 186 $( '#search_keywords, #search_location, .restaurant_types :input, #search_categories, .restaurant-listings-filter, input[name="search_price_range"]' ).change( function() {187 var target = $( this ).closest( 'div.restaurant_listings');188 target.triggerHandler( 'update_results', [ 1, false ]);189 restaurant_listings_store_state( target, 1);190 })191 192 .on( 'keyup', function(e) {193 if ( e.which === 13) {194 $( this ).trigger( 'change');195 }196 });197 198 $( '.restaurant_filters' ).on('click', '.reset', function () {199 var target = $( this ).closest( 'div.restaurant_listings');200 var form = $( this ).closest( 'form');201 202 form.find( ':input[name="search_keywords"], :input[name="search_location"], .restaurant-listings-filter' ).not(':input[type="hidden"]').val( '' ).trigger( 'chosen:updated');203 form.find( ':input[name^="search_categories"]' ).not(':input[type="hidden"]').val( 0 ).trigger( 'chosen:updated');204 $( ':input[name="filter_restaurant_type[]"]', form ).not(':input[type="hidden"]').attr( 'checked', 'checked');183 }); 184 }); 185 186 $('#search_keywords, #search_location, .restaurant_types :input, #search_categories, .restaurant-listings-filter, input[name="search_price_range"]').change(function () { 187 var target = $(this).closest('div.restaurant_listings'); 188 target.triggerHandler('update_results', [1, false]); 189 restaurant_listings_store_state(target, 1); 190 }) 191 192 .on('keyup', function (e) { 193 if(e.which === 13) { 194 $(this).trigger('change'); 195 } 196 }); 197 198 $('.restaurant_filters').on('click', '.reset', function () { 199 var target = $(this).closest('div.restaurant_listings'); 200 var form = $(this).closest('form'); 201 202 form.find(':input[name="search_keywords"], :input[name="search_location"], .restaurant-listings-filter').not(':input[type="hidden"]').val('').trigger('chosen:updated'); 203 form.find(':input[name^="search_categories"]').not(':input[type="hidden"]').val('').trigger('chosen:updated'); 204 $(':input[name="filter_restaurant_type[]"]', form).not(':input[type="hidden"]').attr('checked', 'checked'); 205 205 form.find(':input[name="search_price_range"]').val(''); 206 form.find('.price_range_filter li').attr('style', ''); // Reset button style207 208 target.triggerHandler( 'reset');209 target.triggerHandler( 'update_results', [ 1, false ]);210 restaurant_listings_store_state( target, 1);206 form.find('.price_range_filter li').attr('style', ''); // Reset button style 207 208 target.triggerHandler('reset'); 209 target.triggerHandler('update_results', [1, false]); 210 restaurant_listings_store_state(target, 1); 211 211 212 212 return false; 213 } );214 215 $( document.body ).on( 'click', '.load_more_restaurants', function() {216 var target = $( this ).closest( 'div.restaurant_listings');217 var page = parseInt( ( $( this ).data( 'page' ) || 1 ), 10);213 }); 214 215 $(document.body).on('click', '.load_more_restaurants', function () { 216 var target = $(this).closest('div.restaurant_listings'); 217 var page = parseInt(($(this).data('page') || 1), 10); 218 218 var loading_previous = false; 219 219 220 $(this).addClass( 'loading');221 222 if ( $(this).is('.load_previous')) {223 page = page - 1;220 $(this).addClass('loading'); 221 222 if($(this).is('.load_previous')) { 223 page = page - 1; 224 224 loading_previous = true; 225 if ( page === 1) {225 if(page === 1) { 226 226 $(this).remove(); 227 227 } else { 228 $( this ).data( 'page', page);228 $(this).data('page', page); 229 229 } 230 230 } else { 231 231 page = page + 1; 232 $( this ).data( 'page', page);233 restaurant_listings_store_state( target, page);234 } 235 236 target.triggerHandler( 'update_results', [ page, true, loading_previous ]);232 $(this).data('page', page); 233 restaurant_listings_store_state(target, page); 234 } 235 236 target.triggerHandler('update_results', [page, true, loading_previous]); 237 237 return false; 238 } );239 240 $('.price_range_filter').on( 'click', 'li', function () {241 $('.price_range_filter li').attr('style', ''); // Reset button style238 }); 239 240 $('.price_range_filter').on('click', 'li', function () { 241 $('.price_range_filter li').attr('style', ''); // Reset button style 242 242 var $clickedLi = $(this); 243 $('input[name="search_price_range"]').attr( 'value', $clickedLi.attr('data-price_range'));244 $('input[name="search_price_range"]').triggerHandler('change');245 $clickedLi.css({ 'background-color': '#c4f3a4', 'border': '1px solid #41a700', 'color': '#348c42' });246 });247 248 $( 'div.restaurant_listings' ).on( 'click', '.restaurant-listings-pagination a', function() {249 var target = $( this ).closest( 'div.restaurant_listings');250 var page = $( this ).data( 'page');251 252 restaurant_listings_store_state( target, page);253 254 target.triggerHandler( 'update_results', [ page, false ]);255 256 $( 'body, html').animate({243 $('input[name="search_price_range"]').attr('value', $clickedLi.attr('data-price_range')); 244 $('input[name="search_price_range"]').triggerHandler('change'); 245 $clickedLi.css({ 'background-color': '#c4f3a4', 'border': '1px solid #41a700', 'color': '#348c42' }); 246 }); 247 248 $('div.restaurant_listings').on('click', '.restaurant-listings-pagination a', function () { 249 var target = $(this).closest('div.restaurant_listings'); 250 var page = $(this).data('page'); 251 252 restaurant_listings_store_state(target, page); 253 254 target.triggerHandler('update_results', [page, false]); 255 256 $('body, html').animate({ 257 257 scrollTop: target.offset().top 258 }, 600 );258 }, 600); 259 259 260 260 return false; 261 } );262 263 if ( $.isFunction( $.fn.chosen )) {264 if ( restaurant_listings_ajax_filters.is_rtl === 1) {265 $( 'select[name^="search_categories"]' ).addClass( 'chosen-rtl');266 } 267 $( 'select[name^="search_categories"]').chosen({ search_contains: true });261 }); 262 263 if($.isFunction($.fn.chosen)) { 264 if(restaurant_listings_ajax_filters.is_rtl === 1) { 265 $('select[name^="search_categories"]').addClass('chosen-rtl'); 266 } 267 $('select[name^="search_categories"]').chosen({ search_contains: true }); 268 268 } 269 269 270 270 var $supports_html5_history = false; 271 if ( window.history && window.history.pushState) {271 if(window.history && window.history.pushState) { 272 272 $supports_html5_history = true; 273 273 } … … 275 275 var location = document.location.href.split('#')[0]; 276 276 277 function restaurant_listings_store_state( target, page) {278 if ( $supports_html5_history) {279 var form = target.find( '.restaurant_filters');280 var data = $( form).serialize();281 var index = $( 'div.restaurant_listings' ).index( target);282 window.history.replaceState( { id: 'restaurant_listings_state', page: page, data: data, index: index }, '', location + '#s=1');277 function restaurant_listings_store_state(target, page) { 278 if($supports_html5_history) { 279 var form = target.find('.restaurant_filters'); 280 var data = $(form).serialize(); 281 var index = $('div.restaurant_listings').index(target); 282 window.history.replaceState({ id: 'restaurant_listings_state', page: page, data: data, index: index }, '', location + '#s=1'); 283 283 } 284 284 } 285 285 286 286 // Inital restaurant and form population 287 $(window).on( 'load', function() {288 $( '.restaurant_filters' ).each( function() {289 var target = $( this ).closest( 'div.restaurant_listings');290 var form = target.find( '.restaurant_filters');287 $(window).on('load', function () { 288 $('.restaurant_filters').each(function () { 289 var target = $(this).closest('div.restaurant_listings'); 290 var form = target.find('.restaurant_filters'); 291 291 var inital_page = 1; 292 var index = $( 'div.restaurant_listings' ).index( target);293 294 if ( window.history.state && window.location.hash) {292 var index = $('div.restaurant_listings').index(target); 293 294 if(window.history.state && window.location.hash) { 295 295 var state = window.history.state; 296 if ( state.id && 'restaurant_listings_state' === state.id && index === state.index) {296 if(state.id && 'restaurant_listings_state' === state.id && index === state.index) { 297 297 inital_page = state.page; 298 form.deserialize( state.data);299 form.find( ':input[name^="search_categories"]' ).not(':input[type="hidden"]').trigger( 'chosen:updated');298 form.deserialize(state.data); 299 form.find(':input[name^="search_categories"]').not(':input[type="hidden"]').trigger('chosen:updated'); 300 300 } 301 301 } 302 302 303 target.triggerHandler( 'update_results', [ inital_page, false ]);303 target.triggerHandler('update_results', [inital_page, false]); 304 304 }); 305 305 }); 306 } );306 }); -
wp-restaurant-listings/trunk/assets/js/ajax-filters.min.js
r1839196 r1928419 1 jQuery(document).ready(function(t){var a=[];t(".restaurant_listings").on("update_results",function(e,r,s,i){var n,o,l,d,_="",c=t(this),u=c.find(".restaurant_filters"),g=c.find(".showing_restaurants"),p=c.find(".restaurant_listings"),h=c.data("per_page"),f=c.data("orderby"),w=c.data("order"),v=c.data("featured"),m=c.data("restaurant_types"),y=c.data("post_status"),k=t("div.restaurant_listings").index(this);if(!(k<0)){if(a[k]&&a[k].abort(),s||(t(p).addClass("loading"),t("li.restaurant_listings, li.no_restaurant_listings_found",p).css("visibility","hidden"),r>1&&!0!==c.data("show_pagination")?t(p).before('<a class="load_more_restaurants load_previous" href="#"><strong>'+restaurant_listings_ajax_filters.i18n_load_prev_listings+"</strong></a>"):c.find(".load_previous").remove(),c.find(".load_more_restaurants").data("page",r)),!0===c.data("show_filters")){var x=[];t(':input[name="filter_restaurant_type[]"]:checked, :input[name="filter_restaurant_type[]"][type="hidden"], :input[name="filter_restaurant_type"]',u).each(function(){x.push(t(this).val())}),n=u.find(':input[name^="search_categories"]').map(function(){return t(this).val()}).get(),o="",l="",d=u.find(':input[name="search_price_range"]').val();var b=u.find(':input[name="search_keywords"]'),j=u.find(':input[name="search_location"]');b.val()!==b.attr("placeholder")&&(o=b.val()),j.val()!==j.attr("placeholder")&&(l=j.val()),_={lang:restaurant_listings_ajax_filters.lang,search_keywords:o,search_location:l,search_categories:n,filter_restaurant_type:x,search_price_range:d,filter_post_status:y,per_page:h,orderby:f,order:w,page:r,featured:v,show_pagination:c.data("show_pagination"),form_data:u.serialize()}}else n=c.data("categories"),o=c.data("keywords"),l=c.data("location"),d=c.data("price_range"),n&&(n=n.split(",")),_={lang:restaurant_listings_ajax_filters.lang,search_categories:n,search_keywords:o,search_location:l,filter_post_status:y,search_price_range:d,filter_restaurant_type:m,per_page:h,orderby:f,order:w,page:r,featured:v,show_pagination:c.data("show_pagination")};a[k]=t.ajax({type:"POST",url:restaurant_listings_ajax_filters.ajax_url.toString().replace("%%endpoint%%","get_listings"),data:_,success:function(a){if(a)try{a.showing?t(g).show().html("<span>"+a.showing+"</span>"+a.showing_links):t(g).hide(),a.showing_all?t(g).addClass("wp-restaurant-listings-showing-all"):t(g).removeClass("wp-restaurant-listings-showing-all"),a.html&&(s&&i?t(p).prepend(a.html):s?t(p).append(a.html):t(p).html(a.html)),!0===c.data("show_pagination")?(c.find(".restaurant-listings-pagination").remove(),a.pagination&&c.append(a.pagination)):(!a.found_restaurants||a.max_num_pages<=r?t(".load_more_restaurants:not(.load_previous)",c).hide():i||t(".load_more_restaurants",c).show(),t(".load_more_restaurants",c).removeClass("loading"),t("li.restaurant_listings",p).css("visibility","visible")),t(p).removeClass("loading"),c.triggerHandler("updated_results",a)}catch(t){window.console&&window.console.log(t)}},error:function(t,a,e){window.console&&"abort"!==a&&window.console.log(a+": "+e)},statusCode:{404:function(){window.console&&window.console.log("Error 404: Ajax Endpoint cannot be reached. Go to Settings > Permalinks and save to resolve.")}}})}}),t('#search_keywords, #search_location, .restaurant_types :input, #search_categories, .restaurant-listings-filter, input[name="search_price_range"]').change(function(){var a=t(this).closest("div.restaurant_listings");a.triggerHandler("update_results",[1,!1]),s(a,1)}).on("keyup",function(a){13===a.which&&t(this).trigger("change")}),t(".restaurant_filters").on("click",".reset",function(){var a=t(this).closest("div.restaurant_listings"),e=t(this).closest("form");return e.find(':input[name="search_keywords"], :input[name="search_location"], .restaurant-listings-filter').not(':input[type="hidden"]').val("").trigger("chosen:updated"),e.find(':input[name^="search_categories"]').not(':input[type="hidden"]').val( 0).trigger("chosen:updated"),t(':input[name="filter_restaurant_type[]"]',e).not(':input[type="hidden"]').attr("checked","checked"),e.find(':input[name="search_price_range"]').val(""),e.find(".price_range_filter li").attr("style",""),a.triggerHandler("reset"),a.triggerHandler("update_results",[1,!1]),s(a,1),!1}),t(document.body).on("click",".load_more_restaurants",function(){var a=t(this).closest("div.restaurant_listings"),e=parseInt(t(this).data("page")||1,10),r=!1;return t(this).addClass("loading"),t(this).is(".load_previous")?(r=!0,1===(e-=1)?t(this).remove():t(this).data("page",e)):(e+=1,t(this).data("page",e),s(a,e)),a.triggerHandler("update_results",[e,!0,r]),!1}),t(".price_range_filter").on("click","li",function(){t(".price_range_filter li").attr("style","");var a=t(this);t('input[name="search_price_range"]').attr("value",a.attr("data-price_range")),t('input[name="search_price_range"]').triggerHandler("change"),a.css({"background-color":"#c4f3a4",border:"1px solid #41a700",color:"#348c42"})}),t("div.restaurant_listings").on("click",".restaurant-listings-pagination a",function(){var a=t(this).closest("div.restaurant_listings"),e=t(this).data("page");return s(a,e),a.triggerHandler("update_results",[e,!1]),t("body, html").animate({scrollTop:a.offset().top},600),!1}),t.isFunction(t.fn.chosen)&&(1===restaurant_listings_ajax_filters.is_rtl&&t('select[name^="search_categories"]').addClass("chosen-rtl"),t('select[name^="search_categories"]').chosen({search_contains:!0}));var e=!1;window.history&&window.history.pushState&&(e=!0);var r=document.location.href.split("#")[0];function s(a,s){if(e){var i=a.find(".restaurant_filters"),n=t(i).serialize(),o=t("div.restaurant_listings").index(a);window.history.replaceState({id:"restaurant_listings_state",page:s,data:n,index:o},"",r+"#s=1")}}t(window).on("load",function(){t(".restaurant_filters").each(function(){var a=t(this).closest("div.restaurant_listings"),e=a.find(".restaurant_filters"),r=1,s=t("div.restaurant_listings").index(a);if(window.history.state&&window.location.hash){var i=window.history.state;i.id&&"restaurant_listings_state"===i.id&&s===i.index&&(r=i.page,e.deserialize(i.data),e.find(':input[name^="search_categories"]').not(':input[type="hidden"]').trigger("chosen:updated"))}a.triggerHandler("update_results",[r,!1])})})});1 jQuery(document).ready(function(t){var a=[];t(".restaurant_listings").on("update_results",function(e,r,s,i){var n,o,l,d,_="",c=t(this),u=c.find(".restaurant_filters"),g=c.find(".showing_restaurants"),p=c.find(".restaurant_listings"),h=c.data("per_page"),f=c.data("orderby"),w=c.data("order"),v=c.data("featured"),m=c.data("restaurant_types"),y=c.data("post_status"),k=t("div.restaurant_listings").index(this);if(!(k<0)){if(a[k]&&a[k].abort(),s||(t(p).addClass("loading"),t("li.restaurant_listings, li.no_restaurant_listings_found",p).css("visibility","hidden"),r>1&&!0!==c.data("show_pagination")?t(p).before('<a class="load_more_restaurants load_previous" href="#"><strong>'+restaurant_listings_ajax_filters.i18n_load_prev_listings+"</strong></a>"):c.find(".load_previous").remove(),c.find(".load_more_restaurants").data("page",r)),!0===c.data("show_filters")){var x=[];t(':input[name="filter_restaurant_type[]"]:checked, :input[name="filter_restaurant_type[]"][type="hidden"], :input[name="filter_restaurant_type"]',u).each(function(){x.push(t(this).val())}),n=u.find(':input[name^="search_categories"]').map(function(){return t(this).val()}).get(),o="",l="",d=u.find(':input[name="search_price_range"]').val();var b=u.find(':input[name="search_keywords"]'),j=u.find(':input[name="search_location"]');b.val()!==b.attr("placeholder")&&(o=b.val()),j.val()!==j.attr("placeholder")&&(l=j.val()),_={lang:restaurant_listings_ajax_filters.lang,search_keywords:o,search_location:l,search_categories:n,filter_restaurant_type:x,search_price_range:d,filter_post_status:y,per_page:h,orderby:f,order:w,page:r,featured:v,show_pagination:c.data("show_pagination"),form_data:u.serialize()}}else n=c.data("categories"),o=c.data("keywords"),l=c.data("location"),d=c.data("price_range"),n&&(n=n.split(",")),_={lang:restaurant_listings_ajax_filters.lang,search_categories:n,search_keywords:o,search_location:l,filter_post_status:y,search_price_range:d,filter_restaurant_type:m,per_page:h,orderby:f,order:w,page:r,featured:v,show_pagination:c.data("show_pagination")};a[k]=t.ajax({type:"POST",url:restaurant_listings_ajax_filters.ajax_url.toString().replace("%%endpoint%%","get_listings"),data:_,success:function(a){if(a)try{a.showing?t(g).show().html("<span>"+a.showing+"</span>"+a.showing_links):t(g).hide(),a.showing_all?t(g).addClass("wp-restaurant-listings-showing-all"):t(g).removeClass("wp-restaurant-listings-showing-all"),a.html&&(s&&i?t(p).prepend(a.html):s?t(p).append(a.html):t(p).html(a.html)),!0===c.data("show_pagination")?(c.find(".restaurant-listings-pagination").remove(),a.pagination&&c.append(a.pagination)):(!a.found_restaurants||a.max_num_pages<=r?t(".load_more_restaurants:not(.load_previous)",c).hide():i||t(".load_more_restaurants",c).show(),t(".load_more_restaurants",c).removeClass("loading"),t("li.restaurant_listings",p).css("visibility","visible")),t(p).removeClass("loading"),c.triggerHandler("updated_results",a)}catch(t){window.console&&window.console.log(t)}},error:function(t,a,e){window.console&&"abort"!==a&&window.console.log(a+": "+e)},statusCode:{404:function(){window.console&&window.console.log("Error 404: Ajax Endpoint cannot be reached. Go to Settings > Permalinks and save to resolve.")}}})}}),t('#search_keywords, #search_location, .restaurant_types :input, #search_categories, .restaurant-listings-filter, input[name="search_price_range"]').change(function(){var a=t(this).closest("div.restaurant_listings");a.triggerHandler("update_results",[1,!1]),s(a,1)}).on("keyup",function(a){13===a.which&&t(this).trigger("change")}),t(".restaurant_filters").on("click",".reset",function(){var a=t(this).closest("div.restaurant_listings"),e=t(this).closest("form");return e.find(':input[name="search_keywords"], :input[name="search_location"], .restaurant-listings-filter').not(':input[type="hidden"]').val("").trigger("chosen:updated"),e.find(':input[name^="search_categories"]').not(':input[type="hidden"]').val("").trigger("chosen:updated"),t(':input[name="filter_restaurant_type[]"]',e).not(':input[type="hidden"]').attr("checked","checked"),e.find(':input[name="search_price_range"]').val(""),e.find(".price_range_filter li").attr("style",""),a.triggerHandler("reset"),a.triggerHandler("update_results",[1,!1]),s(a,1),!1}),t(document.body).on("click",".load_more_restaurants",function(){var a=t(this).closest("div.restaurant_listings"),e=parseInt(t(this).data("page")||1,10),r=!1;return t(this).addClass("loading"),t(this).is(".load_previous")?(r=!0,1===(e-=1)?t(this).remove():t(this).data("page",e)):(e+=1,t(this).data("page",e),s(a,e)),a.triggerHandler("update_results",[e,!0,r]),!1}),t(".price_range_filter").on("click","li",function(){t(".price_range_filter li").attr("style","");var a=t(this);t('input[name="search_price_range"]').attr("value",a.attr("data-price_range")),t('input[name="search_price_range"]').triggerHandler("change"),a.css({"background-color":"#c4f3a4",border:"1px solid #41a700",color:"#348c42"})}),t("div.restaurant_listings").on("click",".restaurant-listings-pagination a",function(){var a=t(this).closest("div.restaurant_listings"),e=t(this).data("page");return s(a,e),a.triggerHandler("update_results",[e,!1]),t("body, html").animate({scrollTop:a.offset().top},600),!1}),t.isFunction(t.fn.chosen)&&(1===restaurant_listings_ajax_filters.is_rtl&&t('select[name^="search_categories"]').addClass("chosen-rtl"),t('select[name^="search_categories"]').chosen({search_contains:!0}));var e=!1;window.history&&window.history.pushState&&(e=!0);var r=document.location.href.split("#")[0];function s(a,s){if(e){var i=a.find(".restaurant_filters"),n=t(i).serialize(),o=t("div.restaurant_listings").index(a);window.history.replaceState({id:"restaurant_listings_state",page:s,data:n,index:o},"",r+"#s=1")}}t(window).on("load",function(){t(".restaurant_filters").each(function(){var a=t(this).closest("div.restaurant_listings"),e=a.find(".restaurant_filters"),r=1,s=t("div.restaurant_listings").index(a);if(window.history.state&&window.location.hash){var i=window.history.state;i.id&&"restaurant_listings_state"===i.id&&s===i.index&&(r=i.page,e.deserialize(i.data),e.find(':input[name^="search_categories"]').not(':input[type="hidden"]').trigger("chosen:updated"))}a.triggerHandler("update_results",[r,!1])})})}); -
wp-restaurant-listings/trunk/includes/3rd-party/polylang.php
r1851196 r1928419 12 12 add_filter( 'wprl_lang', 'polylang_wprl_get_restaurant_listings_lang' ); 13 13 add_filter( 'wprl_page_id', 'polylang_wprl_page_id' ); 14 add_action( 'get_restaurant_listings_query_args', 'polylang_wprl_query_language' ); 14 15 } 15 16 add_action( 'pll_init', 'polylang_wprl_init' ); 17 18 /** 19 * Sets the current language when running restaurant listings query. 20 * 21 * @since 1.0.1 22 * 23 * @param array $query_args 24 * @return array 25 */ 26 function polylang_wprl_query_language( $query_args ) { 27 if ( isset( $_POST['lang'] ) ) { 28 $query_args['lang'] = $_POST['lang']; 29 } 30 return $query_args; 31 } 16 32 17 33 /** … … 46 62 return absint( $page_id ); 47 63 } 48 -
wp-restaurant-listings/trunk/includes/abstracts/abstract-wp-restaurant-listings-form.php
r1851196 r1928419 85 85 ) { 86 86 delete_post_meta( $_COOKIE[ 'wp-restaurant-listings-submitting-restaurant-id' ], '_submitting_key' ); 87 setcookie( 'wp-restaurant-listings-submitting-restaurant-id', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, false );88 setcookie( 'wp-restaurant-listings-submitting-restaurant-key', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, false );87 setcookie( 'wp-restaurant-listings-submitting-restaurant-id', '', 0, COOKIEPATH, COOKIE_DOMAIN, false ); 88 setcookie( 'wp-restaurant-listings-submitting-restaurant-key', '', 0, COOKIEPATH, COOKIE_DOMAIN, false ); 89 89 wp_redirect( remove_query_arg( array( 'new', 'key' ), $_SERVER[ 'REQUEST_URI' ] ) ); 90 90 } … … 237 237 */ 238 238 protected function sort_by_priority( $a, $b ) { 239 if ( $a['priority'] == $b['priority'] ) {240 return 0;241 }242 return ( $a['priority'] < $b['priority'] ) ? -1 : 1;239 if ( $a['priority'] == $b['priority'] ) { 240 return 0; 241 } 242 return ( $a['priority'] < $b['priority'] ) ? -1 : 1; 243 243 } 244 244 … … 284 284 * Navigates through an array and sanitizes the field. 285 285 * 286 * @param array|string $value The array or string to be sanitized. 287 * @return array|string $value The sanitized array (or string from the callback). 288 */ 289 protected function sanitize_posted_field( $value ) { 290 // Santize value 291 $value = is_array( $value ) ? array_map( array( $this, 'sanitize_posted_field' ), $value ) : sanitize_text_field( stripslashes( trim( $value ) ) ); 292 293 return $value; 286 * @since 1.0.0 287 * @since 1.0.1 Added the $sanitizer argument 288 * 289 * @param array|string $value The array or string to be sanitized. 290 * @param string|callable $sanitizer The sanitization method to use. Built in: `url`, `email`, `url_or_email`, or 291 * default (text). Custom single argument callable allowed. 292 * @return array|string $value The sanitized array (or string from the callback). 293 */ 294 protected function sanitize_posted_field( $value, $sanitizer = null ) { 295 // Sanitize value. 296 if ( is_array( $value ) ) { 297 foreach ( $value as $key => $val ) { 298 $value[ $key ] = $this->sanitize_posted_field( $val, $sanitizer ); 299 } 300 301 return $value; 302 } 303 304 $value = trim( $value ); 305 306 if ( 'url' === $sanitizer ) { 307 return esc_url_raw( $value ); 308 } elseif ( 'email' === $sanitizer ) { 309 return sanitize_email( $value ); 310 } elseif ( 'url_or_email' === $sanitizer ) { 311 if ( null !== parse_url( $value, PHP_URL_HOST ) ) { 312 // Sanitize as URL. 313 return esc_url_raw( $value ); 314 } 315 // Sanitize as email. 316 return sanitize_email( $value ); 317 } elseif ( is_callable( $sanitizer ) ) { 318 return call_user_func( $sanitizer, $value ); 319 } 320 321 // Use standard text sanitizer. 322 return sanitize_text_field( stripslashes( $value ) ); 294 323 } 295 324 … … 302 331 */ 303 332 protected function get_posted_field( $key, $field ) { 304 return isset( $_POST[ $key ] ) ? $this->sanitize_posted_field( $_POST[ $key ] ) : ''; 333 // Allow custom sanitizers with standard text fields. 334 if ( ! isset( $field['sanitizer'] ) ) { 335 $field['sanitizer'] = null; 336 } 337 return isset( $_POST[ $key ] ) ? $this->sanitize_posted_field( $_POST[ $key ], $field['sanitizer'] ) : ''; 305 338 } 306 339 -
wp-restaurant-listings/trunk/includes/admin/class-wp-restaurant-listings-admin.php
r1851196 r1928419 39 39 global $wp_version; 40 40 41 include_once ( 'class-wp-restaurant-listings-cpt.php' );41 include_once dirname( __FILE__ ) . '/class-wp-restaurant-listings-cpt.php'; 42 42 if ( version_compare( $wp_version, '4.7.0', '<' ) ) { 43 include_once ( 'class-wp-restaurant-listings-cpt-legacy.php' );43 include_once dirname( __FILE__ ) . '/class-wp-restaurant-listings-cpt-legacy.php'; 44 44 WP_Restaurant_Listings_CPT_Legacy::instance(); 45 45 } else { 46 46 WP_Restaurant_Listings_CPT::instance(); 47 47 } 48 include_once( 'class-wp-restaurant-listings-settings.php' ); 49 include_once( 'class-wp-restaurant-listings-writepanels.php' ); 50 include_once( 'class-wp-restaurant-listings-setup.php' ); 48 49 include_once dirname( __FILE__ ) . '/class-wp-restaurant-listings-settings.php'; 50 include_once dirname( __FILE__ ) . '/class-wp-restaurant-listings-writepanels.php'; 51 include_once dirname( __FILE__ ) . '/class-wp-restaurant-listings-setup.php'; 51 52 52 53 $this->settings_page = WP_Restaurant_Listings_Settings::instance(); … … 61 62 */ 62 63 public function conditional_includes() { 63 if ( ! $screen = get_current_screen() ) { 64 $screen = get_current_screen(); 65 if ( ! $screen ) { 64 66 return; 65 67 } 68 66 69 switch ( $screen->id ) { 67 case 'options-permalink' :68 include ( 'class-wp-restaurant-listings-permalink-settings.php' );70 case 'options-permalink': 71 include dirname( __FILE__ ) . '/class-wp-restaurant-listings-permalink-settings.php'; 69 72 break; 70 73 } -
wp-restaurant-listings/trunk/includes/admin/class-wp-restaurant-listings-setup.php
r1858484 r1928419 157 157 <?php if ( 1 === $step ) : ?> 158 158 159 <h3><?php _e( ' Setup Wizard Introduction', 'wp-restaurant-listings' ); ?></h3>160 161 <p><?php _e( 'Thanks for installing <em>WP Restaurant Listings</em>! ', 'wp-restaurant-listings' ); ?></p>162 <p><?php _e( 'This setup wizard will help you get started by creating the pages for restaurant submission, restaurant listings, and listings your restaurants.', 'wp-restaurant-listings' ); ?></p>163 <p><?php printf( __( 'If you want to skip the wizard and setup the pages and shortcodes yourself manually, the process is still relatively simple. Refer to the %sdocumentation%s for help.', 'wp-restaurant-listings' ), '<a href="https://wpdrift.com/docs/restaurants/">', '</a>' ); ?></p>159 <h3><?php _e( 'Welcome to the Setup Wizard!', 'wp-restaurant-listings' ); ?></h3> 160 161 <p><?php _e( 'Thanks for installing <em>WP Restaurant Listings</em>! Let\'s get your site ready to accept restaurant listings.', 'wp-restaurant-listings' ); ?></p> 162 <p><?php _e( 'This setup wizard will walk you through the process of creating the pages for restaurant submissions, management, and listings.', 'wp-restaurant-listings' ); ?></p> 163 <p><?php printf( __( 'If you\'d prefer to skip this and set up your pages manually, our %sdocumentation%s will walk you through each step.', 'wp-restaurant-listings' ), '<a href="https://wpdrift.com/docs/restaurants/">', '</a>' ); ?></p> 164 164 165 165 <p class="submit"> 166 <a href="<?php echo esc_url( add_query_arg( 'step', 2 ) ); ?>" class="button button-primary"><?php _e( ' Continue to pagesetup', 'wp-restaurant-listings' ); ?></a>167 <a href="<?php echo esc_url( add_query_arg( 'skip-restaurant-listings-setup', 1, admin_url( 'index.php?page=restaurant-listings-setup&step=3' ) ) ); ?>" class="button"><?php _e( 'Skip setup. I will set up the plugin manually', 'wp-restaurant-listings' ); ?></a>166 <a href="<?php echo esc_url( add_query_arg( 'step', 2 ) ); ?>" class="button button-primary"><?php _e( 'Start setup', 'wp-restaurant-listings' ); ?></a> 167 <a href="<?php echo esc_url( add_query_arg( 'skip-restaurant-listings-setup', 1, admin_url( 'index.php?page=restaurant-listings-setup&step=3' ) ) ); ?>" class="button"><?php _e( 'Skip setup. I will set up the plugin manually.', 'wp-restaurant-listings' ); ?></a> 168 168 </p> 169 169 … … 173 173 <h3><?php _e( 'Page Setup', 'wp-restaurant-listings' ); ?></h3> 174 174 175 <p><?php printf( __( '<em>WP Restaurant Listings</em> includes %1$sshortcodes%2$s which can be used within your %3$spages%2$s to output content. These can be created for you below. For more information on the restaurant shortcodes view the %4$sshortcode documentation%2$s.', 'wp-restaurant-listings' ), '<a href="http://codex.wordpress.org/Shortcode" title="What is a shortcode?" target="_blank" class="help-page-link">', '</a>', '<a href="http://codex.wordpress.org/Pages" target="_blank" class="help-page-link">', '<a href="https://wpdrift.com/docs/restaurants/shortcode-reference/" target="_blank" class="help-page-link">' ); ?></p> 175 <p><?php _e( 'WP Restaurant Listings, users can post, manage, and browse restaurant listings right on your website. Tell us which of these common pages you\'d like your site to have and we\'ll create and configure them for you.', 'wp-restaurant-listings' ); ?></p> 176 <p><?php printf( __( '(These pages are created using %1$sshortcodes%2$s, which we take care of in this step. If you\'d like to build these pages yourself or want to add one of these options to an existing page on your site, you can skip this step and take a look at %4$sshortcode documentation%2$s for detailed instructions.)', 'wp-restaurant-listings' ), '<a href="http://codex.wordpress.org/Shortcode" title="What is a shortcode?" target="_blank" class="help-page-link">', '</a>', '<a href="http://codex.wordpress.org/Pages" target="_blank" class="help-page-link">', '<a href="https://wpdrift.com/docs/restaurants/shortcode-reference/" target="_blank" class="help-page-link">' ); ?></p> 176 177 177 178 <form action="<?php echo esc_url( add_query_arg( 'step', 3 ) ); ?>" method="post"> … … 191 192 <td><input type="text" value="<?php echo esc_attr( _x( 'Post a Restaurant', 'Default page title (wizard)', 'wp-restaurant-listings' ) ); ?>" name="wp-restaurant-listings-page-title[submit_restaurant_form]" /></td> 192 193 <td> 193 <p><?php _e( 'This page allows employers to post restaurants to your website from the front-end.', 'wp-restaurant-listings' ); ?></p> 194 195 <p><?php _e( 'If you do not want to accept submissions from users in this way (for example you just want to post restaurants from the admin dashboard) you can skip creating this page.', 'wp-restaurant-listings' ); ?></p> 194 <p><?php _e( 'Creates a page that allows users to post new restaurants directly from a page on your website, instead of requiring them to log in to an admin area. If you\'d rather not allow this -- for example, if you want users to use the admin dashboard only -- you can uncheck this setting.', 'wp-restaurant-listings' ); ?></p> 196 195 </td> 197 196 <td><code>[submit_restaurant_form]</code></td> … … 201 200 <td><input type="text" value="<?php echo esc_attr( _x( 'Restaurant Dashboard', 'Default page title (wizard)', 'wp-restaurant-listings' ) ); ?>" name="wp-restaurant-listings-page-title[restaurant_dashboard]" /></td> 202 201 <td> 203 <p><?php _e( 'This page allows employers to manage and edit their own restaurants from the front-end.', 'wp-restaurant-listings' ); ?></p> 204 205 <p><?php _e( 'If you plan on managing all listings from the admin dashboard you can skip creating this page.', 'wp-restaurant-listings' ); ?></p> 202 <p><?php _e( 'Creates a page that allows users to manage their restaurant listings directly from a page on your website, instead of requiring them to log in to an admin area. If you want to manage all restaurant listings from the admin dashboard only, you can uncheck this setting.', 'wp-restaurant-listings' ); ?></p> 206 203 </td> 207 204 <td><code>[restaurant_dashboard]</code></td> … … 210 207 <td><input type="checkbox" checked="checked" name="wp-restaurant-listings-create-page[restaurants]" /></td> 211 208 <td><input type="text" value="<?php echo esc_attr( _x( 'Restaurants', 'Default page title (wizard)', 'wp-restaurant-listings' ) ); ?>" name="wp-restaurant-listings-page-title[restaurants]" /></td> 212 <td><?php _e( ' This page allows users to browse, search, and filter restaurant listings on the front-end of your site.', 'wp-restaurant-listings' ); ?></td>209 <td><?php _e( 'Creates a page where visitors can browse, search, and filter restaurant listings.', 'wp-restaurant-listings' ); ?></td> 213 210 <td><code>[restaurants]</code></td> 214 211 </tr> … … 234 231 <?php if ( 3 === $step ) : ?> 235 232 236 <h3><?php _e( ' All Done!', 'wp-restaurant-listings' ); ?></h3>237 238 <p><?php _e( ' Looks like you\'re all set to start using the plugin. In case you\'re wondering where to go next:', 'wp-restaurant-listings' ); ?></p>233 <h3><?php _e( 'You\'re ready to start using WP Restaurant Listings!', 'wp-restaurant-listings' ); ?></h3> 234 235 <p><?php _e( 'Wondering what to do now? Here are some of the most common next steps:', 'wp-restaurant-listings' ); ?></p> 239 236 240 237 <ul class="wp-restaurant-listings-next-steps"> 241 <li><a href="<?php echo admin_url( 'edit.php?post_type=restaurant_listings&page=restaurant-listings-settings' ); ?>"><?php _e( 'Tweak the plugin settings', 'wp-restaurant-listings' ); ?></a></li> 242 <li><a href="<?php echo admin_url( 'post-new.php?post_type=restaurant_listings' ); ?>"><?php _e( 'Add a restaurant via the back-end', 'wp-restaurant-listings' ); ?></a></li> 238 <li><a href="<?php echo admin_url( 'edit.php?post_type=restaurant_listings&page=restaurant-listings-settings' ); ?>"><?php _e( 'Tweak your settings', 'wp-restaurant-listings' ); ?></a></li> 239 <li><a href="<?php echo admin_url( 'post-new.php?post_type=restaurant_listings' ); ?>"><?php _e( 'Add a restaurant using the admin dashboard', 'wp-restaurant-listings' ); ?></a></li> 240 241 <?php if ( $permalink = restaurant_listings_get_permalink( 'restaurants' ) ) : ?> 242 <li><a href="<?php echo esc_url( $permalink ); ?>"><?php _e( 'View submitted restaurant listings', 'wp-restaurant-listings' ); ?></a></li> 243 <?php else : ?> 244 <li><a href="https://wpdrift.com/docs/restaurants/shortcode-reference/#section-1"><?php _e( 'Add restaurant listings to a page using the [restaurants] shortcode', 'wp-restaurant-listings' ); ?></a></li> 245 <?php endif; ?> 243 246 244 247 <?php if ( $permalink = restaurant_listings_get_permalink( 'submit_restaurant_form' ) ) : ?> 245 248 <li><a href="<?php echo esc_url( $permalink ); ?>"><?php _e( 'Add a restaurant via the front-end', 'wp-restaurant-listings' ); ?></a></li> 246 249 <?php else : ?> 247 <li><a href="https://wpdrift.com/docs/restaurants/the-restaurant-submission-form/"><?php _e( 'Find out more about the front-end restaurant submission form', 'wp-restaurant-listings' ); ?></a></li> 248 <?php endif; ?> 249 250 <?php if ( $permalink = restaurant_listings_get_permalink( 'restaurants' ) ) : ?> 251 <li><a href="<?php echo esc_url( $permalink ); ?>"><?php _e( 'View submitted restaurant listings', 'wp-restaurant-listings' ); ?></a></li> 252 <?php else : ?> 253 <li><a href="https://wpdrift.com/docs/restaurants/shortcode-reference/#section-1"><?php _e( 'Add the [restaurants] shortcode to a page to list restaurants', 'wp-restaurant-listings' ); ?></a></li> 250 <li><a href="https://wpdrift.com/docs/restaurants/the-restaurant-submission-form/"><?php _e( 'Learn to use the front-end restaurant submission board', 'wp-restaurant-listings' ); ?></a></li> 254 251 <?php endif; ?> 255 252 … … 257 254 <li><a href="<?php echo esc_url( $permalink ); ?>"><?php _e( 'View the restaurant dashboard', 'wp-restaurant-listings' ); ?></a></li> 258 255 <?php else : ?> 259 <li><a href="https://wpdrift.com/docs/restaurants/the-restaurant-dashboard/"><?php _e( ' Find out more aboutthe front-end restaurant dashboard', 'wp-restaurant-listings' ); ?></a></li>256 <li><a href="https://wpdrift.com/docs/restaurants/the-restaurant-dashboard/"><?php _e( 'Learn to use the front-end restaurant dashboard', 'wp-restaurant-listings' ); ?></a></li> 260 257 <?php endif; ?> 261 258 </ul> 262 259 263 <p><?php printf( __( ' And don\'t forget, if you need any more help using <em>WP Restaurant Listings</em> you can consult the %1$sdocumentation%2$s or %3$spost on the forums%2$s!', 'wp-restaurant-listings' ), '<a href="https://wpdrift.com/docs/restaurants/">', '</a>', '<a href="https://wordpress.org/support/plugin/wp-restaurant-listings">' ); ?></p>260 <p><?php printf( __( 'If you need help, you can find more detail in our %1$ssupport documentation%2$s or post your question on the %3$sWP Restaurant Listings support forums%2$s.', 'wp-restaurant-listings' ), '<a href="https://wpdrift.com/docs/restaurants/">', '</a>', '<a href="https://wordpress.org/support/plugin/wp-restaurant-listings">' ); ?></p> 264 261 265 262 <div class="wp-restaurant-listings-support-the-plugin"> 266 <h3><?php _e( 'Support the Ongoing Development of this Plugin', 'wp-restaurant-listings' ); ?></h3>267 <p><?php _e( 'There are many ways to support open-source projects such as WP Restaurant Listings, for example code contribution, translation, or even telling your friends how awesome the plugin (hopefully) is. Thanks in advance for your support - it is much appreciated!', 'wp-restaurant-listings' ); ?></p>263 <h3><?php _e( 'Support WP Restaurant Listings\'s Ongoing Development', 'wp-restaurant-listings' ); ?></h3> 264 <p><?php _e( 'There are lots of ways you can support open source software projects like this one: contributing code, fixing a bug, assisting with non-English translation, or just telling your friends about WP Restaurant Listings to help spread the word. We appreciate your support!', 'wp-restaurant-listings' ); ?></p> 268 265 <ul> 269 266 <li class="icon-review"><a href="https://wordpress.org/support/view/plugin-reviews/wp-restaurant-listings#postform"><?php _e( 'Leave a positive review', 'wp-restaurant-listings' ); ?></a></li> -
wp-restaurant-listings/trunk/includes/admin/class-wp-restaurant-listings-writepanels.php
r1851196 r1928419 269 269 ?> 270 270 <p class="form-field"> 271 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>271 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label> 272 272 <?php 273 273 if ( ! empty( $field['multiple'] ) ) { … … 311 311 ?> 312 312 <p class="form-field"> 313 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>313 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label> 314 314 <?php 315 315 if ( ! empty( $field['multiple'] ) ) { … … 354 354 ?> 355 355 <p class="form-field"> 356 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>356 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label> 357 357 <input type="text" autocomplete="off" name="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $classes ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" /> 358 358 </p> … … 406 406 ?> 407 407 <p class="form-field"> 408 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>408 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label> 409 409 <?php if ( ! empty( $field['information'] ) ) : ?><span class="information"><?php echo wp_kses( $field['information'], array( 'a' => array( 'href' => array() ) ) ); ?></span><?php endif; ?> 410 410 <?php echo $hidden_input; ?> … … 432 432 ?> 433 433 <p class="form-field"> 434 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>434 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label> 435 435 <textarea name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>"><?php echo esc_html( $field['value'] ); ?></textarea> 436 436 </p> … … 457 457 ?> 458 458 <p class="form-field"> 459 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>459 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label> 460 460 <select name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $key ); ?>"> 461 461 <?php foreach ( $field['options'] as $key => $value ) : ?> … … 486 486 ?> 487 487 <p class="form-field"> 488 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>488 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label> 489 489 <select multiple="multiple" name="<?php echo esc_attr( $name ); ?>[]" id="<?php echo esc_attr( $key ); ?>"> 490 490 <?php foreach ( $field['options'] as $key => $value ) : ?> … … 515 515 ?> 516 516 <p class="form-field form-field-checkbox"> 517 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?></label>517 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?></label> 518 518 <input type="checkbox" class="checkbox" name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $key ); ?>" value="1" <?php checked( $field['value'], 1 ); ?> /> 519 519 <?php if ( ! empty( $field['description'] ) ) : ?><span class="description"><?php echo $field['description']; ?></span><?php endif; ?> … … 543 543 ?> 544 544 <p class="form-field form-field-author"> 545 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>:</label>545 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>:</label> 546 546 <span class="current-author"> 547 547 <?php … … 580 580 ?> 581 581 <p class="form-field form-field-checkbox"> 582 <label><?php echo esc_html( $field['label'] ) ; ?></label>582 <label><?php echo wp_strip_all_tags( $field['label'] ) ; ?></label> 583 583 <?php foreach ( $field['options'] as $option_key => $value ) : ?> 584 584 <label><input type="radio" class="radio" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" value="<?php echo esc_attr( $option_key ); ?>" <?php checked( $field['value'], $option_key ); ?> /> <?php echo esc_html( $value ); ?></label> … … 629 629 630 630 <?php if ( ! is_admin() ) : ?> 631 <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>:</label>631 <label for="<?php echo esc_attr( $key ); ?>"><?php echo wp_strip_all_tags( $field['label'] ) ; ?>:</label> 632 632 <?php endif; ?> 633 633 -
wp-restaurant-listings/trunk/includes/class-wp-restaurant-listings.php
r1851196 r1928419 22 22 * @var string 23 23 */ 24 public $version = '1.0. 0';24 public $version = '1.0.1'; 25 25 26 26 /** … … 119 119 add_action( 'admin_init', array( $this, 'updater' ) ); 120 120 add_action( 'wp_logout', array( $this, 'cleanup_restaurant_posting_cookies' ) ); 121 122 // Defaults for WPRL core actions. 123 add_action( 'wprl_notify_new_user', 'wp_restaurant_listings_notify_new_user', 10, 2 ); 121 124 } 122 125 -
wp-restaurant-listings/trunk/includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php
r1851196 r1928419 139 139 } 140 140 141 $currency_symbol = get_option('restaurant_listings_currency');141 $currency_symbol = get_option('restaurant_listings_currency'); 142 142 143 143 $this->fields = apply_filters( 'submit_restaurant_form_fields', array( 144 144 'basic' => array( 145 'restaurant_name' => array(146 'label' => __( 'Restaurant name', 'wp-restaurant-listings' ),147 'type' => 'text',148 'required' => true,149 'placeholder' => __( 'Enter the name of the restaurant', 'wp-restaurant-listings' ),150 'priority' => 1151 ),145 'restaurant_name' => array( 146 'label' => __( 'Restaurant name', 'wp-restaurant-listings' ), 147 'type' => 'text', 148 'required' => true, 149 'placeholder' => __( 'Enter the name of the restaurant', 'wp-restaurant-listings' ), 150 'priority' => 1 151 ), 152 152 'restaurant_location' => array( 153 153 'label' => __( 'Address', 'wp-restaurant-listings' ), … … 177 177 ), 178 178 'restaurant_price_range' => array( 179 'label' => __( 'Price Range', 'wp-restaurant-listings' ),180 'type' => 'select',181 'default' => 1,182 'options' => array(183 1 => str_repeat( $currency_symbol, 1 ),184 2 => str_repeat( $currency_symbol, 2 ),185 3 => str_repeat( $currency_symbol, 3 ),186 4 => str_repeat( $currency_symbol, 4 ),187 ),188 'required' => true,189 'priority' => 5,190 'default' => '',191 ),179 'label' => __( 'Price Range', 'wp-restaurant-listings' ), 180 'type' => 'select', 181 'default' => 1, 182 'options' => array( 183 1 => str_repeat( $currency_symbol, 1 ), 184 2 => str_repeat( $currency_symbol, 2 ), 185 3 => str_repeat( $currency_symbol, 3 ), 186 4 => str_repeat( $currency_symbol, 4 ), 187 ), 188 'required' => true, 189 'priority' => 5, 190 'default' => '', 191 ), 192 192 'restaurant_description' => array( 193 193 'label' => __( 'Description', 'wp-restaurant-listings' ), … … 200 200 'label' => __( 'Restaurant email', 'wp-restaurant-listings' ), 201 201 'type' => 'text', 202 'sanitizer' => 'url_or_email', 202 203 'required' => true, 203 204 'placeholder' => __( 'Enter an email address or website URL', 'wp-restaurant-listings' ), … … 213 214 'priority' => 1 214 215 ), 215 'restaurant_website' => array(216 'restaurant_website' => array( 216 217 'label' => __( 'Website', 'wp-restaurant-listings' ), 217 218 'type' => 'text', 219 'sanitizer' => 'url', 218 220 'required' => false, 219 221 'placeholder' => __( 'http://', 'wp-restaurant-listings' ), … … 230 232 'label' => __( 'Video', 'wp-restaurant-listings' ), 231 233 'type' => 'text', 234 'sanitizer' => 'url', 232 235 'required' => false, 233 236 'placeholder' => __( 'A link to a video about your restaurant', 'wp-restaurant-listings' ), … … 256 259 ) 257 260 ), 258 'restaurant_image_gallery' => array(259 'label' => __( 'Gallery Images', 'wp-restaurant-listings' ),260 'type' => 'file',261 'multiple' => true,262 'required' => false,263 'placeholder' => '',264 'priority' => 7,265 'ajax' => true,266 'allowed_mime_types' => array(267 'jpg' => 'image/jpeg',268 'jpeg' => 'image/jpeg',269 'gif' => 'image/gif',270 'png' => 'image/png'271 )272 ),273 'restaurant_menu' => array(274 'label' => __( 'Menu', 'wp-restaurant-listings' ),275 'type' => 'file',276 'multiple' => true,277 'required' => false,278 'placeholder' => '',279 'priority' => 8,280 'ajax' => true,281 'allowed_mime_types' => array(282 'jpg' => 'image/jpeg',283 'jpeg' => 'image/jpeg',284 'gif' => 'image/gif',285 'png' => 'image/png'286 )287 ),288 'restaurant_hours' => array(289 'label' => __( 'Hours of Operation', 'wp-restaurant-listings' ),290 'type' => 'business-hours',291 'required' => false,292 'placeholder' => '',293 'priority' => 9,294 'default' => ''295 ),261 'restaurant_image_gallery' => array( 262 'label' => __( 'Gallery Images', 'wp-restaurant-listings' ), 263 'type' => 'file', 264 'multiple' => true, 265 'required' => false, 266 'placeholder' => '', 267 'priority' => 7, 268 'ajax' => true, 269 'allowed_mime_types' => array( 270 'jpg' => 'image/jpeg', 271 'jpeg' => 'image/jpeg', 272 'gif' => 'image/gif', 273 'png' => 'image/png' 274 ) 275 ), 276 'restaurant_menu' => array( 277 'label' => __( 'Menu', 'wp-restaurant-listings' ), 278 'type' => 'file', 279 'multiple' => true, 280 'required' => false, 281 'placeholder' => '', 282 'priority' => 8, 283 'ajax' => true, 284 'allowed_mime_types' => array( 285 'jpg' => 'image/jpeg', 286 'jpeg' => 'image/jpeg', 287 'gif' => 'image/gif', 288 'png' => 'image/png' 289 ) 290 ), 291 'restaurant_hours' => array( 292 'label' => __( 'Hours of Operation', 'wp-restaurant-listings' ), 293 'type' => 'business-hours', 294 'required' => false, 295 'placeholder' => '', 296 'priority' => 9, 297 'default' => '' 298 ), 296 299 ) 297 300 ) ); … … 413 416 $this->fields[ $group_key ][ $key ]['value'] = has_post_thumbnail( $restaurant->ID ) ? get_post_thumbnail_id( $restaurant->ID ) : get_post_meta( $restaurant->ID, '_' . $key, true ); 414 417 break; 415 case 'restaurant_image_gallery' :416 $this->fields[ $group_key ][ $key ]['value'] = explode( ',', $restaurant->_restaurant_image_gallery );417 break;418 case 'restaurant_menu' :419 $this->fields[ $group_key ][ $key ]['value'] = explode( ',', $restaurant->_restauruant_menu );420 break;418 case 'restaurant_image_gallery' : 419 $this->fields[ $group_key ][ $key ]['value'] = explode( ',', $restaurant->_restaurant_image_gallery ); 420 break; 421 case 'restaurant_menu' : 422 $this->fields[ $group_key ][ $key ]['value'] = explode( ',', $restaurant->_restauruant_menu ); 423 break; 421 424 default: 422 425 $this->fields[ $group_key ][ $key ]['value'] = get_post_meta( $restaurant->ID, '_' . $key, true ); … … 444 447 wp_enqueue_script( 'wp-restaurant-listings-restaurant-submission' ); 445 448 446 wp_localize_script( 'wp-restaurant-listings-restaurant-submission', 'restaurant_listings_restaurant_submission', array(447 'time_format' => str_replace( '\\', '\\\\', get_option( 'time_format' ) ),448 'i18n_closed' => __( 'Closed','wp-restaurant-listings' ),449 ) );449 wp_localize_script( 'wp-restaurant-listings-restaurant-submission', 'restaurant_listings_restaurant_submission', array( 450 'time_format' => str_replace( '\\', '\\\\', get_option( 'time_format' ) ), 451 'i18n_closed' => __( 'Closed','wp-restaurant-listings' ), 452 ) ); 450 453 451 454 get_restaurant_listings_template( 'restaurant-submit.php', array( … … 612 615 $submitting_key = uniqid(); 613 616 614 setcookie( 'wp-restaurant-listings-submitting-restaurant-id', $this->restaurant_id, false, COOKIEPATH, COOKIE_DOMAIN, false );615 setcookie( 'wp-restaurant-listings-submitting-restaurant-key', $submitting_key, false, COOKIEPATH, COOKIE_DOMAIN, false );617 setcookie( 'wp-restaurant-listings-submitting-restaurant-id', $this->restaurant_id, 0, COOKIEPATH, COOKIE_DOMAIN, false ); 618 setcookie( 'wp-restaurant-listings-submitting-restaurant-key', $submitting_key, 0, COOKIEPATH, COOKIE_DOMAIN, false ); 616 619 617 620 update_post_meta( $this->restaurant_id, '_submitting_key', $submitting_key ); … … 685 688 // Restaurant logo is a featured image 686 689 } elseif ( 'restaurant_logo' === $key ) { 687 $attachment_id = is_numeric($values[$group_key][$key]) ? absint($values[$group_key][$key]) : $this->create_attachment($values[$group_key][$key]);688 if (empty($attachment_id)) {689 delete_post_thumbnail($this->restaurant_id);690 } else {691 set_post_thumbnail($this->restaurant_id, $attachment_id);692 }693 update_user_meta(get_current_user_id(), '_restaurant_logo', $attachment_id);694 695 696 // Restaurant image gallery690 $attachment_id = is_numeric($values[$group_key][$key]) ? absint($values[$group_key][$key]) : $this->create_attachment($values[$group_key][$key]); 691 if (empty($attachment_id)) { 692 delete_post_thumbnail($this->restaurant_id); 693 } else { 694 set_post_thumbnail($this->restaurant_id, $attachment_id); 695 } 696 update_user_meta(get_current_user_id(), '_restaurant_logo', $attachment_id); 697 698 699 // Restaurant image gallery 697 700 } elseif ( 'restaurant_image_gallery' === $key ) { 698 701 699 $field_values = $values[$group_key][$key];700 701 if (is_array($field_values) && sizeof($field_values) >0 ) {702 703 foreach ( $field_values as $image ) {704 $attachment_id = is_numeric( $image ) ? absint( $image ) : $this->create_attachment( $image );705 if ( !empty( $attachment_id ) ) {706 $image_gallery[] = $attachment_id;707 }708 }709 710 $image_gallery = array_filter( $image_gallery );711 712 if ( sizeof( $image_gallery ) ) {713 $this->fields['extra']['restaurant_image_gallery']['value'] = $image_gallery;714 update_post_meta( $this->restaurant_id, '_restaurant_image_gallery', join( ',', $image_gallery ) );715 }716 }717 718 // Restaurant menu719 } elseif ( 'restaurant_menu' === $key ) {720 721 $field_values = $values[$group_key][$key];722 723 if ( is_array($field_values) && sizeof($field_values) > 0 ) {724 foreach ( $field_values as $image ) {725 $attachment_id = is_numeric( $image ) ? absint( $image ) : $this->create_attachment( $image );726 if ( !empty( $attachment_id ) ) {727 $menu[] = $attachment_id;728 }729 }730 731 $menu = array_filter( $menu );732 733 if ( sizeof( $menu ) ) {734 $this->fields['extra']['restaurant_menu']['value'] = $menu;735 update_post_meta( $this->restaurant_id, '_restaurant_menu', join( ',', $menu ) );736 }737 }738 739 // Save meta data740 } else {741 742 if ( 'restaurant_image_gallery' !== $key ) {743 update_post_meta( $this->restaurant_id, '_' . $key, $values[ $group_key ][ $key ] );744 }702 $field_values = $values[$group_key][$key]; 703 704 if (is_array($field_values) && sizeof($field_values) >0 ) { 705 706 foreach ( $field_values as $image ) { 707 $attachment_id = is_numeric( $image ) ? absint( $image ) : $this->create_attachment( $image ); 708 if ( !empty( $attachment_id ) ) { 709 $image_gallery[] = $attachment_id; 710 } 711 } 712 713 $image_gallery = array_filter( $image_gallery ); 714 715 if ( sizeof( $image_gallery ) ) { 716 $this->fields['extra']['restaurant_image_gallery']['value'] = $image_gallery; 717 update_post_meta( $this->restaurant_id, '_restaurant_image_gallery', join( ',', $image_gallery ) ); 718 } 719 } 720 721 // Restaurant menu 722 } elseif ( 'restaurant_menu' === $key ) { 723 724 $field_values = $values[$group_key][$key]; 725 726 if ( is_array($field_values) && sizeof($field_values) > 0 ) { 727 foreach ( $field_values as $image ) { 728 $attachment_id = is_numeric( $image ) ? absint( $image ) : $this->create_attachment( $image ); 729 if ( !empty( $attachment_id ) ) { 730 $menu[] = $attachment_id; 731 } 732 } 733 734 $menu = array_filter( $menu ); 735 736 if ( sizeof( $menu ) ) { 737 $this->fields['extra']['restaurant_menu']['value'] = $menu; 738 update_post_meta( $this->restaurant_id, '_restaurant_menu', join( ',', $menu ) ); 739 } 740 } 741 742 // Save meta data 743 } else { 744 745 if ( 'restaurant_image_gallery' !== $key ) { 746 update_post_meta( $this->restaurant_id, '_' . $key, $values[ $group_key ][ $key ] ); 747 } 745 748 746 749 // Handle attachments … … 763 766 if ( sizeof( $maybe_attach ) && apply_filters( 'restaurant_listings_attach_uploaded_files', true ) ) { 764 767 // Get attachments 765 $attachments = get_posts( 'post_parent=' . $this->restaurant_id . '&post_type=attachment&fields=ids& post_mime_type=image&numberposts=-1' );768 $attachments = get_posts( 'post_parent=' . $this->restaurant_id . '&post_type=attachment&fields=ids&numberposts=-1' ); 766 769 $attachment_urls = array(); 767 770 $attachment_ids = array(); … … 774 777 foreach ( $maybe_attach as $attachment_url ) { 775 778 if ( ! in_array( $attachment_url, $attachment_urls ) ) { 776 $this->create_attachment( $attachment_url );779 $this->create_attachment( $attachment_url ); 777 780 } 778 781 } -
wp-restaurant-listings/trunk/includes/widgets/class-wp-restaurant-listings-widget-featured-restaurants.php
r1851196 r1928419 59 59 $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); 60 60 $number = absint( $instance['number'] ); 61 $restaurants = get_restaurant_listings( array( 61 62 $title_instance = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 63 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : ''; 64 $title = apply_filters( 'widget_title', $title_instance, $instance, $this->id_base ); 65 $restaurants = get_restaurant_listings( array( 62 66 'posts_per_page' => $number, 63 67 'orderby' => 'date', … … 88 92 <?php get_restaurant_listings_template_part( 'content-widget', 'no-restaurants-found' ); ?> 89 93 90 <?php endif; 94 <?php 95 endif; 91 96 92 97 wp_reset_postdata(); -
wp-restaurant-listings/trunk/includes/widgets/class-wp-restaurant-listings-widget-recent-restaurants.php
r1851196 r1928419 77 77 ) ); 78 78 79 /** 80 * Runs before Recent Restaurants widget content. 81 * 82 * @since 1.0.1 83 * 84 * @param array $args 85 * @param array $instance 86 * @param WP_Query $restaurants 87 */ 88 do_action( 'restaurant_listings_recent_restaurants_widget_before', $args, $instance, $restaurants ); 89 79 90 if ( $restaurants->have_posts() ) : ?> 80 91 … … 101 112 <?php endif; 102 113 114 /** 115 * Runs after Recent Restaurants widget content. 116 * 117 * @since 1.29.1 118 * 119 * @param array $args 120 * @param array $instance 121 * @param WP_Query $restaurants 122 */ 123 do_action( 'restaurant_listings_recent_restaurants_widget_after', $args, $instance, $restaurants ); 124 103 125 wp_reset_postdata(); 104 126 -
wp-restaurant-listings/trunk/languages/wp-restaurant-listings.pot
r1851196 r1928419 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WP Restaurant Listings 1.0. 0\n"5 "Project-Id-Version: WP Restaurant Listings 1.0.1\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://github.com/wpdrift/WP-Restaurant-Listings/issues\n" 8 "POT-Creation-Date: 2018-0 2-21 10:53:25+00:00\n"8 "POT-Creation-Date: 2018-08-13 13:28:27+00:00\n" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=utf-8\n" … … 15 15 "X-Generator: grunt-wp-i18n 0.5.4\n" 16 16 17 #: includes/admin/class-wp-restaurant-listings-admin.php:9 317 #: includes/admin/class-wp-restaurant-listings-admin.php:96 18 18 #: includes/forms/class-wp-restaurant-listings-form-edit-restaurant.php:105 19 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:4 4120 #: wp-restaurant-listings-template.php:99 121 #: wp-restaurant-listings-template.php: 99219 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:451 20 #: wp-restaurant-listings-template.php:999 21 #: wp-restaurant-listings-template.php:1000 22 22 msgid "Closed" 23 23 msgstr "" 24 24 25 #: includes/admin/class-wp-restaurant-listings-admin.php:10 425 #: includes/admin/class-wp-restaurant-listings-admin.php:107 26 26 msgid "Settings" 27 27 msgstr "" … … 41 41 #: includes/admin/class-wp-restaurant-listings-cpt.php:247 42 42 #: includes/admin/class-wp-restaurant-listings-cpt.php:292 43 #: templates/single-restaurant_listings-reviews.php: 6943 #: templates/single-restaurant_listings-reviews.php:77 44 44 msgid "Name" 45 45 msgstr "" … … 97 97 #: includes/admin/class-wp-restaurant-listings-cpt.php:294 98 98 #: includes/widgets/class-wp-restaurant-listings-widget-recent-restaurants.php:38 99 #: templates/restaurant-filters.php: 17 templates/restaurant-filters.php:1899 #: templates/restaurant-filters.php:35 templates/restaurant-filters.php:36 100 100 msgid "Location" 101 101 msgstr "" … … 150 150 #: includes/admin/class-wp-restaurant-listings-cpt.php:399 151 151 #: includes/class-wp-restaurant-listings-post-types.php:214 152 #: templates/restaurant-dashboard.php: 33 templates/restaurant-dashboard.php:40152 #: templates/restaurant-dashboard.php:50 templates/restaurant-dashboard.php:57 153 153 msgid "Edit" 154 154 msgstr "" … … 157 157 #: includes/admin/class-wp-restaurant-listings-meta-box-gallery.php:50 158 158 #: includes/admin/class-wp-restaurant-listings-meta-box-gallery.php:70 159 #: templates/restaurant-dashboard.php: 45159 #: templates/restaurant-dashboard.php:62 160 160 msgid "Delete" 161 161 msgstr "" … … 504 504 505 505 #: includes/admin/class-wp-restaurant-listings-setup.php:159 506 msgid " Setup Wizard Introduction"506 msgid "Welcome to the Setup Wizard!" 507 507 msgstr "" 508 508 509 509 #: includes/admin/class-wp-restaurant-listings-setup.php:161 510 msgid "Thanks for installing <em>WP Restaurant Listings</em>!" 510 msgid "" 511 "Thanks for installing <em>WP Restaurant Listings</em>! Let's get your site " 512 "ready to accept restaurant listings." 511 513 msgstr "" 512 514 513 515 #: includes/admin/class-wp-restaurant-listings-setup.php:162 514 516 msgid "" 515 "This setup wizard will help you get started by creating the pages for"516 " restaurant submission, restaurant listings, and listings your restaurants."517 "This setup wizard will walk you through the process of creating the pages " 518 "for restaurant submissions, management, and listings." 517 519 msgstr "" 518 520 519 521 #: includes/admin/class-wp-restaurant-listings-setup.php:163 520 522 msgid "" 521 "If you want to skip the wizard and setup the pages and shortcodes yourself " 522 "manually, the process is still relatively simple. Refer to the " 523 "%sdocumentation%s for help." 523 "If you'd prefer to skip this and set up your pages manually, our " 524 "%sdocumentation%s will walk you through each step." 524 525 msgstr "" 525 526 526 527 #: includes/admin/class-wp-restaurant-listings-setup.php:166 527 msgid " Continue to pagesetup"528 msgid "Start setup" 528 529 msgstr "" 529 530 530 531 #: includes/admin/class-wp-restaurant-listings-setup.php:167 531 msgid "Skip setup. I will set up the plugin manually"532 msgid "Skip setup. I will set up the plugin manually." 532 533 msgstr "" 533 534 … … 538 539 #: includes/admin/class-wp-restaurant-listings-setup.php:175 539 540 msgid "" 540 "<em>WP Restaurant Listings</em> includes %1$sshortcodes%2$s which can be " 541 "used within your %3$spages%2$s to output content. These can be created for " 542 "you below. For more information on the restaurant shortcodes view the " 543 "%4$sshortcode documentation%2$s." 544 msgstr "" 545 546 #: includes/admin/class-wp-restaurant-listings-setup.php:183 541 "WP Restaurant Listings, users can post, manage, and browse restaurant " 542 "listings right on your website. Tell us which of these common pages you'd " 543 "like your site to have and we'll create and configure them for you." 544 msgstr "" 545 546 #: includes/admin/class-wp-restaurant-listings-setup.php:176 547 msgid "" 548 "(These pages are created using %1$sshortcodes%2$s, which we take care of in " 549 "this step. If you'd like to build these pages yourself or want to add one " 550 "of these options to an existing page on your site, you can skip this step " 551 "and take a look at %4$sshortcode documentation%2$s for detailed " 552 "instructions.)" 553 msgstr "" 554 555 #: includes/admin/class-wp-restaurant-listings-setup.php:184 547 556 msgid "Page Title" 548 557 msgstr "" 549 558 550 #: includes/admin/class-wp-restaurant-listings-setup.php:18 4559 #: includes/admin/class-wp-restaurant-listings-setup.php:185 551 560 msgid "Page Description" 552 561 msgstr "" 553 562 554 #: includes/admin/class-wp-restaurant-listings-setup.php:18 5563 #: includes/admin/class-wp-restaurant-listings-setup.php:186 555 564 msgid "Content Shortcode" 556 565 msgstr "" 557 566 558 #: includes/admin/class-wp-restaurant-listings-setup.php:193 559 msgid "" 560 "This page allows employers to post restaurants to your website from the " 561 "front-end." 562 msgstr "" 563 564 #: includes/admin/class-wp-restaurant-listings-setup.php:195 565 msgid "" 566 "If you do not want to accept submissions from users in this way (for " 567 "example you just want to post restaurants from the admin dashboard) you can " 568 "skip creating this page." 569 msgstr "" 570 571 #: includes/admin/class-wp-restaurant-listings-setup.php:203 572 msgid "" 573 "This page allows employers to manage and edit their own restaurants from " 574 "the front-end." 575 msgstr "" 576 577 #: includes/admin/class-wp-restaurant-listings-setup.php:205 578 msgid "" 579 "If you plan on managing all listings from the admin dashboard you can skip " 580 "creating this page." 581 msgstr "" 582 583 #: includes/admin/class-wp-restaurant-listings-setup.php:212 584 msgid "" 585 "This page allows users to browse, search, and filter restaurant listings on " 586 "the front-end of your site." 587 msgstr "" 588 589 #: includes/admin/class-wp-restaurant-listings-setup.php:218 567 #: includes/admin/class-wp-restaurant-listings-setup.php:194 568 msgid "" 569 "Creates a page that allows users to post new restaurants directly from a " 570 "page on your website, instead of requiring them to log in to an admin area. " 571 "If you'd rather not allow this -- for example, if you want users to use the " 572 "admin dashboard only -- you can uncheck this setting." 573 msgstr "" 574 575 #: includes/admin/class-wp-restaurant-listings-setup.php:202 576 msgid "" 577 "Creates a page that allows users to manage their restaurant listings " 578 "directly from a page on your website, instead of requiring them to log in " 579 "to an admin area. If you want to manage all restaurant listings from the " 580 "admin dashboard only, you can uncheck this setting." 581 msgstr "" 582 583 #: includes/admin/class-wp-restaurant-listings-setup.php:209 584 msgid "" 585 "Creates a page where visitors can browse, search, and filter restaurant " 586 "listings." 587 msgstr "" 588 589 #: includes/admin/class-wp-restaurant-listings-setup.php:215 590 590 msgid "" 591 591 "This page allows users to locate near by restaurants on the front-end of " … … 593 593 msgstr "" 594 594 595 #: includes/admin/class-wp-restaurant-listings-setup.php:22 6595 #: includes/admin/class-wp-restaurant-listings-setup.php:223 596 596 msgid "Skip this step" 597 597 msgstr "" 598 598 599 #: includes/admin/class-wp-restaurant-listings-setup.php:236 600 msgid "All Done!" 599 #: includes/admin/class-wp-restaurant-listings-setup.php:233 600 msgid "You're ready to start using WP Restaurant Listings!" 601 msgstr "" 602 603 #: includes/admin/class-wp-restaurant-listings-setup.php:235 604 msgid "Wondering what to do now? Here are some of the most common next steps:" 601 605 msgstr "" 602 606 603 607 #: includes/admin/class-wp-restaurant-listings-setup.php:238 604 msgid "" 605 "Looks like you're all set to start using the plugin. In case you're " 606 "wondering where to go next:" 607 msgstr "" 608 609 #: includes/admin/class-wp-restaurant-listings-setup.php:241 610 msgid "Tweak the plugin settings" 608 msgid "Tweak your settings" 609 msgstr "" 610 611 #: includes/admin/class-wp-restaurant-listings-setup.php:239 612 msgid "Add a restaurant using the admin dashboard" 611 613 msgstr "" 612 614 613 615 #: includes/admin/class-wp-restaurant-listings-setup.php:242 614 msgid "Add a restaurant via the back-end" 615 msgstr "" 616 617 #: includes/admin/class-wp-restaurant-listings-setup.php:245 616 msgid "View submitted restaurant listings" 617 msgstr "" 618 619 #: includes/admin/class-wp-restaurant-listings-setup.php:244 620 msgid "Add restaurant listings to a page using the [restaurants] shortcode" 621 msgstr "" 622 623 #: includes/admin/class-wp-restaurant-listings-setup.php:248 618 624 msgid "Add a restaurant via the front-end" 619 625 msgstr "" 620 626 621 #: includes/admin/class-wp-restaurant-listings-setup.php:247 622 msgid "Find out more about the front-end restaurant submission form" 623 msgstr "" 624 625 #: includes/admin/class-wp-restaurant-listings-setup.php:251 626 msgid "View submitted restaurant listings" 627 msgstr "" 628 629 #: includes/admin/class-wp-restaurant-listings-setup.php:253 630 msgid "Add the [restaurants] shortcode to a page to list restaurants" 631 msgstr "" 632 633 #: includes/admin/class-wp-restaurant-listings-setup.php:257 627 #: includes/admin/class-wp-restaurant-listings-setup.php:250 628 msgid "Learn to use the front-end restaurant submission board" 629 msgstr "" 630 631 #: includes/admin/class-wp-restaurant-listings-setup.php:254 634 632 msgid "View the restaurant dashboard" 635 633 msgstr "" 636 634 637 #: includes/admin/class-wp-restaurant-listings-setup.php:259 638 msgid "Find out more about the front-end restaurant dashboard" 635 #: includes/admin/class-wp-restaurant-listings-setup.php:256 636 msgid "Learn to use the front-end restaurant dashboard" 637 msgstr "" 638 639 #: includes/admin/class-wp-restaurant-listings-setup.php:260 640 msgid "" 641 "If you need help, you can find more detail in our %1$ssupport " 642 "documentation%2$s or post your question on the %3$sWP Restaurant Listings " 643 "support forums%2$s." 639 644 msgstr "" 640 645 641 646 #: includes/admin/class-wp-restaurant-listings-setup.php:263 642 msgid "" 643 "And don't forget, if you need any more help using <em>WP Restaurant " 644 "Listings</em> you can consult the %1$sdocumentation%2$s or %3$spost on the " 645 "forums%2$s!" 647 msgid "Support WP Restaurant Listings's Ongoing Development" 648 msgstr "" 649 650 #: includes/admin/class-wp-restaurant-listings-setup.php:264 651 msgid "" 652 "There are lots of ways you can support open source software projects like " 653 "this one: contributing code, fixing a bug, assisting with non-English " 654 "translation, or just telling your friends about WP Restaurant Listings to " 655 "help spread the word. We appreciate your support!" 646 656 msgstr "" 647 657 648 658 #: includes/admin/class-wp-restaurant-listings-setup.php:266 649 msgid " Support the Ongoing Development of this Plugin"659 msgid "Leave a positive review" 650 660 msgstr "" 651 661 652 662 #: includes/admin/class-wp-restaurant-listings-setup.php:267 653 msgid " "654 "There are many ways to support open-source projects such as WP Restaurant"655 "Listings, for example code contribution, translation, or even telling your " 656 "friends how awesome the plugin (hopefully) is. Thanks in advance for your " 657 "support - it is much appreciated!"663 msgid "Contribute a localization" 664 msgstr "" 665 666 #: includes/admin/class-wp-restaurant-listings-setup.php:268 667 msgid "Contribute code or report a bug" 658 668 msgstr "" 659 669 660 670 #: includes/admin/class-wp-restaurant-listings-setup.php:269 661 msgid "Leave a positive review"662 msgstr ""663 664 #: includes/admin/class-wp-restaurant-listings-setup.php:270665 msgid "Contribute a localization"666 msgstr ""667 668 #: includes/admin/class-wp-restaurant-listings-setup.php:271669 msgid "Contribute code or report a bug"670 msgstr ""671 672 #: includes/admin/class-wp-restaurant-listings-setup.php:272673 671 msgid "Help other users on the forums" 674 672 msgstr "" … … 693 691 #: includes/admin/class-wp-restaurant-listings-writepanels.php:67 694 692 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:179 695 #: templates/restaurant-filters.php: 37693 #: templates/restaurant-filters.php:55 696 694 #: templates/single-restaurant_listings/tabs/overview.php:24 697 695 #: templates/single-restaurants_listings/tabs/overview.php:24 … … 730 728 731 729 #: includes/admin/class-wp-restaurant-listings-writepanels.php:102 730 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:228 732 731 msgid "Brief description about the restaurant" 733 732 msgstr "" … … 772 771 773 772 #: includes/admin/class-wp-restaurant-listings-writepanels.php:176 774 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 82773 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:292 775 774 msgid "Hours of Operation" 776 775 msgstr "" … … 986 985 msgstr "" 987 986 988 #: includes/class-wp-restaurant-listings.php:20 4987 #: includes/class-wp-restaurant-listings.php:207 989 988 msgid "Load previous listings" 990 989 msgstr "" 991 990 992 #: includes/class-wp-restaurant-listings.php:25 5991 #: includes/class-wp-restaurant-listings.php:258 993 992 msgid "Invalid file type. Accepted types:" 994 993 msgstr "" 995 994 996 #: includes/class-wp-restaurant-listings.php:29 1995 #: includes/class-wp-restaurant-listings.php:294 997 996 msgid "Are you sure you want to delete this listings?" 998 997 msgstr "" 999 998 1000 #: includes/class-wp-restaurant-listings.php:30 21001 #: templates/form-fields/business-hours-field.php: 18999 #: includes/class-wp-restaurant-listings.php:305 1000 #: templates/form-fields/business-hours-field.php:34 1002 1001 msgid "Close" 1003 1002 msgstr "" … … 1025 1024 1026 1025 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:69 1027 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:4 521028 #: templates/restaurant-preview.php: 51026 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:462 1027 #: templates/restaurant-preview.php:22 1029 1028 msgid "Preview" 1030 1029 msgstr "" … … 1058 1057 msgstr "" 1059 1058 1060 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:20 31059 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:204 1061 1060 msgid "Enter an email address or website URL" 1062 1061 msgstr "" 1063 1062 1064 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 091063 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:210 1065 1064 msgid "Phone" 1066 1065 msgstr "" 1067 1066 1068 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:21 21067 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:213 1069 1068 msgid "(877) 273-3049" 1070 1069 msgstr "" 1071 1070 1072 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:21 61073 #: templates/content-single-restaurant_listings-restaurant.php: 191071 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:217 1072 #: templates/content-single-restaurant_listings-restaurant.php:30 1074 1073 msgid "Website" 1075 1074 msgstr "" 1076 1075 1077 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 191076 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:221 1078 1077 msgid "http://" 1079 1078 msgstr "" 1080 1079 1081 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:223 1080 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:225 1081 msgid "Tagline" 1082 msgstr "" 1083 1084 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:232 1082 1085 msgid "Video" 1083 1086 msgstr "" 1084 1087 1085 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 261088 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:236 1086 1089 msgid "A link to a video about your restaurant" 1087 1090 msgstr "" 1088 1091 1089 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 301092 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:240 1090 1093 msgid "Twitter username" 1091 1094 msgstr "" 1092 1095 1093 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 331096 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:243 1094 1097 msgid "@yourcompany" 1095 1098 msgstr "" 1096 1099 1097 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 371100 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:247 1098 1101 msgid "Logo" 1099 1102 msgstr "" 1100 1103 1101 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 521104 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:262 1102 1105 msgid "Gallery Images" 1103 1106 msgstr "" 1104 1107 1105 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:2 671106 #: wp-restaurant-listings-functions.php:11 021108 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:277 1109 #: wp-restaurant-listings-functions.php:1177 1107 1110 msgid "Menu" 1108 1111 msgstr "" 1109 1112 1110 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:3 111113 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:321 1111 1114 msgid "%s is a required field" 1112 1115 msgstr "" 1113 1116 1114 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:3 211117 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:331 1115 1118 msgid "%s is invalid" 1116 1119 msgstr "" 1117 1120 1118 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:3 371119 #: wp-restaurant-listings-functions.php:9 071121 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:347 1122 #: wp-restaurant-listings-functions.php:982 1120 1123 msgid "\"%s\" (filetype %s) needs to be one of the following file types: %s" 1121 1124 msgstr "" 1122 1125 1123 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:3 551126 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:365 1124 1127 msgid "Please enter a valid application email address or URL" 1125 1128 msgstr "" 1126 1129 1127 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:4 831130 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:493 1128 1131 msgid "Please enter a username." 1129 1132 msgstr "" 1130 1133 1131 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:4 871134 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:497 1132 1135 msgid "Please enter a password." 1133 1136 msgstr "" 1134 1137 1135 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php: 4911138 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:501 1136 1139 msgid "Please enter your email address." 1137 1140 msgstr "" 1138 1141 1139 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php: 4971142 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:507 1140 1143 msgid "Passwords must match." 1141 1144 msgstr "" 1142 1145 1143 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:5 021146 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:512 1144 1147 msgid "Invalid Password: %s" 1145 1148 msgstr "" 1146 1149 1147 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:5 041150 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:514 1148 1151 msgid "Password is not valid." 1149 1152 msgstr "" 1150 1153 1151 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:5 251154 #: includes/forms/class-wp-restaurant-listings-form-submit-restaurant.php:535 1152 1155 msgid "You must be signed in to post a new listings." 1153 1156 msgstr "" … … 1240 1243 msgstr "" 1241 1244 1242 #: templates/account-signin.php: 41245 #: templates/account-signin.php:21 1243 1246 msgid "Your account" 1244 1247 msgstr "" 1245 1248 1246 #: templates/account-signin.php: 81249 #: templates/account-signin.php:25 1247 1250 msgid "You are currently signed in as <strong>%s</strong>." 1248 1251 msgstr "" 1249 1252 1250 #: templates/account-signin.php: 111253 #: templates/account-signin.php:28 1251 1254 msgid "Sign out" 1252 1255 msgstr "" 1253 1256 1254 #: templates/account-signin.php: 211257 #: templates/account-signin.php:39 1255 1258 msgid "Have an account?" 1256 1259 msgstr "" 1257 1260 1258 #: templates/account-signin.php: 23 templates/restaurant-dashboard-login.php:31261 #: templates/account-signin.php:41 templates/restaurant-dashboard-login.php:20 1259 1262 msgid "Sign in" 1260 1263 msgstr "" 1261 1264 1262 #: templates/account-signin.php: 271265 #: templates/account-signin.php:45 1263 1266 msgid "" 1264 1267 "If you don’t have an account you can %screate one below by entering " 1265 "your email address/username. Your account details will be confirmed via " 1266 "email." 1267 msgstr "" 1268 1269 #: templates/account-signin.php:27 1268 "your email address/username." 1269 msgstr "" 1270 1271 #: templates/account-signin.php:45 1270 1272 msgid "optionally" 1271 1273 msgstr "" 1272 1274 1273 #: templates/account-signin.php:31 1275 #: templates/account-signin.php:47 1276 msgid "Your account details will be confirmed via email." 1277 msgstr "" 1278 1279 #: templates/account-signin.php:52 1274 1280 msgid "You must sign in to create a new listings." 1275 1281 msgstr "" 1276 1282 1277 #: templates/account-signin.php: 42 templates/restaurant-submit.php:321278 #: templates/restaurant-submit.php: 491283 #: templates/account-signin.php:63 templates/restaurant-submit.php:43 1284 #: templates/restaurant-submit.php:60 1279 1285 msgid "(optional)" 1280 1286 msgstr "" 1281 1287 1282 #: templates/content-no-restaurants-found.php:2 1288 #: templates/content-no-restaurants-found.php:19 1289 #: templates/content-widget-no-restaurants-found.php:19 1283 1290 msgid "There are no listings matching your search." 1284 1291 msgstr "" 1285 1292 1286 #: templates/content-no-restaurants-found.php:4 1287 msgid "There are currently no vacancies." 1288 msgstr "" 1289 1290 #: templates/form-fields/business-hours-field.php:17 1293 #: templates/content-no-restaurants-found.php:21 1294 #: templates/content-widget-no-restaurants-found.php:21 1295 msgid "There are currently no restaurants." 1296 msgstr "" 1297 1298 #: templates/form-fields/business-hours-field.php:33 1291 1299 msgid "Open" 1292 1300 msgstr "" 1293 1301 1294 #: templates/form-fields/file-field.php: 291302 #: templates/form-fields/file-field.php:45 1295 1303 msgid "Maximum file size: %s." 1296 1304 msgstr "" 1297 1305 1298 #: templates/form-fields/multiselect-field.php: 31299 #: wp-restaurant-listings-functions.php:7 241306 #: templates/form-fields/multiselect-field.php:20 1307 #: wp-restaurant-listings-functions.php:799 1300 1308 msgid "No results match" 1301 1309 msgstr "" 1302 1310 1303 #: templates/form-fields/multiselect-field.php: 31304 #: wp-restaurant-listings-functions.php: 7251311 #: templates/form-fields/multiselect-field.php:20 1312 #: wp-restaurant-listings-functions.php:800 1305 1313 msgid "Select Some Options" 1306 1314 msgstr "" 1307 1315 1308 #: templates/form-fields/uploaded-file-html.php: 121309 #: templates/form-fields/uploaded-file-html.php: 141316 #: templates/form-fields/uploaded-file-html.php:29 1317 #: templates/form-fields/uploaded-file-html.php:31 1310 1318 msgid "remove" 1311 1319 msgstr "" 1312 1320 1313 #: templates/restaurant-dashboard-login.php: 31321 #: templates/restaurant-dashboard-login.php:20 1314 1322 msgid "You need to be signed in to manage your listings." 1315 1323 msgstr "" 1316 1324 1317 #: templates/restaurant-dashboard.php: 21325 #: templates/restaurant-dashboard.php:19 1318 1326 msgid "Your listings are shown in the table below." 1319 1327 msgstr "" 1320 1328 1321 #: templates/restaurant-dashboard.php: 141329 #: templates/restaurant-dashboard.php:31 1322 1330 msgid "You do not have any active listings." 1323 1331 msgstr "" 1324 1332 1325 #: templates/restaurant-dashboard.php: 351333 #: templates/restaurant-dashboard.php:52 1326 1334 msgid "Duplicate" 1327 1335 msgstr "" 1328 1336 1329 #: templates/restaurant-filters.php: 121337 #: templates/restaurant-filters.php:30 1330 1338 msgid "Keywords" 1331 1339 msgstr "" 1332 1340 1333 #: templates/restaurant-filters.php: 131341 #: templates/restaurant-filters.php:31 1334 1342 msgid "Search for restaurants or cuisines..." 1335 1343 msgstr "" 1336 1344 1337 #: templates/restaurant-filters.php: 271345 #: templates/restaurant-filters.php:45 1338 1346 msgid "Category" 1339 1347 msgstr "" 1340 1348 1341 #: templates/restaurant-filters.php: 311349 #: templates/restaurant-filters.php:49 1342 1350 msgid "Any category" 1343 1351 msgstr "" 1344 1352 1345 #: templates/restaurant-filters.php: 541353 #: templates/restaurant-filters.php:72 1346 1354 msgid "" 1347 1355 "Your browser does not support JavaScript, or it is disabled. JavaScript " … … 1349 1357 msgstr "" 1350 1358 1351 #: templates/restaurant-gallery-photoswipe.php: 381359 #: templates/restaurant-gallery-photoswipe.php:46 1352 1360 msgid "Close (Esc)" 1353 1361 msgstr "" 1354 1362 1355 #: templates/restaurant-gallery-photoswipe.php:4 01363 #: templates/restaurant-gallery-photoswipe.php:48 1356 1364 msgid "Share" 1357 1365 msgstr "" 1358 1366 1359 #: templates/restaurant-gallery-photoswipe.php: 421367 #: templates/restaurant-gallery-photoswipe.php:50 1360 1368 msgid "Toggle fullscreen" 1361 1369 msgstr "" 1362 1370 1363 #: templates/restaurant-gallery-photoswipe.php: 441371 #: templates/restaurant-gallery-photoswipe.php:52 1364 1372 msgid "Zoom in/out" 1365 1373 msgstr "" 1366 1374 1367 #: templates/restaurant-gallery-photoswipe.php:6 11375 #: templates/restaurant-gallery-photoswipe.php:69 1368 1376 msgid "Previous (arrow left)" 1369 1377 msgstr "" 1370 1378 1371 #: templates/restaurant-gallery-photoswipe.php: 631379 #: templates/restaurant-gallery-photoswipe.php:71 1372 1380 msgid "Next (arrow right)" 1373 1381 msgstr "" 1374 1382 1375 #: templates/restaurant-preview.php: 31383 #: templates/restaurant-preview.php:20 1376 1384 msgid "Submit Listings" 1377 1385 msgstr "" 1378 1386 1379 #: templates/restaurant-preview.php: 41387 #: templates/restaurant-preview.php:21 1380 1388 msgid "Edit listings" 1381 1389 msgstr "" 1382 1390 1383 #: templates/restaurant-submit.php: 131391 #: templates/restaurant-submit.php:24 1384 1392 msgid "You are editing an existing restaurant. %s" 1385 1393 msgstr "" 1386 1394 1387 #: templates/restaurant-submit.php: 131395 #: templates/restaurant-submit.php:24 1388 1396 msgid "Create A New Restaurant" 1389 1397 msgstr "" 1390 1398 1391 #: templates/restaurant-submit.php: 431399 #: templates/restaurant-submit.php:54 1392 1400 msgid "Restaurant Details" 1393 1401 msgstr "" 1394 1402 1395 #: templates/restaurant-submitted.php: 61403 #: templates/restaurant-submitted.php:22 1396 1404 msgid "%s listed successfully. To view your listings <a href=\"%s\">click here</a>." 1397 1405 msgstr "" 1398 1406 1399 #: templates/restaurant-submitted.php: 91407 #: templates/restaurant-submitted.php:25 1400 1408 msgid "%s submitted successfully. Your listings will be visible once approved." 1401 1409 msgstr "" … … 1426 1434 msgstr "" 1427 1435 1428 #: templates/single-restaurant_listings-reviews.php: 281436 #: templates/single-restaurant_listings-reviews.php:36 1429 1437 #. translators: 1: reviews count 2: name 1430 1438 msgid "%1$s review for %2$s" … … 1433 1441 msgstr[1] "" 1434 1442 1435 #: templates/single-restaurant_listings-reviews.php:5 01443 #: templates/single-restaurant_listings-reviews.php:58 1436 1444 msgid "There are no reviews yet." 1437 1445 msgstr "" 1438 1446 1439 #: templates/single-restaurant_listings-reviews.php: 631447 #: templates/single-restaurant_listings-reviews.php:71 1440 1448 msgid "Add a review" 1441 1449 msgstr "" 1442 1450 1443 #: templates/single-restaurant_listings-reviews.php: 631451 #: templates/single-restaurant_listings-reviews.php:71 1444 1452 msgid "Be the first to review “%s”" 1445 1453 msgstr "" 1446 1454 1447 #: templates/single-restaurant_listings-reviews.php: 641455 #: templates/single-restaurant_listings-reviews.php:72 1448 1456 msgid "Leave a Reply to %s" 1449 1457 msgstr "" 1450 1458 1451 #: templates/single-restaurant_listings-reviews.php:7 11459 #: templates/single-restaurant_listings-reviews.php:79 1452 1460 msgid "Email" 1453 1461 msgstr "" 1454 1462 1455 #: templates/single-restaurant_listings-reviews.php: 741463 #: templates/single-restaurant_listings-reviews.php:82 1456 1464 msgid "Submit" 1457 1465 msgstr "" 1458 1466 1459 #: templates/single-restaurant_listings-reviews.php:8 11467 #: templates/single-restaurant_listings-reviews.php:89 1460 1468 msgid "Your rating" 1461 1469 msgstr "" 1462 1470 1463 #: templates/single-restaurant_listings-reviews.php: 821471 #: templates/single-restaurant_listings-reviews.php:90 1464 1472 msgid "Rate…" 1465 1473 msgstr "" 1466 1474 1467 #: templates/single-restaurant_listings-reviews.php: 831475 #: templates/single-restaurant_listings-reviews.php:91 1468 1476 msgid "Perfect" 1469 1477 msgstr "" 1470 1478 1471 #: templates/single-restaurant_listings-reviews.php: 841479 #: templates/single-restaurant_listings-reviews.php:92 1472 1480 msgid "Good" 1473 1481 msgstr "" 1474 1482 1475 #: templates/single-restaurant_listings-reviews.php: 851483 #: templates/single-restaurant_listings-reviews.php:93 1476 1484 msgid "Average" 1477 1485 msgstr "" 1478 1486 1479 #: templates/single-restaurant_listings-reviews.php: 861487 #: templates/single-restaurant_listings-reviews.php:94 1480 1488 msgid "Not that bad" 1481 1489 msgstr "" 1482 1490 1483 #: templates/single-restaurant_listings-reviews.php: 871491 #: templates/single-restaurant_listings-reviews.php:95 1484 1492 msgid "Very poor" 1485 1493 msgstr "" 1486 1494 1487 #: templates/single-restaurant_listings-reviews.php:9 11495 #: templates/single-restaurant_listings-reviews.php:99 1488 1496 msgid "Your review" 1489 1497 msgstr "" 1490 1498 1491 #: wp-restaurant-listings-functions.php: 3581499 #: wp-restaurant-listings-functions.php:418 1492 1500 msgid "Reset" 1493 1501 msgstr "" 1494 1502 1495 #: wp-restaurant-listings-functions.php: 3621503 #: wp-restaurant-listings-functions.php:422 1496 1504 msgid "RSS" 1497 1505 msgstr "" 1498 1506 1499 #: wp-restaurant-listings-functions.php: 4571507 #: wp-restaurant-listings-functions.php:517 1500 1508 msgid "Invalid email address." 1501 1509 msgstr "" 1502 1510 1503 #: wp-restaurant-listings-functions.php: 4651511 #: wp-restaurant-listings-functions.php:525 1504 1512 msgid "Your email address isn’t correct." 1505 1513 msgstr "" 1506 1514 1507 #: wp-restaurant-listings-functions.php: 4691515 #: wp-restaurant-listings-functions.php:529 1508 1516 msgid "This email is already registered, please choose another one." 1509 1517 msgstr "" 1510 1518 1511 #: wp-restaurant-listings-functions.php: 6411519 #: wp-restaurant-listings-functions.php:716 1512 1520 msgid "Passwords must be at least 8 characters long." 1513 1521 msgstr "" 1514 1522 1515 #: wp-restaurant-listings-functions.php:7 231523 #: wp-restaurant-listings-functions.php:798 1516 1524 msgid "Choose a category…" 1517 1525 msgstr "" 1518 1526 1519 #: wp-restaurant-listings-functions.php:9 091527 #: wp-restaurant-listings-functions.php:984 1520 1528 msgid "Uploaded files need to be one of the following file types: %s" 1521 1529 msgstr "" 1522 1530 1523 #: wp-restaurant-listings-functions.php:1 0961531 #: wp-restaurant-listings-functions.php:1171 1524 1532 msgid "Overview" 1525 1533 msgstr "" 1526 1534 1527 #: wp-restaurant-listings-functions.php:11 121535 #: wp-restaurant-listings-functions.php:1187 1528 1536 msgid "Reviews (%d)" 1529 1537 msgstr "" … … 1533 1541 msgstr "" 1534 1542 1535 #: wp-restaurant-listings-template.php:32 11543 #: wp-restaurant-listings-template.php:329 1536 1544 msgid "Username" 1537 1545 msgstr "" 1538 1546 1539 #: wp-restaurant-listings-template.php:3 291547 #: wp-restaurant-listings-template.php:337 1540 1548 msgid "Password" 1541 1549 msgstr "" 1542 1550 1543 #: wp-restaurant-listings-template.php:3 391551 #: wp-restaurant-listings-template.php:347 1544 1552 msgid "Verify Password" 1545 1553 msgstr "" 1546 1554 1547 #: wp-restaurant-listings-template.php:3 461555 #: wp-restaurant-listings-template.php:354 1548 1556 msgid "Your email" 1549 1557 msgstr "" 1550 1558 1551 #: wp-restaurant-listings-template.php:3 471559 #: wp-restaurant-listings-template.php:355 1552 1560 msgid "[email protected]" 1553 1561 msgstr "" 1554 1562 1555 #: wp-restaurant-listings-template.php:3 731563 #: wp-restaurant-listings-template.php:381 1556 1564 msgid "Posted on " 1557 1565 msgstr "" 1558 1566 1559 #: wp-restaurant-listings-template.php:3 751560 #: wp-restaurant-listings-template.php: 3951567 #: wp-restaurant-listings-template.php:383 1568 #: wp-restaurant-listings-template.php:403 1561 1569 msgid "Posted %s ago" 1562 1570 msgstr "" 1563 1571 1564 #: wp-restaurant-listings-template.php:4 181572 #: wp-restaurant-listings-template.php:426 1565 1573 msgid "Anywhere" 1566 1574 msgstr "" 1567 1575 1568 #: wp-restaurant-listings-template.php:9 251576 #: wp-restaurant-listings-template.php:933 1569 1577 msgid "%s customer review" 1570 1578 msgid_plural "%s customer reviews" … … 1572 1580 msgstr[1] "" 1573 1581 1574 #: wp-restaurant-listings-template.php:9 361575 #: wp-restaurant-listings-template.php:13 141582 #: wp-restaurant-listings-template.php:944 1583 #: wp-restaurant-listings-template.php:1322 1576 1584 #. translators: 1: rating 2: rating count 1577 1585 msgid "Rated %1$s out of 5 based on %2$s customer rating" … … 1580 1588 msgstr[1] "" 1581 1589 1582 #: wp-restaurant-listings-template.php:9 391583 #: wp-restaurant-listings-template.php:13 171590 #: wp-restaurant-listings-template.php:947 1591 #: wp-restaurant-listings-template.php:1325 1584 1592 #. translators: %s: rating 1585 1593 msgid "Rated %s out of 5" 1586 1594 msgstr "" 1587 1595 1588 #: wp-restaurant-listings-template.php:10 021596 #: wp-restaurant-listings-template.php:1010 1589 1597 msgid "Today" 1590 1598 msgstr "" 1591 1599 1592 #: wp-restaurant-listings-template.php:10 071600 #: wp-restaurant-listings-template.php:1015 1593 1601 msgid "See more" 1594 1602 msgstr "" 1595 1603 1596 #: wp-restaurant-listings-template.php:10 281604 #: wp-restaurant-listings-template.php:1036 1597 1605 msgid "Get Directions" 1598 1606 msgstr "" … … 1620 1628 msgstr "" 1621 1629 1622 #: includes/admin/class-wp-restaurant-listings-admin.php:9 11630 #: includes/admin/class-wp-restaurant-listings-admin.php:94 1623 1631 #. translators: jQuery date format, see 1624 1632 #. http:api.jqueryui.com/datepicker/#utility-formatDate … … 1645 1653 msgstr "" 1646 1654 1647 #: includes/admin/class-wp-restaurant-listings-setup.php:19 11655 #: includes/admin/class-wp-restaurant-listings-setup.php:192 1648 1656 msgctxt "Default page title (wizard)" 1649 1657 msgid "Post a Restaurant" 1650 1658 msgstr "" 1651 1659 1652 #: includes/admin/class-wp-restaurant-listings-setup.php:20 11660 #: includes/admin/class-wp-restaurant-listings-setup.php:200 1653 1661 msgctxt "Default page title (wizard)" 1654 1662 msgid "Restaurant Dashboard" 1655 1663 msgstr "" 1656 1664 1657 #: includes/admin/class-wp-restaurant-listings-setup.php:2 111665 #: includes/admin/class-wp-restaurant-listings-setup.php:208 1658 1666 msgctxt "Default page title (wizard)" 1659 1667 msgid "Restaurants" 1660 1668 msgstr "" 1661 1669 1662 #: includes/admin/class-wp-restaurant-listings-setup.php:21 71670 #: includes/admin/class-wp-restaurant-listings-setup.php:214 1663 1671 msgctxt "Default page title (wizard)" 1664 1672 msgid "Restaurants Locator" … … 1671 1679 1672 1680 #: includes/class-wp-restaurant-listings-post-types.php:253 1673 #: wp-restaurant-listings-functions.php: 2541681 #: wp-restaurant-listings-functions.php:314 1674 1682 msgctxt "post status" 1675 1683 msgid "Preview" 1676 1684 msgstr "" 1677 1685 1678 #: wp-restaurant-listings-functions.php: 2531686 #: wp-restaurant-listings-functions.php:313 1679 1687 msgctxt "post status" 1680 1688 msgid "Draft" 1681 1689 msgstr "" 1682 1690 1683 #: wp-restaurant-listings-functions.php: 2551691 #: wp-restaurant-listings-functions.php:315 1684 1692 msgctxt "post status" 1685 1693 msgid "Pending approval" 1686 1694 msgstr "" 1687 1695 1688 #: wp-restaurant-listings-functions.php: 2561696 #: wp-restaurant-listings-functions.php:316 1689 1697 msgctxt "post status" 1690 1698 msgid "Pending payment" 1691 1699 msgstr "" 1692 1700 1693 #: wp-restaurant-listings-functions.php: 2571701 #: wp-restaurant-listings-functions.php:317 1694 1702 msgctxt "post status" 1695 1703 msgid "Active" -
wp-restaurant-listings/trunk/license.txt
r1851196 r1928419 20 20 permission notices: 21 21 22 WP Restaurant Listing is Copyright (c) 2017 WPdrift Ltd. 23 https://wpdrift.com/ 24 25 WP Restaurant Listing is released under the GPL 22 WP Job Manager is Copyright (c) 2017 Automattic. 23 http://automattic.com - https://wpjobmanager.com 24 25 WP Job Manager is released under the GPL 26 27 and 28 29 WP Restaurant Listings is Copyright (c) 2017 upnrunn technologies. 30 https://upnrunn.com - https://wpdrift.com 31 32 WP Restaurant Listings is released under the GPL 26 33 27 34 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -
wp-restaurant-listings/trunk/package.json
r1839196 r1928419 2 2 "name": "wp-restaurant-listings", 3 3 "title": "WP Restaurant Listings", 4 "version": "1. 27.0",4 "version": "1.0.0", 5 5 "homepage": "http://wordpress.org/plugins/wp-restaurant-listings/", 6 6 "license": "GPL-2.0+", 7 "repository": " automattic/wp-restaurant-listings",7 "repository": "wpdrift/wp-restaurant-listings", 8 8 "main": "Gruntfile.js", 9 9 "devDependencies": { 10 "grunt": " ~1.0.1",10 "grunt": "^1.0.2", 11 11 "grunt-checkbranch": "^1.0.4", 12 12 "grunt-checkrepo": "^0.1.0", -
wp-restaurant-listings/trunk/readme.txt
r1851196 r1928419 66 66 **Note when using shortcodes**, if the content looks blown up/spaced out/poorly styled, edit your page and above the visual editor click on the 'text' tab. Then remove any 'pre' or 'code' tags wrapping your shortcode. 67 67 68 For more information, [read the documentation](https://wpdrift.com/docs/ restaurants/).68 For more information, [read the documentation](https://wpdrift.com/docs/article-categories/restaurants/). 69 69 70 70 == Frequently Asked Questions == 71 71 72 72 = How do I setup WP Restaurant Listings? = 73 View the getting [installation](https://wpdrift.com/docs/ restaurants/installation/) and [setup](https://wpdrift.com/docs/restaurants/setting-up-wp-job-manager/) guide for advice getting started with the plugin. In most cases it's just a case of adding some shortcodes to your pages!73 View the getting [installation](https://wpdrift.com/docs/knowledge-base/installation-guide/) and [setup](https://wpdrift.com/docs/knowledge-base/setting-up-wp-restaurant-listings/) guide for advice getting started with the plugin. In most cases it's just a case of adding some shortcodes to your pages! 74 74 75 75 = Can I use WP Restaurant Listings without frontend restaurant submission? = … … 80 80 81 81 1. For simple text changes, using a localisation file or a plugin such as https://wordpress.org/plugins/say-what/ 82 2. For field changes, or adding new fields, using functions/filters inside your theme's functions.php file: [https://wpdrift.com/docs/ restaurants/editing-job-submission-fields/](https://wpdrift.com/docs/restaurants/editing-job-submission-fields/)82 2. For field changes, or adding new fields, using functions/filters inside your theme's functions.php file: [https://wpdrift.com/docs/knowledge-base/editing-restaurant-submission-fields/](https://wpdrift.com/docs/knowledge-base/editing-restaurant-submission-fields/) 83 83 3. Use a 3rd party plugin which has a UI for field editing. 84 84 … … 96 96 == Changelog == 97 97 98 = 1.0.1 = 99 * Enhancement: In WP Admin just strip tags from custom field labels instead of escaping them. 100 * Fix: When using Polylang, only the active language's restaurant listings will be displayed in the [restaurants] shortcode. 101 * Enhancement: Sanitize field input using different strategies. 102 * Change: Updates account-signin.php template to warn users email will be confirmed only if that is enabled. 103 * Enhancement: When retrieving listings in [restaurants] shortcode, setting orderby to rand_featured will still place featured listings at the top. 104 * Dev: Runs new actions (restaurant_listings_recent_restaurants_widget_before and restaurant_listings_recent_restaurants_widget_after) inside Recent Restaurants widget. 105 * Dev: Change get_the_restaurant_types() to return an empty array when restaurant types are disabled. 106 * Enhancement: Update language for setup wizard with more clear descriptions. 107 * Fix: Prevent duplicate attachments to restaurant listing posts for non-image media. 108 * Fix: PHP error on registration form due to missing placeholder text. 109 * Fix: Properly reset category selector on [restaurants] shortcode 110 * Fix: Show restaurant listing's published date in localized format 111 * Dev: Adds versions to template files so it is easier to tell when they are updated. 112 * Dev: Adds a new `wprl_notify_new_user` action that allows you to override default behavior. 113 98 114 = 1.0.0 = 99 115 * First stable release. -
wp-restaurant-listings/trunk/templates/account-signin.php
r1851196 r1928419 1 <?php 2 /** 3 * In restaurant listing creation flow, this template shows above the restaurant creation form. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/account-signin.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <?php if ( is_user_logged_in() ) : ?> 2 19 … … 14 31 15 32 <?php else : 16 $account_required = restaurant_listings_user_requires_account(); 17 $registration_enabled = restaurant_listings_enable_registration(); 18 $registration_fields = wprl_get_registration_fields(); 33 $account_required = restaurant_listings_user_requires_account(); 34 $registration_enabled = restaurant_listings_enable_registration(); 35 $registration_fields = wprl_get_registration_fields(); 36 $use_standard_password_email = wprl_use_standard_password_setup_email(); 19 37 ?> 20 38 <fieldset> … … 25 43 <?php if ( $registration_enabled ) : ?> 26 44 27 <?php printf( __( 'If you don’t have an account you can %screate one below by entering your email address/username. Your account details will be confirmed via email.', 'wp-restaurant-listings' ), $account_required ? '' : __( 'optionally', 'wp-restaurant-listings' ) . ' ' ); ?> 45 <?php printf( __( 'If you don’t have an account you can %screate one below by entering your email address/username.', 'wp-restaurant-listings' ), $account_required ? '' : __( 'optionally', 'wp-restaurant-listings' ) . ' ' ); ?> 46 <?php if ( $use_standard_password_email ) : ?> 47 <?php printf( __( 'Your account details will be confirmed via email.', 'wp-restaurant-listings' ) ); ?> 48 <?php endif; ?> 28 49 29 50 <?php elseif ( $account_required ) : ?> -
wp-restaurant-listings/trunk/templates/content-no-restaurants-found.php
r1851196 r1928419 1 <?php 2 /** 3 * Notice when no restaurants were found in `[restaurants]` shortcode. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-no-restaurants-found.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <?php if ( defined( 'DOING_AJAX' ) ) : ?> 2 19 <li class="no_restaurant_listings_found"><?php _e( 'There are no listings matching your search.', 'wp-restaurant-listings' ); ?></li> 3 20 <?php else : ?> 4 <p class="no_restaurant_listings_found"><?php _e( 'There are currently no vacancies.', 'wp-restaurant-listings' ); ?></p>21 <p class="no_restaurant_listings_found"><?php _e( 'There are currently no restaurants.', 'wp-restaurant-listings' ); ?></p> 5 22 <?php endif; ?> -
wp-restaurant-listings/trunk/templates/content-restaurant_listings.php
r1851196 r1928419 1 1 <?php 2 2 /** 3 * Restaurant listing sin the loop.3 * Restaurant listing in the loop. 4 4 * 5 * @since 1.0.0 6 * @version 1.27.0 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-restaurant_listing.php. 7 6 * 8 * @package RestaurantListings 9 * @category Template 10 * @author Automattic 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @since 1.0.0 12 * @version 1.0.1 11 13 */ 12 14 13 global $post; ?> 15 if ( ! defined( 'ABSPATH' ) ) { 16 exit; // Exit if accessed directly. 17 } 18 19 global $post; 20 ?> 14 21 15 22 <li <?php restaurant_listings_class(); ?> data-longitude="<?php echo esc_attr( $post->geolocation_lat ); ?>" data-latitude="<?php echo esc_attr( $post->geolocation_long ); ?>"> -
wp-restaurant-listings/trunk/templates/content-single-restaurant_listings-meta.php
r1851196 r1928419 1 1 <?php 2 2 /** 3 * Single view Restaurant meta box3 * Single view restaurant meta box 4 4 * 5 5 * Hooked into single_restaurant_listings_start priority 20 6 6 * 7 * @since 1.0.0 8 * @version 1.27.0 7 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-single-restaurant_listings-meta.php. 9 8 * 10 * @package RestaurantListings 11 * @category Template 12 * @author Automattic 9 * @see https://wpdrift.com/document/template-overrides/ 10 * @author WPdrift 11 * @package WP Restaurant Listings 12 * @category Template 13 * @since 1.0.0 14 * @version 1.0.1 13 15 */ 16 17 if ( ! defined( 'ABSPATH' ) ) { 18 exit; // Exit if accessed directly. 19 } 14 20 15 21 global $post; -
wp-restaurant-listings/trunk/templates/content-single-restaurant_listings-restaurant.php
r1851196 r1928419 5 5 * Hooked into single_restaurant_listings_start priority 30 6 6 * 7 * @since 1.0.0 7 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-single-restaurant_listings-restaurant.php. 8 * 9 * @see https://wpdrift.com/document/template-overrides/ 10 * @author WPdrift 11 * @package WP Restaurant Listings 12 * @category Template 13 * @since 1.0.0 14 * @version 1.0.1 8 15 */ 16 17 if ( ! defined( 'ABSPATH' ) ) { 18 exit; // Exit if accessed directly. 19 } 9 20 10 21 if ( ! get_the_restaurant_name() ) { -
wp-restaurant-listings/trunk/templates/content-single-restaurant_listings.php
r1851196 r1928419 1 <?php global $post; ?> 1 <?php 2 /** 3 * Single restaurant listing. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-single-restaurant_listings.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 18 global $post; 19 ?> 2 20 <div class="single_restaurant_listing" itemscope itemtype="http://schema.org/RestaurantPosting"> 3 21 <meta itemprop="title" content="<?php echo esc_attr( get_the_restaurant_title( $post ) ); ?>" /> -
wp-restaurant-listings/trunk/templates/content-summary-restaurant_listings.php
r1851196 r1928419 1 <?php 2 /** 3 * Restaurant listing summary 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-summary-restaurant_listings.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <?php global $restaurant_listings; ?> 2 19 -
wp-restaurant-listings/trunk/templates/content-widget-no-restaurants-found.php
r1839196 r1928419 1 <?php /** Intentionally empty - override to modify the content **/ ?> 1 <?php 2 /** 3 * Notice when no restaurants were found in `[restaurants]` shortcode. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-widget-no-restaurants-found.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 18 <?php if ( defined( 'DOING_AJAX' ) ) : ?> 19 <li class="no_restaurant_listings_found"><?php _e( 'There are no listings matching your search.', 'wp-restaurant-listings' ); ?></li> 20 <?php else : ?> 21 <p class="no_restaurant_listings_found"><?php _e( 'There are currently no restaurants.', 'wp-restaurant-listings' ); ?></p> 22 <?php endif; ?> -
wp-restaurant-listings/trunk/templates/content-widget-restaurant_listings.php
r1851196 r1928419 1 <?php 2 /** 3 * Single restaurant listing widget content. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/content-widget-restaurant_listings.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <li <?php restaurant_listings_class(); ?>> 2 19 <a href="<?php the_restaurant_permalink(); ?>"> -
wp-restaurant-listings/trunk/templates/form-fields/business-hours-field.php
r1851196 r1928419 1 1 <?php 2 /** 3 * Shows `select` form fields in a list from a list on restaurant listing hours. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/business-hours-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 2 18 wp_enqueue_script( 'jquey-timepicker' ); 3 19 wp_enqueue_style( 'jquery-timepicker' ); -
wp-restaurant-listings/trunk/templates/form-fields/checkbox-field.php
r1851196 r1928419 1 <?php 2 /** 3 * Shows the `checkbox` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/checkbox-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <input type="checkbox" class="input-checkbox" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" id="<?php echo esc_attr( $key ); ?>" <?php checked( ! empty( $field['value'] ), true ); ?> value="1" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?> /> 2 19 <?php if ( ! empty( $field['description'] ) ) : ?><small class="description"><?php echo $field['description']; ?></small><?php endif; ?> -
wp-restaurant-listings/trunk/templates/form-fields/file-field.php
r1851196 r1928419 1 1 <?php 2 /** 3 * Shows the `file` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/file-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 2 18 $classes = array( 'input-text' ); 3 19 $allowed_mime_types = array_keys( ! empty( $field['allowed_mime_types'] ) ? $field['allowed_mime_types'] : get_allowed_mime_types() ); -
wp-restaurant-listings/trunk/templates/form-fields/multiselect-field.php
r1851196 r1928419 1 <?php wp_enqueue_script( 'wp-restaurant-listings-multiselect' ); ?> 1 <?php 2 /** 3 * Shows the `select` (multiple) form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/multiselect-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 2 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 18 wp_enqueue_script( 'wp-restaurant-listings-multiselect' ); 19 ?> 3 20 <select multiple="multiple" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>[]" id="<?php echo esc_attr( $key ); ?>" class="restaurant-listings-multiselect" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?> data-no_results_text="<?php _e( 'No results match', 'wp-restaurant-listings' ); ?>" data-multiple_text="<?php _e( 'Select Some Options', 'wp-restaurant-listings' ); ?>"> 4 21 <?php foreach ( $field['options'] as $key => $value ) : ?> -
wp-restaurant-listings/trunk/templates/form-fields/password-field.php
r1851196 r1928419 1 <input type="password" class="input-text"<?php if ( isset( $field['autocomplete'] ) && false === $field['autocomplete'] ) { echo ' autocomplete="off"'; } ?> name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php echo isset( $field['value'] ) ? esc_attr( $field['value'] ) : ''; ?>" maxlength="<?php echo ! empty( $field['maxlength'] ) ? $field['maxlength'] : ''; ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?> /> 1 <?php 2 /** 3 * Shows the `password` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/password-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 18 <input type="password" class="input-text"<?php if ( isset( $field['autocomplete'] ) && false === $field['autocomplete'] ) { echo ' autocomplete="off"'; } ?> name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo empty( $field['placeholder'] ) ? '' : esc_attr( $field['placeholder'] ); ?>" value="<?php echo isset( $field['value'] ) ? esc_attr( $field['value'] ) : ''; ?>" maxlength="<?php echo ! empty( $field['maxlength'] ) ? $field['maxlength'] : ''; ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?> /> 2 19 <?php if ( ! empty( $field['description'] ) ) : ?><small class="description"><?php echo $field['description']; ?></small><?php endif; ?> -
wp-restaurant-listings/trunk/templates/form-fields/radio-field.php
r1851196 r1928419 1 1 <?php 2 2 /** 3 * Shows the `radio` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/radio-field.php. 6 * 3 7 * Radio Field. Example definition: 4 8 * … … 14 18 * ) 15 19 * ) 20 * 21 * @see https://wpdrift.com/document/template-overrides/ 22 * @author WPdrift 23 * @package WP Restaurant Listings 24 * @category Template 25 * @version 1.0.1 16 26 */ 27 28 if ( ! defined( 'ABSPATH' ) ) { 29 exit; // Exit if accessed directly. 30 } 17 31 18 32 $field['default'] = empty( $field['default'] ) ? current( array_keys( $field['options'] ) ) : $field['default']; -
wp-restaurant-listings/trunk/templates/form-fields/select-field.php
r1851196 r1928419 1 <?php 2 /** 3 * Shows the `select` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/select-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <select name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" id="<?php echo esc_attr( $key ); ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?>> 2 19 <?php foreach ( $field['options'] as $key => $value ) : ?> -
wp-restaurant-listings/trunk/templates/form-fields/term-checklist-field.php
r1851196 r1928419 1 <?php 2 /** 3 * Shows `checkbox` form fields in a list from a list on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/term-checklist-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <ul class="restaurant-listings-term-checklist restaurant-listings-term-checklist-<?php echo $key ?>"> 2 19 <?php -
wp-restaurant-listings/trunk/templates/form-fields/term-multiselect-field.php
r1851196 r1928419 1 1 <?php 2 /** 3 * Shows term `select` (multiple) form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/term-multiselect-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 2 18 // Get selected value 3 19 if ( isset( $field['value'] ) ) { -
wp-restaurant-listings/trunk/templates/form-fields/term-select-field.php
r1851196 r1928419 1 1 <?php 2 /** 3 * Shows term `select` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/term-select-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 2 18 // Get selected value 3 19 if ( isset( $field['value'] ) ) { -
wp-restaurant-listings/trunk/templates/form-fields/text-field.php
r1851196 r1928419 1 <input type="text" class="input-text" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>"<?php if ( isset( $field['autocomplete'] ) && false === $field['autocomplete'] ) { echo ' autocomplete="off"'; } ?> id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php echo isset( $field['value'] ) ? esc_attr( $field['value'] ) : ''; ?>" maxlength="<?php echo ! empty( $field['maxlength'] ) ? $field['maxlength'] : ''; ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?> /> 1 <?php 2 /** 3 * Shows the `text` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/text-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 18 <input type="text" class="input-text" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>"<?php if ( isset( $field['autocomplete'] ) && false === $field['autocomplete'] ) { echo ' autocomplete="off"'; } ?> id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo empty( $field['placeholder'] ) ? '' : esc_attr( $field['placeholder'] ); ?>" value="<?php echo isset( $field['value'] ) ? esc_attr( $field['value'] ) : ''; ?>" maxlength="<?php echo ! empty( $field['maxlength'] ) ? $field['maxlength'] : ''; ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?> /> 2 19 <?php if ( ! empty( $field['description'] ) ) : ?><small class="description"><?php echo $field['description']; ?></small><?php endif; ?> -
wp-restaurant-listings/trunk/templates/form-fields/textarea-field.php
r1851196 r1928419 1 <textarea cols="20" rows="3" class="input-text" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" maxlength="<?php echo ! empty( $field['maxlength'] ) ? $field['maxlength'] : ''; ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?>><?php echo isset( $field['value'] ) ? esc_textarea( $field['value'] ) : ''; ?></textarea> 1 <?php 2 /** 3 * Shows the `textarea` form field on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/textarea-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 18 <textarea cols="20" rows="3" class="input-text" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo empty( $field['placeholder'] ) ? '' : esc_attr( $field['placeholder'] ); ?>" maxlength="<?php echo ! empty( $field['maxlength'] ) ? $field['maxlength'] : ''; ?>" <?php if ( ! empty( $field['required'] ) ) echo 'required'; ?>><?php echo isset( $field['value'] ) ? esc_textarea( $field['value'] ) : ''; ?></textarea> 2 19 <?php if ( ! empty( $field['description'] ) ) : ?><small class="description"><?php echo $field['description']; ?></small><?php endif; ?> -
wp-restaurant-listings/trunk/templates/form-fields/uploaded-file-html.php
r1851196 r1928419 1 <?php 2 /** 3 * Shows info for an uploaded file on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/uploaded-file-html.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <div class="restaurant-listings-uploaded-file"> 2 19 <?php -
wp-restaurant-listings/trunk/templates/form-fields/wp-editor-field.php
r1851196 r1928419 1 1 <?php 2 /** 3 * Shows the right `textarea` form field with WP Editor on restaurant listing forms. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/form-fields/wp-editor-field.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 2 18 $editor = apply_filters( 'submit_restaurant_form_wp_editor_args', array( 3 19 'textarea_name' => isset( $field['name'] ) ? $field['name'] : $key, -
wp-restaurant-listings/trunk/templates/pagination.php
r1851196 r1928419 2 2 /** 3 3 * Pagination - Show numbered pagination for catalog pages. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/pagination.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 4 12 */ 5 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 6 17 7 18 if ( $max_num_pages <= 1 ) { -
wp-restaurant-listings/trunk/templates/restaurant-dashboard-login.php
r1851196 r1928419 1 <?php 2 /** 3 * Restaurant dashboard shortcode content if user is not logged in. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-dashboard-login.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <div id="restaurant-listings-restaurant-dashboard"> 2 19 -
wp-restaurant-listings/trunk/templates/restaurant-dashboard.php
r1851196 r1928419 1 <?php 2 /** 3 * Restaurant dashboard shortcode content. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-dashboard.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <div id="restaurant-listings-restaurant-dashboard"> 2 19 <p><?php _e( 'Your listings are shown in the table below.', 'wp-restaurant-listings' ); ?></p> -
wp-restaurant-listings/trunk/templates/restaurant-filter-restaurant-types.php
r1851196 r1928419 1 <?php 2 /** 3 * Filter in `[restaurants]` shortcode for restaurant types. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-filter-restaurant-types.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <?php if ( ! is_tax( 'restaurant_listings_type' ) && empty( $restaurant_types ) ) : ?> 2 19 <ul class="restaurant_types"> -
wp-restaurant-listings/trunk/templates/restaurant-filters.php
r1851196 r1928419 1 <?php wp_enqueue_script( 'wp-restaurant-listings-ajax-filters' ); ?> 1 <?php 2 /** 3 * Filters in `[restaurants]` shortcode. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-filters.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 2 13 3 <?php do_action( 'restaurant_listings_restaurant_filters_before', $atts ); ?> 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 18 wp_enqueue_script( 'wp-restaurant-listings-ajax-filters' ); 19 20 do_action( 'restaurant_listings_restaurant_filters_before', $atts ); 21 ?> 4 22 5 23 <form class="restaurant_filters"> -
wp-restaurant-listings/trunk/templates/restaurant-gallery-photoswipe.php
r1851196 r1928419 2 2 /** 3 3 * Photoswipe markup 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-gallery-photoswipe.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 4 12 */ 5 13 -
wp-restaurant-listings/trunk/templates/restaurant-listings-end.php
r1839196 r1928419 1 <?php 2 /** 3 * Content shown after restaurant listings in `[restaurants]` shortcode. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-listings-end.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 </ul> -
wp-restaurant-listings/trunk/templates/restaurant-listings-start.php
r1839196 r1928419 1 <?php 2 /** 3 * Content shown before restaurant listings in `[restaurants]` shortcode. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-listings-start.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <ul class="restaurant_listings"> -
wp-restaurant-listings/trunk/templates/restaurant-pagination.php
r1851196 r1928419 2 2 /** 3 3 * Pagination - Show numbered pagination for the [restaurants] shortcode 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-pagination.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 4 12 */ 5 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 6 17 7 18 if ( $max_num_pages <= 1 ) { -
wp-restaurant-listings/trunk/templates/restaurant-preview.php
r1851196 r1928419 1 <?php 2 /** 3 * Restaurant listing preview when submitting restaurant listings. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-preview.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 ?> 1 18 <form method="post" id="restaurant_preview" action="<?php echo esc_url( $form->get_action() ); ?>"> 2 19 <div class="restaurant_listings_preview_title"> -
wp-restaurant-listings/trunk/templates/restaurant-submit.php
r1851196 r1928419 2 2 /** 3 3 * Restaurant Submission Form 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-submit.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 4 12 */ 5 if ( ! defined( 'ABSPATH' ) ) exit; 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 6 17 7 18 global $restaurant_listings; -
wp-restaurant-listings/trunk/templates/restaurant-submitted.php
r1851196 r1928419 1 1 <?php 2 /** 3 * Notice when restaurant has been submitted. 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/restaurant-submitted.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 12 */ 13 14 if ( ! defined( 'ABSPATH' ) ) { 15 exit; // Exit if accessed directly. 16 } 17 2 18 global $wp_post_types; 3 19 -
wp-restaurant-listings/trunk/templates/single-restaurant_listings-reviews.php
r1851196 r1928419 3 3 * Display single reviews (comments) 4 4 * 5 * This template can be overridden by copying it to yourtheme/restaurant_listings/single-restaurant_listings-reviews.php. 6 * 7 * @see https://wpdrift.com/document/template-overrides/ 8 * @author WPdrift 9 * @package WP Restaurant Listings 10 * @category Template 11 * @version 1.0.1 5 12 */ 6 13 -
wp-restaurant-listings/trunk/wp-restaurant-listings-functions.php
r1851196 r1928419 1 1 <?php 2 2 if ( ! function_exists( 'get_restaurant_listings' ) ) : 3 /** 4 * Queries restaurant listings with certain criteria and returns them. 5 * 6 * @since 1.0.0 7 * @param string|array|object $args Arguments used to retrieve restaurant listings. 8 * @return WP_Query 9 */ 10 function get_restaurant_listings( $args = array() ) { 11 global $wpdb, $restaurant_listings_keyword; 12 13 $args = wp_parse_args( $args, array( 14 'search_location' => '', 15 'search_keywords' => '', 16 'search_categories' => array(), 17 'restaurant_types' => array(), 18 'search_price_range'=> '', 19 'post_status' => array(), 20 'offset' => 0, 21 'posts_per_page' => 20, 22 'orderby' => 'date', 23 'order' => 'DESC', 24 'featured' => null, 25 'fields' => 'all' 26 ) ); 27 28 /** 29 * Perform actions that need to be done prior to the start of the restaurant listings query. 3 /** 4 * Queries restaurant listings with certain criteria and returns them. 30 5 * 31 6 * @since 1.0.0 32 * 33 * @param array $args Arguments used to retrieve restaurant listings. 34 */ 35 do_action( 'get_restaurant_listings_init', $args ); 36 37 if ( ! empty( $args['post_status'] ) ) { 38 $post_status = $args['post_status']; 39 } else { 40 $post_status = 'publish'; 41 } 42 43 $query_args = array( 44 'post_type' => 'restaurant_listings', 45 'post_status' => $post_status, 46 'ignore_sticky_posts' => 1, 47 'offset' => absint( $args['offset'] ), 48 'posts_per_page' => intval( $args['posts_per_page'] ), 49 'orderby' => $args['orderby'], 50 'order' => $args['order'], 51 'tax_query' => array(), 52 'meta_query' => array(), 53 'update_post_term_cache' => false, 54 'update_post_meta_cache' => false, 55 'cache_results' => false, 56 'fields' => $args['fields'] 57 ); 58 59 if ( $args['posts_per_page'] < 0 ) { 60 $query_args['no_found_rows'] = true; 61 } 62 63 if ( ! empty( $args['search_location'] ) ) { 64 $location_meta_keys = array( 'geolocation_formatted_address', '_restaurant_location', 'geolocation_state_long' ); 65 $location_search = array( 'relation' => 'OR' ); 66 foreach ( $location_meta_keys as $meta_key ) { 67 $location_search[] = array( 68 'key' => $meta_key, 69 'value' => $args['search_location'], 70 'compare' => 'like' 7 * @param string|array|object $args Arguments used to retrieve restaurant listings. 8 * @return WP_Query 9 */ 10 function get_restaurant_listings( $args = array() ) { 11 global $wpdb, $restaurant_listings_keyword; 12 13 $args = wp_parse_args( $args, array( 14 'search_location' => '', 15 'search_keywords' => '', 16 'search_categories' => array(), 17 'restaurant_types' => array(), 18 'search_price_range' => '', 19 'post_status' => array(), 20 'offset' => 0, 21 'posts_per_page' => 20, 22 'orderby' => 'date', 23 'order' => 'DESC', 24 'featured' => null, 25 'fields' => 'all', 26 ) ); 27 28 /** 29 * Perform actions that need to be done prior to the start of the restaurant listings query. 30 * 31 * @since 1.0.0 32 * 33 * @param array $args Arguments used to retrieve restaurant listings. 34 */ 35 do_action( 'get_restaurant_listings_init', $args ); 36 37 if ( ! empty( $args['post_status'] ) ) { 38 $post_status = $args['post_status']; 39 } else { 40 $post_status = 'publish'; 41 } 42 43 $query_args = array( 44 'post_type' => 'restaurant_listings', 45 'post_status' => $post_status, 46 'ignore_sticky_posts' => 1, 47 'offset' => absint( $args['offset'] ), 48 'posts_per_page' => intval( $args['posts_per_page'] ), 49 'orderby' => $args['orderby'], 50 'order' => $args['order'], 51 'tax_query' => array(), 52 'meta_query' => array(), 53 'update_post_term_cache' => false, 54 'update_post_meta_cache' => false, 55 'cache_results' => false, 56 'fields' => $args['fields'], 57 ); 58 59 if ( $args['posts_per_page'] < 0 ) { 60 $query_args['no_found_rows'] = true; 61 } 62 63 if ( ! empty( $args['search_location'] ) ) { 64 $location_meta_keys = array( 'geolocation_formatted_address', '_restaurant_location', 'geolocation_state_long' ); 65 $location_search = array( 'relation' => 'OR' ); 66 foreach ( $location_meta_keys as $meta_key ) { 67 $location_search[] = array( 68 'key' => $meta_key, 69 'value' => $args['search_location'], 70 'compare' => 'like', 71 ); 72 } 73 $query_args['meta_query'][] = $location_search; 74 } 75 76 if ( ! is_null( $args['featured'] ) ) { 77 $query_args['meta_query'][] = array( 78 'key' => '_featured', 79 'value' => '1', 80 'compare' => $args['featured'] ? '=' : '!=', 71 81 ); 72 82 } 73 $query_args['meta_query'][] = $location_search; 74 } 75 76 if ( ! is_null( $args['featured'] ) ) { 77 $query_args['meta_query'][] = array( 78 'key' => '_featured', 79 'value' => '1', 80 'compare' => $args['featured'] ? '=' : '!=' 81 ); 82 } 83 84 if ( ! empty( $args['restaurant_types'] ) ) { 85 $query_args['tax_query'][] = array( 86 'taxonomy' => 'restaurant_listings_type', 87 'field' => 'slug', 88 'terms' => $args['restaurant_types'] 89 ); 90 } 91 92 if ( ! empty( $args['search_price_range'] ) ) { 93 $query_args['meta_query'][] = array( 94 'key' => '_restaurant_price_range', 95 'value' => (int)$args['search_price_range'], 96 'compare' => '=', 97 ); 98 } 99 100 if ( ! empty( $args['search_categories'] ) ) { 101 $field = is_numeric( $args['search_categories'][0] ) ? 'term_id' : 'slug'; 102 $operator = 'all' === get_option( 'restaurant_listings_category_filter_type', 'all' ) && sizeof( $args['search_categories'] ) > 1 ? 'AND' : 'IN'; 103 $query_args['tax_query'][] = array( 104 'taxonomy' => 'restaurant_listings_category', 105 'field' => $field, 106 'terms' => array_values( $args['search_categories'] ), 107 'include_children' => $operator !== 'AND' , 108 'operator' => $operator 109 ); 110 } 111 112 if ( 'featured' === $args['orderby'] ) { 113 $query_args['orderby'] = array( 114 'menu_order' => 'ASC', 115 'date' => 'DESC' 116 ); 117 } 118 119 $restaurant_listings_keyword = sanitize_text_field( $args['search_keywords'] ); 120 121 if ( ! empty( $restaurant_listings_keyword ) && strlen( $restaurant_listings_keyword ) >= apply_filters( 'restaurant_listings_get_listings_keyword_length_threshold', 2 ) ) { 122 $query_args['s'] = $restaurant_listings_keyword; 123 add_filter( 'posts_search', 'get_restaurant_listings_keyword_search' ); 124 } 125 126 $query_args = apply_filters( 'restaurant_listings_get_listings', $query_args, $args ); 127 128 if ( empty( $query_args['meta_query'] ) ) { 129 unset( $query_args['meta_query'] ); 130 } 131 132 if ( empty( $query_args['tax_query'] ) ) { 133 unset( $query_args['tax_query'] ); 134 } 135 136 /** This filter is documented in wp-restaurant-listings.php */ 137 $query_args['lang'] = apply_filters( 'wprl_lang', null ); 138 139 // Filter args 140 $query_args = apply_filters( 'get_restaurant_listings_query_args', $query_args, $args ); 141 142 // Generate hash 143 $to_hash = json_encode( $query_args ); 144 $query_args_hash = 'jm_' . md5( $to_hash ) . WP_Restaurant_Listings_Cache_Helper::get_transient_version( 'get_restaurant_listings' ); 145 146 do_action( 'before_get_restaurant_listings', $query_args, $args ); 147 148 // Cache results 149 if ( apply_filters( 'get_restaurant_listings_cache_results', true ) ) { 150 151 if ( false === ( $result = get_transient( $query_args_hash ) ) ) { 83 84 if ( ! empty( $args['restaurant_types'] ) ) { 85 $query_args['tax_query'][] = array( 86 'taxonomy' => 'restaurant_listings_type', 87 'field' => 'slug', 88 'terms' => $args['restaurant_types'], 89 ); 90 } 91 92 if ( ! empty( $args['search_price_range'] ) ) { 93 $query_args['meta_query'][] = array( 94 'key' => '_restaurant_price_range', 95 'value' => (int)$args['search_price_range'], 96 'compare' => '=', 97 ); 98 } 99 100 if ( ! empty( $args['search_categories'] ) ) { 101 $field = is_numeric( $args['search_categories'][0] ) ? 'term_id' : 'slug'; 102 $operator = 'all' === get_option( 'restaurant_listings_category_filter_type', 'all' ) && sizeof( $args['search_categories'] ) > 1 ? 'AND' : 'IN'; 103 $query_args['tax_query'][] = array( 104 'taxonomy' => 'restaurant_listings_category', 105 'field' => $field, 106 'terms' => array_values( $args['search_categories'] ), 107 'include_children' => 'AND' !== $operator, 108 'operator' => $operator, 109 ); 110 } 111 112 if ( 'featured' === $args['orderby'] ) { 113 $query_args['orderby'] = array( 114 'menu_order' => 'ASC', 115 'date' => 'DESC', 116 ); 117 } 118 119 if ( 'rand_featured' === $args['orderby'] ) { 120 $query_args['orderby'] = array( 121 'menu_order' => 'ASC', 122 'rand' => 'ASC', 123 ); 124 } 125 126 $restaurant_listings_keyword = sanitize_text_field( $args['search_keywords'] ); 127 128 if ( ! empty( $restaurant_listings_keyword ) && strlen( $restaurant_listings_keyword ) >= apply_filters( 'restaurant_listings_get_listings_keyword_length_threshold', 2 ) ) { 129 $query_args['s'] = $restaurant_listings_keyword; 130 add_filter( 'posts_search', 'get_restaurant_listings_keyword_search' ); 131 } 132 133 $query_args = apply_filters( 'restaurant_listings_get_listings', $query_args, $args ); 134 135 if ( empty( $query_args['meta_query'] ) ) { 136 unset( $query_args['meta_query'] ); 137 } 138 139 if ( empty( $query_args['tax_query'] ) ) { 140 unset( $query_args['tax_query'] ); 141 } 142 143 /** This filter is documented in wp-restaurant-listings.php */ 144 $query_args['lang'] = apply_filters( 'wprl_lang', null ); 145 146 // Filter args. 147 $query_args = apply_filters( 'get_restaurant_listings_query_args', $query_args, $args ); 148 149 do_action( 'before_get_restaurant_listings', $query_args, $args ); 150 151 // Cache results. 152 if ( apply_filters( 'get_restaurant_listings_cache_results', true ) ) { 153 154 // Generate hash. 155 $to_hash = json_encode( $query_args ); 156 $query_args_hash = 'jm_' . md5( $to_hash ) . WP_Restaurant_Listings_Cache_Helper::get_transient_version( 'get_restaurant_listings' ); 157 $result = false; 158 $cached_query_results = false; 159 $cached_query_posts = get_transient( $query_args_hash ); 160 161 if ( is_string( $cached_query_posts ) ) { 162 $cached_query_posts = json_decode( $cached_query_posts, false ); 163 if ( $cached_query_posts 164 && is_object( $cached_query_posts ) 165 && isset( $cached_query_posts->max_num_pages ) 166 && isset( $cached_query_posts->found_posts ) 167 && isset( $cached_query_posts->posts ) 168 && is_array( $cached_query_posts->posts ) 169 ) { 170 $posts = array_map( 'get_post', $cached_query_posts->posts ); 171 $result = new WP_Query(); 172 $result->parse_query( $query_args ); 173 $result->posts = $posts; 174 $result->found_posts = intval( $cached_query_posts->found_posts ); 175 $result->max_num_pages = intval( $cached_query_posts->max_num_pages ); 176 $result->post_count = count( $posts ); 177 } 178 } 179 180 if ( false === $result ) { 181 $result = new WP_Query( $query_args ); 182 $cached_query_results = false; 183 $cacheable_result = array(); 184 $cacheable_result['posts'] = array_values( $result->posts ); 185 $cacheable_result['found_posts'] = $result->found_posts; 186 $cacheable_result['max_num_pages'] = $result->max_num_pages; 187 set_transient( $query_args_hash, json_encode( $cacheable_result ), DAY_IN_SECONDS ); 188 } 189 190 if ( $cached_query_results ) { 191 // random order is cached so shuffle them. 192 if ( 'rand_featured' === $args['orderby'] ) { 193 usort( $result->posts, '_wprl_shuffle_featured_post_results_helper' ); 194 } elseif ( 'rand' === $args['orderby'] ) { 195 shuffle( $result->posts ); 196 } 197 } 198 } else { 152 199 $result = new WP_Query( $query_args ); 153 set_transient( $query_args_hash, $result, DAY_IN_SECONDS ); 154 } 155 156 // random order is cached so shuffle them 157 if ( $query_args[ 'orderby' ] == 'rand' ) { 158 shuffle( $result->posts ); 159 } 160 161 } 162 else { 163 $result = new WP_Query( $query_args ); 164 } 165 166 do_action( 'after_get_restaurant_listings', $query_args, $args ); 167 168 remove_filter( 'posts_search', 'get_restaurant_listings_keyword_search' ); 169 170 return $result; 171 } 200 } 201 202 do_action( 'after_get_restaurant_listings', $query_args, $args ); 203 204 remove_filter( 'posts_search', 'get_restaurant_listings_keyword_search' ); 205 206 return $result; 207 } 208 endif; 209 210 if ( ! function_exists( '_wprl_shuffle_featured_post_results_helper' ) ) : 211 /** 212 * Helper function to maintain featured status when shuffling results. 213 * 214 * @param WP_Post $a 215 * @param WP_Post $b 216 * 217 * @return bool 218 */ 219 function _wprl_shuffle_featured_post_results_helper( $a, $b ) { 220 if ( -1 === $a->menu_order || -1 === $b->menu_order ) { 221 // Left is featured. 222 if ( 0 === $b->menu_order ) { 223 return -1; 224 } 225 // Right is featured. 226 if ( 0 === $a->menu_order ) { 227 return 1; 228 } 229 } 230 return rand( -1, 1 ); 231 } 172 232 endif; 173 233 … … 208 268 $conditions[] = "{$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key IN ( '" . implode( "','", array_map( 'esc_sql', $searchable_meta_keys ) ) . "' ) AND meta_value LIKE '%" . esc_sql( $restaurant_listings_keyword ) . "%' )"; 209 269 } else { 210 // No meta keys defined, search all post meta value270 // No meta keys defined, search all post meta value 211 271 $conditions[] = "{$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value LIKE '%" . esc_sql( $restaurant_listings_keyword ) . "%' )"; 212 272 } … … 322 382 return get_terms( "restaurant_listings_category", array( 323 383 'orderby' => 'name', 324 'order' => 'ASC',325 'hide_empty' => false,384 'order' => 'ASC', 385 'hide_empty' => false, 326 386 ) ); 327 387 } … … 508 568 } 509 569 510 // Notify 511 wp_restaurant_listings_notify_new_user( $user_id, $password, $new_user ); 570 /** 571 * Send notification to new users. 572 * 573 * @since 1.28.0 574 * 575 * @param int $user_id 576 * @param string|bool $password 577 * @param array $new_user { 578 * Information about the new user. 579 * 580 * @type string $user_login Username for the user. 581 * @type string $user_pass Password for the user (may be blank). 582 * @type string $user_email Email for the new user account. 583 * @type string $role New user's role. 584 * } 585 */ 586 do_action( 'wprl_notify_new_user', $user_id, $password, $new_user ); 512 587 513 588 // Login … … 1039 1114 */ 1040 1115 function restaurant_listings_get_days_of_week() { 1041 $days = array(0, 1, 2, 3, 4, 5, 6);1042 $start = get_option( 'start_of_week' );1043 1044 $first = array_splice( $days, $start, count( $days ) - $start );1045 $second = array_splice( $days, 0, $start );1046 $days = array_merge( $first, $second );1047 1048 return $days;1116 $days = array(0, 1, 2, 3, 4, 5, 6); 1117 $start = get_option( 'start_of_week' ); 1118 1119 $first = array_splice( $days, $start, count( $days ) - $start ); 1120 $second = array_splice( $days, 0, $start ); 1121 $days = array_merge( $first, $second ); 1122 1123 return $days; 1049 1124 } 1050 1125 … … 1059 1134 */ 1060 1135 function restaurant_listings_category_list( $restaurant_id, $sep = ', ', $before = '', $after = '' ) { 1061 return get_the_term_list( $restaurant_id, 'restaurant_listings_category', $before, $sep, $after );1136 return get_the_term_list( $restaurant_id, 'restaurant_listings_category', $before, $sep, $after ); 1062 1137 } 1063 1138 … … 1069 1144 */ 1070 1145 function restaurant_listings_get_review_count( $post_id ) { 1071 global $wpdb;1072 1073 $count = $wpdb->get_var( $wpdb->prepare("1146 global $wpdb; 1147 1148 $count = $wpdb->get_var( $wpdb->prepare(" 1074 1149 SELECT COUNT(*) FROM $wpdb->comments 1075 1150 WHERE comment_parent = 0 … … 1078 1153 ", $post_id ) ); 1079 1154 1080 return $count;1155 return $count; 1081 1156 } 1082 1157 … … 1084 1159 if ( ! function_exists( 'restaurant_listings_default_tabs' ) ) { 1085 1160 1086 /**1087 * Add default restaurant tabs to restaurant pages.1088 *1089 * @param array $tabs1090 * @return array1091 */1092 function restaurant_listings_default_tabs( $tabs = array() ) {1093 global $post;1094 1095 $tabs['overview'] = array(1096 'title' => sprintf( __( 'Overview', 'wp-restaurant-listings' ) ),1097 'priority' => 20,1098 'callback' => 'restaurant_listings_overview_tab',1099 );1100 1101 $tabs['menu'] = array(1102 'title' => sprintf( __( 'Menu', 'wp-restaurant-listings' ) ),1103 'priority' => 30,1104 'callback' => 'restaurant_listings_menu_tab',1105 );1106 1107 1108 // Reviews tab - shows comments1109 if ( comments_open() ) {1110 1111 $tabs['reviews'] = array(1112 'title' => sprintf( __( 'Reviews (%d)', 'wp-restaurant-listings' ), restaurant_listings_get_review_count( $post->ID ) ),1113 'priority' => 30,1114 'callback' => 'comments_template',1115 );1116 }1117 1118 return $tabs;1119 }1120 } 1161 /** 1162 * Add default restaurant tabs to restaurant pages. 1163 * 1164 * @param array $tabs 1165 * @return array 1166 */ 1167 function restaurant_listings_default_tabs( $tabs = array() ) { 1168 global $post; 1169 1170 $tabs['overview'] = array( 1171 'title' => sprintf( __( 'Overview', 'wp-restaurant-listings' ) ), 1172 'priority' => 20, 1173 'callback' => 'restaurant_listings_overview_tab', 1174 ); 1175 1176 $tabs['menu'] = array( 1177 'title' => sprintf( __( 'Menu', 'wp-restaurant-listings' ) ), 1178 'priority' => 30, 1179 'callback' => 'restaurant_listings_menu_tab', 1180 ); 1181 1182 1183 // Reviews tab - shows comments 1184 if ( comments_open() ) { 1185 1186 $tabs['reviews'] = array( 1187 'title' => sprintf( __( 'Reviews (%d)', 'wp-restaurant-listings' ), restaurant_listings_get_review_count( $post->ID ) ), 1188 'priority' => 30, 1189 'callback' => 'comments_template', 1190 ); 1191 } 1192 1193 return $tabs; 1194 } 1195 } -
wp-restaurant-listings/trunk/wp-restaurant-listings-template.php
r1851196 r1928419 264 264 265 265 $types = get_the_terms( $post->ID, 'restaurant_listings_type' ); 266 267 if ( empty( $types ) || is_wp_error( $types ) ) { 268 $types = array(); 269 } 266 270 267 271 // Return single if not enabled. … … 374 378 $date_format = get_option( 'restaurant_listings_date_format' ); 375 379 376 if ( $date_format === 'default') {377 $display_date = __( 'Posted on ', 'wp-restaurant-listings' ) . get_post_time( get_option( 'date_format' ) );380 if ( 'default' === $date_format ) { 381 $display_date = __( 'Posted on ', 'wp-restaurant-listings' ) . date_i18n( get_option( 'date_format' ), get_post_time( 'U' ) ); 378 382 } else { 379 383 $display_date = sprintf( __( 'Posted %s ago', 'wp-restaurant-listings' ), human_time_diff( get_post_time( 'U' ), current_time( 'timestamp' ) ) ); -
wp-restaurant-listings/trunk/wp-restaurant-listings.php
r1851196 r1928419 4 4 * Plugin URI: http://restaurants.wpdrift.com/ 5 5 * Description: Manage restaurant listings from the WordPress admin panel, and allow users to post restaurants directly to your site. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: WPdrift 8 8 * Author URI: https://wpdrift.com/
Note: See TracChangeset
for help on using the changeset viewer.