Changeset 3431049
- Timestamp:
- 01/02/2026 01:09:24 PM (7 weeks ago)
- Location:
- review-buddypress-groups
- Files:
-
- 132 added
- 16 edited
-
tags/3.7.0 (added)
-
tags/3.7.0/admin (added)
-
tags/3.7.0/admin/assets (added)
-
tags/3.7.0/admin/assets/css (added)
-
tags/3.7.0/admin/assets/css/bgr-admin.css (added)
-
tags/3.7.0/admin/assets/css/min (added)
-
tags/3.7.0/admin/assets/css/min/bgr-admin.min.css (added)
-
tags/3.7.0/admin/assets/css/rtl (added)
-
tags/3.7.0/admin/assets/css/rtl/bgr-admin.rtl.css (added)
-
tags/3.7.0/admin/assets/css/rtl/bgr-admin.rtl.css.map (added)
-
tags/3.7.0/admin/assets/css/vendor (added)
-
tags/3.7.0/admin/assets/css/vendor/selectize.css (added)
-
tags/3.7.0/admin/assets/js (added)
-
tags/3.7.0/admin/assets/js/min (added)
-
tags/3.7.0/admin/assets/js/min/bgr-admin.min.js (added)
-
tags/3.7.0/admin/assets/js/min/bgr-colorpicker.min.js (added)
-
tags/3.7.0/admin/assets/js/vendor (added)
-
tags/3.7.0/admin/assets/js/vendor/selectize.min.js (added)
-
tags/3.7.0/admin/bgr-admin-feedback.php (added)
-
tags/3.7.0/admin/bgr-admin.php (added)
-
tags/3.7.0/admin/bgr-welcome-page.php (added)
-
tags/3.7.0/admin/review-admin-options-page.php (added)
-
tags/3.7.0/admin/wbcom (added)
-
tags/3.7.0/admin/wbcom/assets (added)
-
tags/3.7.0/admin/wbcom/assets/css (added)
-
tags/3.7.0/admin/wbcom/assets/css/min (added)
-
tags/3.7.0/admin/wbcom/assets/css/min/wbcom-admin-setting.min.css (added)
-
tags/3.7.0/admin/wbcom/assets/css/rtl (added)
-
tags/3.7.0/admin/wbcom/assets/css/rtl/wbcom-admin-setting.rtl.css (added)
-
tags/3.7.0/admin/wbcom/assets/css/rtl/wbcom-admin-setting.rtl.css.map (added)
-
tags/3.7.0/admin/wbcom/assets/css/wbcom-admin-setting.css (added)
-
tags/3.7.0/admin/wbcom/assets/imgs (added)
-
tags/3.7.0/admin/wbcom/assets/imgs/bgr.png (added)
-
tags/3.7.0/admin/wbcom/assets/js (added)
-
tags/3.7.0/admin/wbcom/assets/js/min (added)
-
tags/3.7.0/admin/wbcom/assets/js/min/wbcom-admin-setting.min.js (added)
-
tags/3.7.0/admin/wbcom/templates (added)
-
tags/3.7.0/admin/wbcom/templates/wbcom-license-page.php (added)
-
tags/3.7.0/admin/wbcom/templates/wbcom-plugins-page.php (added)
-
tags/3.7.0/admin/wbcom/templates/wbcom-support-page.php (added)
-
tags/3.7.0/admin/wbcom/wbcom-admin-settings.php (added)
-
tags/3.7.0/assets (added)
-
tags/3.7.0/assets/css (added)
-
tags/3.7.0/assets/css/bgr-front.css (added)
-
tags/3.7.0/assets/css/bgr-group-criteria-admin.css (added)
-
tags/3.7.0/assets/css/bgr-icons.css (added)
-
tags/3.7.0/assets/css/bgr-ratings.css (added)
-
tags/3.7.0/assets/css/bgr-reviews.css (added)
-
tags/3.7.0/assets/css/min (added)
-
tags/3.7.0/assets/css/min/bgr-front.min.css (added)
-
tags/3.7.0/assets/css/min/bgr-group-criteria-admin.min.css (added)
-
tags/3.7.0/assets/css/min/bgr-icons.min.css (added)
-
tags/3.7.0/assets/css/min/bgr-ratings.min.css (added)
-
tags/3.7.0/assets/css/min/bgr-reviews.min.css (added)
-
tags/3.7.0/assets/css/rtl (added)
-
tags/3.7.0/assets/css/rtl/bgr-front.rtl.css (added)
-
tags/3.7.0/assets/css/rtl/bgr-front.rtl.css.map (added)
-
tags/3.7.0/assets/css/rtl/bgr-group-criteria-admin.rtl.css (added)
-
tags/3.7.0/assets/css/rtl/bgr-group-criteria-admin.rtl.css.map (added)
-
tags/3.7.0/assets/css/rtl/bgr-icons.rtl.css (added)
-
tags/3.7.0/assets/css/rtl/bgr-icons.rtl.css.map (added)
-
tags/3.7.0/assets/css/rtl/bgr-ratings.rtl.css (added)
-
tags/3.7.0/assets/css/rtl/bgr-ratings.rtl.css.map (added)
-
tags/3.7.0/assets/css/rtl/bgr-reviews.rtl.css (added)
-
tags/3.7.0/assets/css/rtl/bgr-reviews.rtl.css.map (added)
-
tags/3.7.0/assets/images (added)
-
tags/3.7.0/assets/images/sort_asc.png (added)
-
tags/3.7.0/assets/images/sort_asc_disabled.png (added)
-
tags/3.7.0/assets/images/sort_both.png (added)
-
tags/3.7.0/assets/images/sort_desc.png (added)
-
tags/3.7.0/assets/images/sort_desc_disabled.png (added)
-
tags/3.7.0/assets/images/star.png (added)
-
tags/3.7.0/assets/images/star_half.png (added)
-
tags/3.7.0/assets/images/star_off.png (added)
-
tags/3.7.0/assets/js (added)
-
tags/3.7.0/assets/js/min (added)
-
tags/3.7.0/assets/js/min/bgr-accessibility.min.js (added)
-
tags/3.7.0/assets/js/min/bgr-front.min.js (added)
-
tags/3.7.0/assets/js/min/bgr-group-criteria-admin.min.js (added)
-
tags/3.7.0/assets/js/min/bgr-ratings.min.js (added)
-
tags/3.7.0/includes (added)
-
tags/3.7.0/includes/bgr-activity.php (added)
-
tags/3.7.0/includes/bgr-ajax.php (added)
-
tags/3.7.0/includes/bgr-bp-rest-integration.php (added)
-
tags/3.7.0/includes/bgr-dynamic-css.php (added)
-
tags/3.7.0/includes/bgr-filters.php (added)
-
tags/3.7.0/includes/bgr-functions.php (added)
-
tags/3.7.0/includes/bgr-globals.php (added)
-
tags/3.7.0/includes/bgr-group-criteria-ajax.php (added)
-
tags/3.7.0/includes/bgr-group-criteria-functions.php (added)
-
tags/3.7.0/includes/bgr-grp-extn.php (added)
-
tags/3.7.0/includes/bgr-notifications.php (added)
-
tags/3.7.0/includes/bgr-rating-display.php (added)
-
tags/3.7.0/includes/bgr-schema.php (added)
-
tags/3.7.0/includes/bgr-scripts.php (added)
-
tags/3.7.0/includes/bgr-shortcodes.php (added)
-
tags/3.7.0/includes/class-bgr-group-criteria.php (added)
-
tags/3.7.0/includes/class-bgr-multi-support.php (added)
-
tags/3.7.0/includes/templates (added)
-
tags/3.7.0/includes/templates/bgr-group-criteria-settings.php (added)
-
tags/3.7.0/includes/templates/bgr-reviews-tab-template.php (added)
-
tags/3.7.0/includes/templates/bgr-single-review-template.php (added)
-
tags/3.7.0/includes/widgets (added)
-
tags/3.7.0/includes/widgets/bgr-review.php (added)
-
tags/3.7.0/includes/widgets/group-rating.php (added)
-
tags/3.7.0/index.php (added)
-
tags/3.7.0/languages (added)
-
tags/3.7.0/languages/bp-group-reviews-fr_FR.mo (added)
-
tags/3.7.0/languages/bp-group-reviews-fr_FR.po (added)
-
tags/3.7.0/languages/bp-group-reviews.pot (added)
-
tags/3.7.0/license.txt (added)
-
tags/3.7.0/readme.txt (added)
-
tags/3.7.0/review-bp-grps.php (added)
-
tags/3.7.0/screenshot-1.png (added)
-
tags/3.7.0/screenshot-2.png (added)
-
tags/3.7.0/screenshot-3.png (added)
-
tags/3.7.0/screenshot-4.png (added)
-
tags/3.7.0/screenshot-5.png (added)
-
tags/3.7.0/screenshot-6.png (added)
-
tags/3.7.0/screenshot-7.png (added)
-
tags/3.7.0/screenshot-8.png (added)
-
tags/3.7.0/uninstall.php (added)
-
tags/3.7.0/wpml-config.xml (added)
-
trunk/admin/assets/js/min/bgr-admin.min.js (modified) (1 diff)
-
trunk/admin/review-admin-options-page.php (modified) (1 diff)
-
trunk/assets/css/bgr-group-criteria-admin.css (added)
-
trunk/assets/css/min/bgr-group-criteria-admin.min.css (added)
-
trunk/assets/css/rtl/bgr-group-criteria-admin.rtl.css (added)
-
trunk/assets/css/rtl/bgr-group-criteria-admin.rtl.css.map (added)
-
trunk/assets/js/min/bgr-front.min.js (modified) (1 diff)
-
trunk/assets/js/min/bgr-group-criteria-admin.min.js (added)
-
trunk/assets/js/min/bgr-ratings.min.js (modified) (1 diff)
-
trunk/includes/bgr-ajax.php (modified) (5 diffs)
-
trunk/includes/bgr-bp-rest-integration.php (modified) (2 diffs)
-
trunk/includes/bgr-filters.php (modified) (5 diffs)
-
trunk/includes/bgr-globals.php (modified) (2 diffs)
-
trunk/includes/bgr-group-criteria-ajax.php (added)
-
trunk/includes/bgr-group-criteria-functions.php (added)
-
trunk/includes/bgr-grp-extn.php (modified) (4 diffs)
-
trunk/includes/bgr-rating-display.php (modified) (1 diff)
-
trunk/includes/bgr-scripts.php (modified) (1 diff)
-
trunk/includes/bgr-shortcodes.php (modified) (7 diffs)
-
trunk/includes/class-bgr-group-criteria.php (added)
-
trunk/includes/templates/bgr-group-criteria-settings.php (added)
-
trunk/includes/templates/bgr-single-review-template.php (modified) (3 diffs)
-
trunk/languages/bp-group-reviews.pot (modified) (32 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/review-bp-grps.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
review-buddypress-groups/trunk/admin/assets/js/min/bgr-admin.min.js
r3430846 r3431049 1 function BGRGetBGRDynamicTextBox(value){return'<span class="move-icons">≡</span><input name="BGRDynamicTextBox" class="draggable" type="text" value="'+value+'" /><input type="button" value="Remove" class="remove button button-secondary bgr-remove" /><label class="wb-switch"><input type="checkbox" class="bgr-criteria-state" name="bgr-criteria-state" data-attr="" checked="checked" ><div class="wb-slider wb-round"></div></label>'}jQuery.noConflict(),jQuery(document).ready(function(){jQuery("#bgr-settings-updated").hide(),jQuery(document).on("click",".notice-dismiss",function(){jQuery(this).closest(".notice").fadeOut()}),jQuery("#bgr-exclude-group-review").selectize({placeholder:"Select groups",plugins:["remove_button"]}),jQuery(document).on("click","#bgr-save-admin-criteria-settings",function(){jQuery(this).addClass("bgr-btn-ajax"),jQuery(".bgr-admin-criteria-settings-spinner").show();var field_values=[],criteria=[];jQuery("input[name=BGRDynamicTextBox]").each(function(){var criteria_val;""!=jQuery(this).val().trim()&&(criteria_val=jQuery(this).val(),field_values.push(criteria_val),jQuery(this).siblings(".wb-switch").children(".bgr-criteria-state").attr("data-attr",criteria_val))}),jQuery(".bgr-criteria-state").each(function(){var criteriaAttr;""!=jQuery(this).val().trim()&&jQuery(this).is(":checked")&&(criteriaAttr=jQuery(this).attr("data-attr"),criteria.push(criteriaAttr))}),jQuery.post(ajaxurl,{action:"bp_group_review_save_admin_criteria_settings",nonce:bgr_admin_js.wbcom_nonce,field_values:field_values,active_criterias:criteria},function(response){"admin-criteria-settings-saved"===response&&(location.reload(),jQuery("#bgr-settings-updated").show(),jQuery("#bgr-save-admin-criteria-settings").removeClass("bgr-btn-ajax"),jQuery(".bgr-admin-criteria-settings-spinner").hide())})}),jQuery(document).on("click","#bgr-save-admin-general-settings",function(){jQuery(this).addClass("bgr-btn-ajax"),jQuery(".bgr-admin-general-settings-spinner").show();var exclude_groups=jQuery("#bgr-exclude-group-review").val(),bgr_multi_reviews=jQuery("#bgr-multi-reviews").is(":checked")?"yes":"no",bgr_auto_approve_reviews=jQuery("#bgr-auto-approve-reviews").is(":checked")?"yes":"no",reviews_per_page=jQuery("#reviews_per_page").val(),bgr_allow_notification=jQuery("#bgr-notification").is(":checked")?"yes":"no",bgr_allow_activity=jQuery("#bgr-activity").is(":checked")?"yes":"no" ;jQuery.post(ajaxurl,{action:"bp_group_review_save_admin_general_settings",nonce:bgr_admin_js.wbcom_nonce,multi_reviews:bgr_multi_reviews,bgr_auto_approve_reviews:bgr_auto_approve_reviews,reviews_per_page:reviews_per_page,allow_notification:bgr_allow_notification,allow_activity:bgr_allow_activity,exclude_groups:exclude_groups},function(response){"admin-general-settings-saved"===response&&(jQuery("#bgr-settings-updated").show(),jQuery("#bgr-save-admin-general-settings").removeClass("bgr-btn-ajax"),jQuery(".bgr-admin-general-settings-spinner").hide())})}),jQuery(document).on("click","#bgr-save-admin-display-settings",function(){jQuery(this).addClass("bgr-btn-ajax"),jQuery(".bgr-admin-display-settings-spinner").show();var review_label=jQuery("#bgrReviewLabel").val(),manage_review_label=jQuery("#bgrManageReviewLabel").val(),bgr_rating_color=jQuery("#bgr-rating-color").val();jQuery.post(ajaxurl,{action:"bp_group_review_save_admin_display_settings",nonce:bgr_admin_js.wbcom_nonce,review_label:review_label,manage_review_label:manage_review_label,bgr_rating_color:bgr_rating_color},function(response){"admin-display-settings-saved"===response&&(jQuery("#bgr-settings-updated").show(),jQuery("#bgr-save-admin-display-settings").removeClass("bgr-btn-ajax"),jQuery(".bgr-admin-display-settings-spinner").hide())})}),jQuery("#bgr-field-add").bind("click",function(){var div=jQuery("<div class='rating-review-div' />");div.html(BGRGetBGRDynamicTextBox("")),jQuery("#bgr-textbox-container").append(div).addClass("ui-sortable-handle")}),jQuery("body").on("click",".remove",function(){jQuery(this).closest("div").remove()}),jQuery(document).on("click",".bgr-faq-accordion",function(){"block"===jQuery(this).next().css("display")?(jQuery(".bgr-faq-panel").slideUp(500),jQuery(".bgr-faq-accordion").removeClass("bgr-faq-accordion-active")):(jQuery(".bgr-faq-panel").hide(),jQuery(".bgr-faq-accordion").removeClass("bgr-faq-accordion-active"),jQuery(this).next().slideDown(500),jQuery(this).addClass("bgr-faq-accordion-active"))}),jQuery("#bgr-textbox-container").sortable(),jQuery("#bgr-textbox-container").disableSelection();for(var acc=document.getElementsByClassName("bgr-accordion"),i=0;i<acc.length;i++)acc[i].onclick=function(){this.classList.toggle("active");var panel=this.nextElementSibling;panel.style.maxHeight?panel.style.maxHeight=null:panel.style.maxHeight=panel.scrollHeight+"px"};jQuery(document).on("click",".bgr-accordion",function(){return!1}),jQuery(document).on("change","#bgr-email",function(){1==jQuery(this).prop("checked")?jQuery(".review-email-section").show():jQuery(".review-email-section").hide()}),jQuery(document).on("click",".bgr-approve-review",function(){var review_id=jQuery(this).data("rid");jQuery(this).html("Approving.."),jQuery.post(ajaxurl,{action:"bp_group_review_admin_approve_review",review_id:review_id,nonce:bgr_admin_js.wbcom_nonce},function(response){"review-approved-successfully"===response&&(window.location.href=window.location.href)})}),jQuery(document).on("click",".bgr-deny-review",function(){var review_id=jQuery(this).data("rid");confirm("Are you sure you want to deny this review? It will be moved to trash.")&&(jQuery(this).html("Denying.."),jQuery.post(ajaxurl,{action:"bp_group_review_admin_deny_review",review_id:review_id,nonce:bgr_admin_js.wbcom_nonce},function(response){"review-denied-successfully"===response&&(window.location.href=window.location.href)}))})});1 function BGRGetBGRDynamicTextBox(value){return'<span class="move-icons">≡</span><input name="BGRDynamicTextBox" class="draggable" type="text" value="'+value+'" /><input type="button" value="Remove" class="remove button button-secondary bgr-remove" /><label class="wb-switch"><input type="checkbox" class="bgr-criteria-state" name="bgr-criteria-state" data-attr="" checked="checked" ><div class="wb-slider wb-round"></div></label>'}jQuery.noConflict(),jQuery(document).ready(function(){jQuery("#bgr-settings-updated").hide(),jQuery(document).on("click",".notice-dismiss",function(){jQuery(this).closest(".notice").fadeOut()}),jQuery("#bgr-exclude-group-review").selectize({placeholder:"Select groups",plugins:["remove_button"]}),jQuery(document).on("click","#bgr-save-admin-criteria-settings",function(){jQuery(this).addClass("bgr-btn-ajax"),jQuery(".bgr-admin-criteria-settings-spinner").show();var field_values=[],criteria=[];jQuery("input[name=BGRDynamicTextBox]").each(function(){var criteria_val;""!=jQuery(this).val().trim()&&(criteria_val=jQuery(this).val(),field_values.push(criteria_val),jQuery(this).siblings(".wb-switch").children(".bgr-criteria-state").attr("data-attr",criteria_val))}),jQuery(".bgr-criteria-state").each(function(){var criteriaAttr;""!=jQuery(this).val().trim()&&jQuery(this).is(":checked")&&(criteriaAttr=jQuery(this).attr("data-attr"),criteria.push(criteriaAttr))}),jQuery.post(ajaxurl,{action:"bp_group_review_save_admin_criteria_settings",nonce:bgr_admin_js.wbcom_nonce,field_values:field_values,active_criterias:criteria},function(response){"admin-criteria-settings-saved"===response&&(location.reload(),jQuery("#bgr-settings-updated").show(),jQuery("#bgr-save-admin-criteria-settings").removeClass("bgr-btn-ajax"),jQuery(".bgr-admin-criteria-settings-spinner").hide())})}),jQuery(document).on("click","#bgr-save-admin-general-settings",function(){jQuery(this).addClass("bgr-btn-ajax"),jQuery(".bgr-admin-general-settings-spinner").show();var exclude_groups=jQuery("#bgr-exclude-group-review").val(),bgr_multi_reviews=jQuery("#bgr-multi-reviews").is(":checked")?"yes":"no",bgr_auto_approve_reviews=jQuery("#bgr-auto-approve-reviews").is(":checked")?"yes":"no",reviews_per_page=jQuery("#reviews_per_page").val(),bgr_allow_notification=jQuery("#bgr-notification").is(":checked")?"yes":"no",bgr_allow_activity=jQuery("#bgr-activity").is(":checked")?"yes":"no",bgr_enable_group_criteria=jQuery("#bgr-enable-group-criteria").is(":checked")?"yes":"no";jQuery.post(ajaxurl,{action:"bp_group_review_save_admin_general_settings",nonce:bgr_admin_js.wbcom_nonce,multi_reviews:bgr_multi_reviews,bgr_auto_approve_reviews:bgr_auto_approve_reviews,reviews_per_page:reviews_per_page,allow_notification:bgr_allow_notification,allow_activity:bgr_allow_activity,exclude_groups:exclude_groups,enable_group_criteria:bgr_enable_group_criteria},function(response){"admin-general-settings-saved"===response&&(jQuery("#bgr-settings-updated").show(),jQuery("#bgr-save-admin-general-settings").removeClass("bgr-btn-ajax"),jQuery(".bgr-admin-general-settings-spinner").hide())})}),jQuery(document).on("click","#bgr-save-admin-display-settings",function(){jQuery(this).addClass("bgr-btn-ajax"),jQuery(".bgr-admin-display-settings-spinner").show();var review_label=jQuery("#bgrReviewLabel").val(),manage_review_label=jQuery("#bgrManageReviewLabel").val(),bgr_rating_color=jQuery("#bgr-rating-color").val();jQuery.post(ajaxurl,{action:"bp_group_review_save_admin_display_settings",nonce:bgr_admin_js.wbcom_nonce,review_label:review_label,manage_review_label:manage_review_label,bgr_rating_color:bgr_rating_color},function(response){"admin-display-settings-saved"===response&&(jQuery("#bgr-settings-updated").show(),jQuery("#bgr-save-admin-display-settings").removeClass("bgr-btn-ajax"),jQuery(".bgr-admin-display-settings-spinner").hide())})}),jQuery("#bgr-field-add").bind("click",function(){var div=jQuery("<div class='rating-review-div' />");div.html(BGRGetBGRDynamicTextBox("")),jQuery("#bgr-textbox-container").append(div).addClass("ui-sortable-handle")}),jQuery("body").on("click",".remove",function(){jQuery(this).closest("div").remove()}),jQuery(document).on("click",".bgr-faq-accordion",function(){"block"===jQuery(this).next().css("display")?(jQuery(".bgr-faq-panel").slideUp(500),jQuery(".bgr-faq-accordion").removeClass("bgr-faq-accordion-active")):(jQuery(".bgr-faq-panel").hide(),jQuery(".bgr-faq-accordion").removeClass("bgr-faq-accordion-active"),jQuery(this).next().slideDown(500),jQuery(this).addClass("bgr-faq-accordion-active"))}),jQuery("#bgr-textbox-container").sortable(),jQuery("#bgr-textbox-container").disableSelection();for(var acc=document.getElementsByClassName("bgr-accordion"),i=0;i<acc.length;i++)acc[i].onclick=function(){this.classList.toggle("active");var panel=this.nextElementSibling;panel.style.maxHeight?panel.style.maxHeight=null:panel.style.maxHeight=panel.scrollHeight+"px"};jQuery(document).on("click",".bgr-accordion",function(){return!1}),jQuery(document).on("change","#bgr-email",function(){1==jQuery(this).prop("checked")?jQuery(".review-email-section").show():jQuery(".review-email-section").hide()}),jQuery(document).on("click",".bgr-approve-review",function(){var review_id=jQuery(this).data("rid");jQuery(this).html("Approving.."),jQuery.post(ajaxurl,{action:"bp_group_review_admin_approve_review",review_id:review_id,nonce:bgr_admin_js.wbcom_nonce},function(response){"review-approved-successfully"===response&&(window.location.href=window.location.href)})}),jQuery(document).on("click",".bgr-deny-review",function(){var review_id=jQuery(this).data("rid");confirm("Are you sure you want to deny this review? It will be moved to trash.")&&(jQuery(this).html("Denying.."),jQuery.post(ajaxurl,{action:"bp_group_review_admin_deny_review",review_id:review_id,nonce:bgr_admin_js.wbcom_nonce},function(response){"review-denied-successfully"===response&&(window.location.href=window.location.href)}))})}); -
review-buddypress-groups/trunk/admin/review-admin-options-page.php
r3430846 r3431049 300 300 </label> 301 301 <?php } ?> 302 </div> 303 </div> 304 <div class="bgr-row wbcom-settings-section-wrap"> 305 <div class="wbcom-settings-section-options-heading"> 306 <label><?php esc_html_e( 'Enable Group-Level Criteria', 'bp-group-reviews' ); ?></label> 307 <p class="description"><?php esc_html_e( 'Allow group admins to customize review criteria for their specific groups.', 'bp-group-reviews' ); ?></p> 308 </div> 309 <div class="wbcom-settings-section-options"> 310 <label class="wb-switch" for="bgr-enable-group-criteria"> 311 <input type="checkbox" id="bgr-enable-group-criteria" 312 <?php 313 $enable_group_criteria = isset( $bgr['enable_group_criteria'] ) ? $bgr['enable_group_criteria'] : 'no'; 314 if ( 'yes' === $enable_group_criteria ) { 315 echo 'checked="checked"'; } 316 ?> 317 > 318 <div class="wb-slider wb-round"></div> 319 </label> 302 320 </div> 303 321 </div> -
review-buddypress-groups/trunk/assets/js/min/bgr-front.min.js
r3430846 r3431049 1 jQuery(document).ready(function(e){jQuery("#manage-"+bgr_front_js_object.review_label).addClass("manage-review");var review_label=bgr_front_js_object.review_label;"yes"==bgr_front_js_object.check_group_admin&&"yes"!=bgr_front_js_object.auto_approve_reviews||jQuery("#"+review_label+"-management").hide(),"true"==bgr_front_js_object.exclude_groups&&(jQuery("#nav-add-feedback").hide(),jQuery("#nav-add-"+review_label+"-groups-li").hide(),jQuery("#nav-manage-"+review_label+"-groups-li").hide(),jQuery("#manage-"+review_label).parent().hide()),jQuery("#bgr_review_success_msg_modal").hide(),jQuery("#request-review-list #bp-group-edit-add-review-submit").hide(),jQuery(document).on("click","#add-review",function(){jQuery("#bgr-add-review-modal").css("display","block")}),jQuery(document).on("click","#groupbutton-85 a",function(e){var show_content=jQuery(this).attr("show");localStorage.setItem("bgr_show_form",show_content)}),jQuery(document).on("click","#add-review-no-popup",function(){jQuery(".bgr-group-review-no-popup-add-block").slideToggle()}),jQuery(document).on("click",".accept-button",function(){var accept_review_id=jQuery(this).next().val(),accept_gid=jQuery(this).attr("data-group-type");jQuery.post(ajaxurl,{action:"bp_group_review_accept_review",nonce:bgr_front_js_object.wbcom_nonce,accept_review_id:accept_review_id,group_id:accept_gid},function(response){location.reload()})}),jQuery(document).on("click",".deny-button",function(){var deny_review_id=jQuery(this).next().val(),deny_gid=jQuery(this).attr("data-group-type");jQuery.post(ajaxurl,{action:"bp_group_review_deny_review",nonce:bgr_front_js_object.wbcom_nonce,deny_review_id:deny_review_id,group_id:deny_gid},function(response){location.reload()})}),jQuery(document).on("click",".remove-review-button",function(){var remove_review_id=jQuery(this).next().val();jQuery.post(ajaxurl,{action:"bp_group_remove_review",nonce:bgr_front_js_object.wbcom_nonce,remove_review_id:remove_review_id},function(response){location.reload()})}),jQuery("#form-group-id").on("change",function(){jQuery(this).siblings(".bgr-error-fields").hide()}),jQuery('textarea[name*= "review-desc"]').on("keydown",function(){jQuery(this).siblings(".bgr-error-fields").hide()}),jQuery(".bgr-stars").on("click",function(){jQuery(this).parent().next(".bgr-error-fields").hide()}),jQuery(document).on("click",".expand-review-des",function(){"block"===jQuery(this).parent().children(".review-full-description").css("display")?(jQuery(".review-full-description").slideUp(500),jQuery(this).parent().children(".review-excerpt").slideDown(500),jQuery(this).text(bgr_front_js_object.view_more_text)):(jQuery(".review-full-description").hide(),jQuery(".review-excerpt").show(),jQuery(".review-full-description").next().text("View More.."),jQuery(this).parent().children(".review-excerpt").slideUp(500),jQuery(this).parent().children(".review-full-description").slideDown(500),jQuery(this).text(bgr_front_js_object.view_less_text))}),jQuery("#bgr-add-review-form"). submit(function(e){e.preventDefault();var rating_exist=[],e=jQuery("#form-group-id",this).val(),bgr_review_desc=jQuery('textarea[name*= "review-desc"]',this).val(),rating_field_counter=jQuery(this).children().find("#rating_field_counter").val();jQuery(".bgr_mrating",this).each(function(){var rate_val=jQuery(this).val();0<rate_val?0:jQuery(this).parent().next(".bgr-error-fields").show(),rating_exist.push(rate_val)}),0<rating_field_counter?""==e?jQuery("#form-group-id",this).siblings(".bgr-error-fields").show():-1==jQuery.inArray("0",rating_exist)&&jQuery.post(ajaxurl,{action:"bp_group_submit_review",nonce:bgr_front_js_object.wbcom_nonce,data:jQuery(this).serialize()},function(response){jQuery(".bgr-bp-success p").html(response).css("display","block"),jQuery(".bgr-bp-success").fadeIn(),jQuery(".bgr-group-review-no-popup-add-block").hide(),jQuery("#bgr-add-review-modal").hide(),jQuery("#bgr-message").html(response),jQuery("#bgr-message").css("display","block");var date=new Date;date.setTime(date.getTime()+2e4),jQuery.cookie("res_content",response,{expires:date})}):""==e||""==bgr_review_desc?(""==e&&jQuery("#form-group-id",this).siblings(".bgr-error-fields ").show(),""==bgr_review_desc&&jQuery('textarea[name*= "review-desc"]',this).siblings(".bgr-error-fields ").show()):jQuery.post(ajaxurl,{action:"bp_group_submit_review",nonce:bgr_front_js_object.wbcom_nonce,data:jQuery(this).serialize()},function(response){jQuery(".bgr-bp-success p").html(response).css("display","block"),jQuery(".bgr-bp-success").fadeIn(),jQuery(".bgr-group-review-no-popup-add-block").hide(),jQuery("#bgr-add-review-modal").hide(),jQuery("#bgr-message").html(response),jQuery("#bgr-message").css("display","block");var date=new Date;date.setTime(date.getTime()+2e4),jQuery.cookie("res_content",response,{expires:date})})}),jQuery(document).on("click","#bp-group-rating-list-options > a",function(event){event.preventDefault();var jQ=jQuery(this),event=(jQ.siblings("a").removeClass("selected"),jQ.attr("attr-val")),limit=jQ.parent().siblings(".group-rating-limit").val();jQuery.post(ajaxurl,{action:"bp_group_review_filter_ratings",nonce:bgr_front_js_object.wbcom_nonce,filter:event,limit:limit,group_id:bgr_front_js_object.group_id},function(response){response=JSON.parse(response);jQ.addClass("selected"),jQ.parent().siblings("#bp-group-rating").html(response.html)})})}),jQuery(function(){jQuery.cookie("res_content")&&(jQuery(".error").hide(),jQuery.cookie("res_content","",-1))}),jQuery(function(){var show_last_form=localStorage.getItem("bgr_show_form");null!=show_last_form&&"form"==show_last_form&&(jQuery(".bgr-group-review-no-popup-add-block").show(),localStorage.setItem("bgr_show_form",null))});1 jQuery(document).ready(function(e){jQuery("#manage-"+bgr_front_js_object.review_label).addClass("manage-review");var review_label=bgr_front_js_object.review_label;"yes"==bgr_front_js_object.check_group_admin&&"yes"!=bgr_front_js_object.auto_approve_reviews||jQuery("#"+review_label+"-management").hide(),"true"==bgr_front_js_object.exclude_groups&&(jQuery("#nav-add-feedback").hide(),jQuery("#nav-add-"+review_label+"-groups-li").hide(),jQuery("#nav-manage-"+review_label+"-groups-li").hide(),jQuery("#manage-"+review_label).parent().hide()),jQuery("#bgr_review_success_msg_modal").hide(),jQuery("#request-review-list #bp-group-edit-add-review-submit").hide(),jQuery(document).on("click","#add-review",function(){jQuery("#bgr-add-review-modal").css("display","block")}),jQuery(document).on("click","#groupbutton-85 a",function(e){var show_content=jQuery(this).attr("show");localStorage.setItem("bgr_show_form",show_content)}),jQuery(document).on("click","#add-review-no-popup",function(){jQuery(".bgr-group-review-no-popup-add-block").slideToggle()}),jQuery(document).on("click",".accept-button",function(){var accept_review_id=jQuery(this).next().val(),accept_gid=jQuery(this).attr("data-group-type");jQuery.post(ajaxurl,{action:"bp_group_review_accept_review",nonce:bgr_front_js_object.wbcom_nonce,accept_review_id:accept_review_id,group_id:accept_gid},function(response){location.reload()})}),jQuery(document).on("click",".deny-button",function(){var deny_review_id=jQuery(this).next().val(),deny_gid=jQuery(this).attr("data-group-type");jQuery.post(ajaxurl,{action:"bp_group_review_deny_review",nonce:bgr_front_js_object.wbcom_nonce,deny_review_id:deny_review_id,group_id:deny_gid},function(response){location.reload()})}),jQuery(document).on("click",".remove-review-button",function(){var remove_review_id=jQuery(this).next().val();jQuery.post(ajaxurl,{action:"bp_group_remove_review",nonce:bgr_front_js_object.wbcom_nonce,remove_review_id:remove_review_id},function(response){location.reload()})}),jQuery("#form-group-id").on("change",function(){jQuery(this).siblings(".bgr-error-fields").hide()}),jQuery('textarea[name*= "review-desc"]').on("keydown",function(){jQuery(this).siblings(".bgr-error-fields").hide()}),jQuery(".bgr-stars").on("click",function(){jQuery(this).parent().next(".bgr-error-fields").hide()}),jQuery(document).on("click",".expand-review-des",function(){"block"===jQuery(this).parent().children(".review-full-description").css("display")?(jQuery(".review-full-description").slideUp(500),jQuery(this).parent().children(".review-excerpt").slideDown(500),jQuery(this).text(bgr_front_js_object.view_more_text)):(jQuery(".review-full-description").hide(),jQuery(".review-excerpt").show(),jQuery(".review-full-description").next().text("View More.."),jQuery(this).parent().children(".review-excerpt").slideUp(500),jQuery(this).parent().children(".review-full-description").slideDown(500),jQuery(this).text(bgr_front_js_object.view_less_text))}),jQuery("#bgr-add-review-form").on("submit",function(e){e.preventDefault();var rating_exist=[],e=jQuery("#form-group-id",this).val(),bgr_review_desc=jQuery('textarea[name*= "review-desc"]',this).val(),rating_field_counter=jQuery(this).children().find("#rating_field_counter").val();jQuery(".bgr_mrating",this).each(function(){var rate_val=jQuery(this).val();0<rate_val?0:jQuery(this).parent().next(".bgr-error-fields").show(),rating_exist.push(rate_val)}),0<rating_field_counter?""==e?jQuery("#form-group-id",this).siblings(".bgr-error-fields").show():-1==jQuery.inArray("0",rating_exist)&&jQuery.post(ajaxurl,{action:"bp_group_submit_review",nonce:bgr_front_js_object.wbcom_nonce,data:jQuery(this).serialize()},function(response){jQuery(".bgr-bp-success p").html(response).css("display","block"),jQuery(".bgr-bp-success").fadeIn(),jQuery(".bgr-group-review-no-popup-add-block").hide(),jQuery("#bgr-add-review-modal").hide(),jQuery("#bgr-message").html(response),jQuery("#bgr-message").css("display","block");var date=new Date;date.setTime(date.getTime()+2e4),jQuery.cookie("res_content",response,{expires:date})}):""==e||""==bgr_review_desc?(""==e&&jQuery("#form-group-id",this).siblings(".bgr-error-fields ").show(),""==bgr_review_desc&&jQuery('textarea[name*= "review-desc"]',this).siblings(".bgr-error-fields ").show()):jQuery.post(ajaxurl,{action:"bp_group_submit_review",nonce:bgr_front_js_object.wbcom_nonce,data:jQuery(this).serialize()},function(response){jQuery(".bgr-bp-success p").html(response).css("display","block"),jQuery(".bgr-bp-success").fadeIn(),jQuery(".bgr-group-review-no-popup-add-block").hide(),jQuery("#bgr-add-review-modal").hide(),jQuery("#bgr-message").html(response),jQuery("#bgr-message").css("display","block");var date=new Date;date.setTime(date.getTime()+2e4),jQuery.cookie("res_content",response,{expires:date})})}),jQuery(document).on("click","#bp-group-rating-list-options > a",function(event){event.preventDefault();var jQ=jQuery(this),event=(jQ.siblings("a").removeClass("selected"),jQ.attr("attr-val")),limit=jQ.parent().siblings(".group-rating-limit").val();jQuery.post(ajaxurl,{action:"bp_group_review_filter_ratings",nonce:bgr_front_js_object.wbcom_nonce,filter:event,limit:limit,group_id:bgr_front_js_object.group_id},function(response){response=JSON.parse(response);jQ.addClass("selected"),jQ.parent().siblings("#bp-group-rating").html(response.html)})})}),jQuery(function(){jQuery.cookie("res_content")&&(jQuery(".error").hide(),jQuery.cookie("res_content","",-1))}),jQuery(function(){var show_last_form=localStorage.getItem("bgr_show_form");null!=show_last_form&&"form"==show_last_form&&(jQuery(".bgr-group-review-no-popup-add-block").show(),localStorage.setItem("bgr_show_form",null))}); -
review-buddypress-groups/trunk/assets/js/min/bgr-ratings.min.js
r3250032 r3431049 1 jQuery(document).ready(function(){reviews_pluginurl=jQuery("#reviews_pluginurl").val(),bgrRatingColor=jQuery("#bgr-rate-color").val(),jQuery(".bgr-stars"). mouseenter(function(){jQuery(this).parent().children().eq(0).val("not_clicked");var id=jQuery(this).attr("data-attr"),parent_id=jQuery(this).parent().attr("id");for(i=1;i<=id;i++)jQuery("#"+parent_id).children("."+i).addClass("fas").removeClass("far")}),jQuery(".bgr-stars").mouseleave(function(){var clicked_id=jQuery(this).parent().children().eq(1).val(),parent_id=(jQuery(this).attr("data-attr"),jQuery(this).parent().attr("id"));if("clicked"!==jQuery(this).parent().children().eq(0).val()){clicked_id=parseInt(clicked_id)+1;for(i=clicked_id;i<=5;i++)jQuery("#"+parent_id).children("."+i).addClass("far").removeClass("fas")}}),jQuery(".bgr-stars").on("click",function(){attr=jQuery(this).attr("data-attr"),clicked_id=attr;var parent_id=jQuery(this).parent().attr("id");for(jQuery(this).parent().children().eq(1).val(attr),jQuery(this).parent().children().eq(0).val("clicked"),i=1;i<=attr;i++)jQuery("#"+parent_id).children("."+i).addClass("fas").removeClass("far");var k=parseInt(attr)+1;for(j=k;j<=5;j++)jQuery("#"+parent_id).children("."+j).addClass("far").removeClass("fas")})});1 jQuery(document).ready(function(){reviews_pluginurl=jQuery("#reviews_pluginurl").val(),bgrRatingColor=jQuery("#bgr-rate-color").val(),jQuery(".bgr-stars").on("mouseenter",function(){jQuery(this).parent().children().eq(0).val("not_clicked");var id=jQuery(this).attr("data-attr"),parent_id=jQuery(this).parent().attr("id");for(i=1;i<=id;i++)jQuery("#"+parent_id).children("."+i).addClass("fas").removeClass("far")}),jQuery(".bgr-stars").on("mouseleave",function(){var clicked_id=jQuery(this).parent().children().eq(1).val(),parent_id=(jQuery(this).attr("data-attr"),jQuery(this).parent().attr("id"));if("clicked"!==jQuery(this).parent().children().eq(0).val()){clicked_id=parseInt(clicked_id)+1;for(i=clicked_id;i<=5;i++)jQuery("#"+parent_id).children("."+i).addClass("far").removeClass("fas")}}),jQuery(".bgr-stars").on("click",function(){attr=jQuery(this).attr("data-attr"),clicked_id=attr;var parent_id=jQuery(this).parent().attr("id");for(jQuery(this).parent().children().eq(1).val(attr),jQuery(this).parent().children().eq(0).val("clicked"),i=1;i<=attr;i++)jQuery("#"+parent_id).children("."+i).addClass("fas").removeClass("far");var k=parseInt(attr)+1;for(j=k;j<=5;j++)jQuery("#"+parent_id).children("."+j).addClass("far").removeClass("fas")})}); -
review-buddypress-groups/trunk/includes/bgr-ajax.php
r3430846 r3431049 274 274 $active_rating_fields_values = array_unique( $active_rating_fields ); 275 275 276 // Get old settings to compare for deleted/archived criteria. 277 $old_settings = get_option( 'bgr_admin_criteria_settings', array() ); 278 $old_all = isset( $old_settings['add_review_rating_fields'] ) ? $old_settings['add_review_rating_fields'] : array(); 279 $old_active = isset( $old_settings['active_rating_fields'] ) ? $old_settings['active_rating_fields'] : array(); 280 276 281 $bgr_admin_settings = array( 277 282 'add_review_rating_fields' => $rating_field_values, … … 280 285 281 286 update_option( 'bgr_admin_criteria_settings', $bgr_admin_settings ); 287 288 // Fire hooks for deleted/archived criteria so groups can sync. 289 $deleted_criteria = array_diff( $old_all, $rating_field_values ); 290 $archived_criteria = array_diff( $old_active, $active_rating_fields_values ); 291 292 foreach ( $deleted_criteria as $deleted ) { 293 /** 294 * Fires when a global criterion is deleted. 295 * 296 * @since 3.7.0 297 * @param string $deleted The deleted criterion name. 298 */ 299 do_action( 'bgr_global_criteria_deleted', $deleted ); 300 } 301 302 foreach ( $archived_criteria as $archived ) { 303 // Only fire if it wasn't deleted (just deactivated). 304 if ( in_array( $archived, $rating_field_values, true ) ) { 305 /** 306 * Fires when a global criterion is archived (deactivated but not deleted). 307 * 308 * @since 3.7.0 309 * @param string $archived The archived criterion name. 310 */ 311 do_action( 'bgr_global_criteria_archived', $archived ); 312 } 313 } 314 282 315 echo 'admin-criteria-settings-saved'; 283 316 die; … … 298 331 } 299 332 if ( isset( $_POST['action'] ) && 'bp_group_review_save_admin_general_settings' === $_POST['action'] && current_user_can( 'manage_options' ) ) { 300 $multi_reviews = isset( $_POST['multi_reviews'] ) ? sanitize_text_field( wp_unslash( $_POST['multi_reviews'] ) ) : ''; 301 $auto_approve_reviews = isset( $_POST['bgr_auto_approve_reviews'] ) ? sanitize_text_field( wp_unslash( $_POST['bgr_auto_approve_reviews'] ) ) : ''; 302 $reviews_per_page = isset( $_POST['reviews_per_page'] ) ? sanitize_text_field( wp_unslash( $_POST['reviews_per_page'] ) ) : ''; 303 $allow_notification = isset( $_POST['allow_notification'] ) ? sanitize_text_field( wp_unslash( $_POST['allow_notification'] ) ) : ''; 304 $allow_activity = isset( $_POST['allow_activity'] ) ? sanitize_text_field( wp_unslash( $_POST['allow_activity'] ) ) : ''; 305 $exclude_groups = isset( $_POST['exclude_groups'] ) ? array_map( 'absint', wp_unslash( $_POST['exclude_groups'] ) ) : array(); 333 $multi_reviews = isset( $_POST['multi_reviews'] ) ? sanitize_text_field( wp_unslash( $_POST['multi_reviews'] ) ) : ''; 334 $auto_approve_reviews = isset( $_POST['bgr_auto_approve_reviews'] ) ? sanitize_text_field( wp_unslash( $_POST['bgr_auto_approve_reviews'] ) ) : ''; 335 $reviews_per_page = isset( $_POST['reviews_per_page'] ) ? sanitize_text_field( wp_unslash( $_POST['reviews_per_page'] ) ) : ''; 336 $allow_notification = isset( $_POST['allow_notification'] ) ? sanitize_text_field( wp_unslash( $_POST['allow_notification'] ) ) : ''; 337 $allow_activity = isset( $_POST['allow_activity'] ) ? sanitize_text_field( wp_unslash( $_POST['allow_activity'] ) ) : ''; 338 $enable_group_criteria = isset( $_POST['enable_group_criteria'] ) ? sanitize_text_field( wp_unslash( $_POST['enable_group_criteria'] ) ) : 'no'; 339 $exclude_groups = isset( $_POST['exclude_groups'] ) ? array_map( 'absint', wp_unslash( $_POST['exclude_groups'] ) ) : array(); 306 340 // Filter out any zero values that may result from invalid input. 307 341 $exclude_groups = array_filter( $exclude_groups ); 308 342 $bgr_admin_settings = array( 309 'multi_reviews' => $multi_reviews, 310 'auto_approve_reviews' => $auto_approve_reviews, 311 'reviews_per_page' => $reviews_per_page, 312 'allow_notification' => $allow_notification, 313 'allow_activity' => $allow_activity, 314 'exclude_groups' => $exclude_groups, 343 'multi_reviews' => $multi_reviews, 344 'auto_approve_reviews' => $auto_approve_reviews, 345 'reviews_per_page' => $reviews_per_page, 346 'allow_notification' => $allow_notification, 347 'allow_activity' => $allow_activity, 348 'enable_group_criteria' => $enable_group_criteria, 349 'exclude_groups' => $exclude_groups, 315 350 ); 316 351 update_option( 'bgr_admin_general_settings', $bgr_admin_settings ); … … 378 413 $form_group_id = isset( $formarray['form-group-id'] ) ? absint( $formarray['form-group-id'] ) : 0; 379 414 380 // Validate required fields.381 if ( empty( $review_desc ) ) {382 wp_send_json_error( new WP_Error( '004', esc_html__( 'Review description is required.', 'bp-group-reviews' ), 'empty_content' ) );383 }384 385 415 // Validate group exists. 386 416 if ( empty( $form_group_id ) ) { … … 418 448 $bgr_allow_email = isset( $bp_group_review_email_settings['bgr_allow_email'] ) ? $bp_group_review_email_settings['bgr_allow_email'] : ''; 419 449 $user_name = $current_user->display_name; 420 $active_rating_fields = $bgr['active_rating_fields']; 421 $allow_notification = $bgr['allow_notification']; 422 $allow_email = $bgr_allow_email; 423 $allow_activity = $bgr['allow_activity']; 424 $review_label = $bgr['review_label']; 425 $auto_approve_reviews = $bgr['auto_approve_reviews']; 426 $multi_reviews = $bgr['multi_reviews']; 450 // Use group-level criteria if available, otherwise fall back to global. 451 $active_rating_fields = function_exists( 'bgr_get_effective_criteria' ) 452 ? bgr_get_effective_criteria( $form_group_id ) 453 : $bgr['active_rating_fields']; 454 $allow_notification = $bgr['allow_notification']; 455 $allow_email = $bgr_allow_email; 456 $allow_activity = $bgr['allow_activity']; 457 $review_label = $bgr['review_label']; 458 $auto_approve_reviews = $bgr['auto_approve_reviews']; 459 $multi_reviews = $bgr['multi_reviews']; 427 460 /* Translators: %1$s: Review Label */ 428 461 $review_email_subject = ( isset( $bgr['review_email_subject'] ) ) ? $bgr['review_email_subject'] : sprintf( esc_html__( 'A new %1$s posted.', 'bp-group-reviews' ), $review_label ); -
review-buddypress-groups/trunk/includes/bgr-bp-rest-integration.php
r3430846 r3431049 486 486 487 487 if ( ! empty( $ratings ) && is_array( $ratings ) ) { 488 update_post_meta( $review_id, 'review_star_rating', $ratings ); 488 $sanitized_ratings = array(); 489 foreach ( $ratings as $key => $value ) { 490 $sanitized_key = sanitize_text_field( $key ); 491 $sanitized_value = min( 5, max( 1, absint( $value ) ) ); 492 $sanitized_ratings[ $sanitized_key ] = $sanitized_value; 493 } 494 update_post_meta( $review_id, 'review_star_rating', $sanitized_ratings ); 489 495 } 490 496 … … 555 561 556 562 if ( ! empty( $ratings ) && is_array( $ratings ) ) { 557 update_post_meta( $review_id, 'review_star_rating', $ratings ); 563 $sanitized_ratings = array(); 564 foreach ( $ratings as $key => $value ) { 565 $sanitized_key = sanitize_text_field( $key ); 566 $sanitized_value = min( 5, max( 1, absint( $value ) ) ); 567 $sanitized_ratings[ $sanitized_key ] = $sanitized_value; 568 } 569 update_post_meta( $review_id, 'review_star_rating', $sanitized_ratings ); 558 570 } 559 571 -
review-buddypress-groups/trunk/includes/bgr-filters.php
r3430846 r3431049 238 238 $exclude_groups = isset( $bgr['exclude_groups'] ) ? array_map( 'absint', (array) $bgr['exclude_groups'] ) : array(); 239 239 $current_group_id = absint( bp_get_current_group_id() ); 240 $current_user_id = bp_loggedin_user_id(); 241 242 // Check if current group is excluded from reviews. 243 if ( ! empty( $exclude_groups ) && in_array( $current_group_id, $exclude_groups, true ) ) { 244 return; 245 } 246 247 // Group admins should not see the "Add Review" button on their own groups. 248 if ( groups_is_user_admin( $current_user_id, $current_group_id ) ) { 249 return; 250 } 251 252 // Non-members should not see the "Add Review" button. 253 if ( ! groups_is_user_member( $current_user_id, $current_group_id ) ) { 254 return; 255 } 256 240 257 // Build group URL safely for both BuddyPress and BuddyBoss. 241 258 $current_group = groups_get_group( array( 'group_id' => $current_group_id ) ); … … 247 264 } 248 265 $current_group_link .= 'add-' . bp_group_review_tab_slug(); 249 // Check if current group is excluded from reviews.250 if ( ! empty( $exclude_groups ) && in_array( $current_group_id, $exclude_groups, true ) ) {251 return;252 }253 254 // Group admins should not see the "Add Review" button on their own groups.255 if ( groups_is_user_admin( bp_loggedin_user_id(), bp_get_current_group_id() ) ) {256 return;257 }258 266 ?> 259 267 <div class="group-button group-actions-absolute public generic-button" id="add-review-groupbutton"> … … 822 830 $gp_parent_url = bp_get_groups_directory_permalink() . $bp->groups->current_group->slug . '/'; 823 831 } 832 833 // Check if user can add reviews (must be logged in, member, and not admin). 834 $current_group_id = absint( $bp->groups->current_group->id ); 835 $current_user_id = bp_loggedin_user_id(); 836 $can_add_review = is_user_logged_in() 837 && groups_is_user_member( $current_user_id, $current_group_id ) 838 && ! groups_is_user_admin( $current_user_id, $current_group_id ); 839 824 840 if ( ! empty( $bgr_admin_general_settings ) ) { 825 $exclude_groups = isset( $bgr['exclude_groups'] ) ? array_map( 'absint', (array) $bgr['exclude_groups'] ) : array(); 826 $current_group_id = absint( $bp->groups->current_group->id ); 841 $exclude_groups = isset( $bgr['exclude_groups'] ) ? array_map( 'absint', (array) $bgr['exclude_groups'] ) : array(); 827 842 if ( ! empty( $exclude_groups ) ) { 828 843 if ( ! in_array( $current_group_id, $exclude_groups, true ) ) { 829 $tab_args[] = array( 844 // Always add the Reviews listing tab. 845 bp_core_new_subnav_item( 846 array( 847 'name' => $review_label . ' ' . $count_notification, 848 'slug' => sanitize_title( $bgr['manage_review_label'] ), 849 'parent_slug' => $bp->groups->current_group->slug, 850 'parent_url' => $gp_parent_url, 851 'screen_function' => array( $this, 'bp_group_review_tab' ), 852 'position' => 198, 853 'item_css_id' => 'reviews', 854 ) 855 ); 856 857 // Only add the "Add Review" tab if user can add reviews. 858 if ( $can_add_review ) { 859 bp_core_new_subnav_item( 860 array( 861 /* translators: %s: review label (e.g., "Review") */ 862 'name' => sprintf( __( 'Adds %s', 'bp-group-reviews' ), $add_review_label ), 863 'slug' => 'add-' . bp_group_review_tab_slug(), 864 'parent_slug' => $bp->groups->current_group->slug, 865 'parent_url' => $gp_parent_url, 866 'screen_function' => array( $this, 'bp_group_review_add_review_tab' ), 867 'position' => 199, 868 'item_css_id' => 'add-review', 869 ) 870 ); 871 } 872 } 873 } else { 874 // Always add the Reviews listing tab. 875 bp_core_new_subnav_item( 876 array( 830 877 'name' => $review_label . ' ' . $count_notification, 831 878 'slug' => sanitize_title( $bgr['manage_review_label'] ), … … 835 882 'position' => 198, 836 883 'item_css_id' => 'reviews', 884 ) 885 ); 886 887 // Only add the "Add Review" tab if user can add reviews. 888 if ( $can_add_review ) { 889 bp_core_new_subnav_item( 890 array( 891 /* translators: %s: review label (e.g., "Review") */ 892 'name' => sprintf( __( 'Adds %s', 'bp-group-reviews' ), $add_review_label ), 893 'slug' => 'add-' . bp_group_review_tab_slug(), 894 'parent_slug' => $bp->groups->current_group->slug, 895 'parent_url' => $gp_parent_url, 896 'screen_function' => array( $this, 'bp_group_review_add_review_tab' ), 897 'position' => 199, 898 'item_css_id' => 'add-review', 899 ) 837 900 ); 838 839 $tab_args[] = array( 901 } 902 } 903 } else { 904 // Always add the Reviews listing tab. 905 bp_core_new_subnav_item( 906 array( 907 'name' => $review_label . ' ' . $count_notification, 908 'slug' => sanitize_title( $bgr['manage_review_label'] ), 909 'parent_slug' => $bp->groups->current_group->slug, 910 'parent_url' => $gp_parent_url, 911 'screen_function' => array( $this, 'bp_group_review_tab' ), 912 'position' => 198, 913 'item_css_id' => 'reviews', 914 ) 915 ); 916 917 // Only add the "Add Review" tab if user can add reviews. 918 if ( $can_add_review ) { 919 bp_core_new_subnav_item( 920 array( 840 921 /* translators: %s: review label (e.g., "Review") */ 841 922 'name' => sprintf( __( 'Adds %s', 'bp-group-reviews' ), $add_review_label ), … … 846 927 'position' => 199, 847 928 'item_css_id' => 'add-review', 848 ); 849 850 foreach ( $tab_args as $tab ) { 851 bp_core_new_subnav_item( $tab ); 852 } 853 } 854 } else { 855 $tab_args[] = array( 856 'name' => $review_label . ' ' . $count_notification, 857 'slug' => sanitize_title( $bgr['manage_review_label'] ), 858 'parent_slug' => $bp->groups->current_group->slug, 859 'parent_url' => $gp_parent_url, 860 'screen_function' => array( $this, 'bp_group_review_tab' ), 861 'position' => 198, 862 'item_css_id' => 'reviews', 929 ) 863 930 ); 864 865 $tab_args[] = array(866 /* translators: %s: review label (e.g., "Review") */867 'name' => sprintf( __( 'Adds %s', 'bp-group-reviews' ), $add_review_label ),868 'slug' => 'add-' . bp_group_review_tab_slug(),869 'parent_slug' => $bp->groups->current_group->slug,870 'parent_url' => $gp_parent_url,871 'screen_function' => array( $this, 'bp_group_review_add_review_tab' ),872 'position' => 199,873 'item_css_id' => 'add-review',874 );875 876 foreach ( $tab_args as $tab ) {877 bp_core_new_subnav_item( $tab );878 }879 }880 } else {881 $tab_args[] = array(882 'name' => $review_label . ' ' . $count_notification,883 'slug' => sanitize_title( $bgr['manage_review_label'] ),884 'parent_slug' => $bp->groups->current_group->slug,885 'parent_url' => $gp_parent_url,886 'screen_function' => array( $this, 'bp_group_review_tab' ),887 'position' => 198,888 'item_css_id' => 'reviews',889 );890 891 $tab_args[] = array(892 /* translators: %s: review label (e.g., "Review") */893 'name' => sprintf( __( 'Adds %s', 'bp-group-reviews' ), $add_review_label ),894 'slug' => 'add-' . bp_group_review_tab_slug(),895 'parent_slug' => $bp->groups->current_group->slug,896 'parent_url' => $gp_parent_url,897 'screen_function' => array( $this, 'bp_group_review_add_review_tab' ),898 'position' => 199,899 'item_css_id' => 'add-review',900 );901 902 foreach ( $tab_args as $tab ) {903 bp_core_new_subnav_item( $tab );904 931 } 905 932 } -
review-buddypress-groups/trunk/includes/bgr-globals.php
r3430846 r3431049 26 26 27 27 if ( ! empty( $bgr_admin_general_settings ) ) { 28 $auto_approve_reviews = isset( $bgr_admin_general_settings['auto_approve_reviews'] ) ? $bgr_admin_general_settings['auto_approve_reviews'] : 'no'; 29 $reviews_per_page = isset( $bgr_admin_general_settings['reviews_per_page'] ) ? $bgr_admin_general_settings['reviews_per_page'] : 5; 30 $allow_notification = isset( $bgr_admin_general_settings['allow_notification'] ) ? $bgr_admin_general_settings['allow_notification'] : 'yes'; 31 $allow_activity = isset( $bgr_admin_general_settings['allow_activity'] ) ? $bgr_admin_general_settings['allow_activity'] : 'yes'; 32 $exclude_groups = isset( $bgr_admin_general_settings['exclude_groups'] ) ? $bgr_admin_general_settings['exclude_groups'] : array(); 33 $multi_reviews = isset( $bgr_admin_general_settings['multi_reviews'] ) ? $bgr_admin_general_settings['multi_reviews'] : 'no'; 28 $auto_approve_reviews = isset( $bgr_admin_general_settings['auto_approve_reviews'] ) ? $bgr_admin_general_settings['auto_approve_reviews'] : 'no'; 29 $reviews_per_page = isset( $bgr_admin_general_settings['reviews_per_page'] ) ? $bgr_admin_general_settings['reviews_per_page'] : 5; 30 $allow_notification = isset( $bgr_admin_general_settings['allow_notification'] ) ? $bgr_admin_general_settings['allow_notification'] : 'yes'; 31 $allow_activity = isset( $bgr_admin_general_settings['allow_activity'] ) ? $bgr_admin_general_settings['allow_activity'] : 'yes'; 32 $exclude_groups = isset( $bgr_admin_general_settings['exclude_groups'] ) ? $bgr_admin_general_settings['exclude_groups'] : array(); 33 $multi_reviews = isset( $bgr_admin_general_settings['multi_reviews'] ) ? $bgr_admin_general_settings['multi_reviews'] : 'no'; 34 $enable_group_criteria = isset( $bgr_admin_general_settings['enable_group_criteria'] ) ? $bgr_admin_general_settings['enable_group_criteria'] : 'no'; 34 35 } else { 35 $multi_reviews = 'no'; 36 $reviews_per_page = 5; 37 $allow_notification = 'yes'; 38 $allow_activity = 'yes'; 39 $exclude_groups = array(); 40 $auto_approve_reviews = 'no'; 36 $multi_reviews = 'no'; 37 $reviews_per_page = 5; 38 $allow_notification = 'yes'; 39 $allow_activity = 'yes'; 40 $exclude_groups = array(); 41 $auto_approve_reviews = 'no'; 42 $enable_group_criteria = 'no'; 41 43 } 42 44 … … 113 115 'allow_activity' => $allow_activity, 114 116 'exclude_groups' => $exclude_groups, 117 'enable_group_criteria' => $enable_group_criteria, 115 118 'review_email_subject' => $review_email_subject, 116 119 'review_email_message' => $review_email_message, -
review-buddypress-groups/trunk/includes/bgr-grp-extn.php
r3430846 r3431049 67 67 } 68 68 69 // Only proceed with tab creation if group is not excluded 69 // Only proceed with tab creation if group is not excluded. 70 70 if ( ! $is_group_excluded ) { 71 71 if ( ! empty( $bgr_admin_general_settings ) ) { … … 175 175 <div class="item-description"> 176 176 <div class="review-description"> 177 <?php 178 $trimcontent = get_the_content(); 179 if ( ! empty( $trimcontent ) ) : 180 ?> 177 181 <div class="review-excerpt bgr-col-12"> 178 182 <b> <?php esc_html_e( 'Short Description ', 'bp-group-reviews' ); ?>: </b> 179 183 <?php 180 $trimcontent = get_the_content();181 if ( ! empty( $trimcontent ) ) {182 184 $len = strlen( $trimcontent ); 183 if ( $len > 150 ) { 184 $shortexcerpt = substr( $trimcontent, 0, 150 ); 185 echo wp_kses_post( $shortexcerpt ); 186 } else { 187 echo wp_kses_post( $trimcontent ); 188 } 185 if ( $len > 150 ) { 186 $shortexcerpt = substr( $trimcontent, 0, 150 ); 187 echo wp_kses_post( $shortexcerpt ); 188 } else { 189 echo wp_kses_post( $trimcontent ); 189 190 } 190 191 ?> … … 200 201 </div> 201 202 <a class="expand-review-des"><?php esc_html_e( 'View More..', 'bp-group-reviews' ); ?> </a> 203 <?php else : ?> 204 <div class="review-ratings-only bgr-col-12"> 205 <?php do_action( 'bgr_display_ratings', $post->ID ); ?> 206 </div> 207 <?php endif; ?> 202 208 </div> 203 209 </div> … … 268 274 bp_register_group_extension( 'Group_Reviews_Management_Extn' ); 269 275 270 276 /** 277 * Group Criteria Settings Extension. 278 * 279 * Allows group admins to customize review criteria for their group. 280 * 281 * @since 3.7.0 282 */ 283 class Group_Reviews_Criteria_Extn extends BP_Group_Extension { 284 285 /** 286 * Constructor. 287 * 288 * @param array $args Arguments. 289 */ 290 public function __construct( $args = array() ) { 291 global $bgr; 292 293 $enabled = true; 294 $bgr_admin_general_settings = get_option( 'bgr_admin_general_settings' ); 295 296 // Check if group-level criteria feature is enabled by site admin. 297 $enable_group_criteria = isset( $bgr_admin_general_settings['enable_group_criteria'] ) ? $bgr_admin_general_settings['enable_group_criteria'] : 'no'; 298 if ( 'yes' !== $enable_group_criteria ) { 299 return; // Feature not enabled, don't register this extension. 300 } 301 302 // Check if current group is excluded from reviews. 303 $current_group_id = absint( bp_get_current_group_id() ); 304 $is_group_excluded = false; 305 306 if ( ! empty( $bgr_admin_general_settings ) && isset( $bgr_admin_general_settings['exclude_groups'] ) ) { 307 $exclude_groups = array_map( 'absint', (array) $bgr_admin_general_settings['exclude_groups'] ); 308 if ( ! empty( $exclude_groups ) && in_array( $current_group_id, $exclude_groups, true ) ) { 309 $enabled = false; 310 $is_group_excluded = true; 311 } 312 } 313 314 if ( ! $is_group_excluded ) { 315 $args = array( 316 'slug' => 'review-criteria', 317 'nav_item_position' => 201, 318 'name' => __( 'Review Criteria', 'bp-group-reviews' ), 319 'enable_nav_item' => false, 320 'screens' => array( 321 'admin' => array( 322 'name' => __( 'Review Criteria', 'bp-group-reviews' ), 323 'slug' => 'review-criteria', 324 'enabled' => $enabled, 325 ), 326 ), 327 'show_tab' => false, 328 ); 329 parent::init( $args ); 330 } 331 } 332 333 /** 334 * Display the criteria settings screen. 335 * 336 * @param int $group_id Group ID. 337 */ 338 public function admin_screen( $group_id = null ) { 339 $this->edit_screen( $group_id ); 340 } 341 342 /** 343 * Display the criteria settings screen. 344 * 345 * @param int $group_id Group ID. 346 */ 347 public function edit_screen( $group_id = null ) { 348 // Load the template. 349 $template_path = BGR_PLUGIN_PATH . 'includes/templates/bgr-group-criteria-settings.php'; 350 if ( file_exists( $template_path ) ) { 351 include $template_path; 352 } 353 // Hidden submit button to satisfy BP Group Extension requirements. 354 echo '<input type="submit" name="save" style="display:none;" id="bp-group-edit-review-criteria-submit">'; 355 } 356 357 /** 358 * Save the criteria settings. 359 * 360 * @param int $group_id Group ID. 361 */ 362 public function admin_screen_save( $group_id = null ) { 363 // Settings are saved via AJAX, so nothing needed here. 364 } 365 366 /** 367 * Save the criteria settings. 368 * 369 * @param int $group_id Group ID. 370 */ 371 public function edit_screen_save( $group_id = null ) { 372 // Settings are saved via AJAX, so nothing needed here. 373 } 374 } 375 // Only register the criteria extension if the feature is enabled by site admin. 376 $bgr_criteria_settings = get_option( 'bgr_admin_general_settings' ); 377 $enable_criteria_extension = isset( $bgr_criteria_settings['enable_group_criteria'] ) ? $bgr_criteria_settings['enable_group_criteria'] : 'no'; 378 if ( 'yes' === $enable_criteria_extension ) { 379 bp_register_group_extension( 'Group_Reviews_Criteria_Extn' ); 380 } 271 381 272 382 endif; -
review-buddypress-groups/trunk/includes/bgr-rating-display.php
r3430846 r3431049 86 86 * Actions performed for rating display type : Star 87 87 * 88 * @since 1.0.0 89 * @author Wbcom Designs 90 * 91 * @param array $review_rating_fields Review rating fields. 92 * @param array $review_ratings Review rating. 88 * Display all criteria ratings from the review itself, including archived/legacy criteria. 89 * This ensures historical reviews display correctly even when criteria have changed. 90 * 91 * @since 1.0.0 92 * @since 3.7.0 Updated to display all review criteria regardless of current active status. 93 * @author Wbcom Designs 94 * 95 * @param array $review_rating_fields Review rating fields (global or group-level active criteria). 96 * @param array $review_ratings Review rating data from post meta. 93 97 */ 94 98 public function bp_group_review_display_star_rating( $review_rating_fields, $review_ratings ) { 95 // Ensure $review_ratings[0] is an array before using array_key_exists. 96 if ( ! empty( $review_rating_fields ) && ! empty( $review_ratings[0] ) && is_array( $review_ratings[0] ) ) : 97 foreach ( $review_rating_fields as $review_field ) { 98 if ( array_key_exists( $review_field, $review_ratings[0] ) ) { 99 // Ensure $review_ratings[0] is an array. 100 if ( empty( $review_ratings[0] ) || ! is_array( $review_ratings[0] ) ) { 101 return; 102 } 103 104 $actual_review_ratings = $review_ratings[0]; 105 106 // Get currently active criteria for comparison (to identify archived ones). 107 global $bgr; 108 $active_criteria = ! empty( $bgr['active_rating_fields'] ) ? $bgr['active_rating_fields'] : array(); 109 110 // Display all criteria that the review actually has. 111 foreach ( $actual_review_ratings as $review_field => $rating_value ) { 112 // Skip non-string keys (legacy numeric arrays). 113 if ( is_int( $review_field ) ) { 114 continue; 115 } 116 117 // Check if this criterion is currently active. 118 $is_archived = ! in_array( $review_field, $active_criteria, true ); 119 ?> 120 <div class="multi-review <?php echo $is_archived ? 'bgr-archived-criteria' : ''; ?>"> 121 <div class="bgr-col-6"> 122 <?php 123 echo esc_html( $review_field ) . ' : '; 124 if ( $is_archived ) { 125 ?> 126 <span class="bgr-legacy-indicator" title="<?php esc_attr_e( 'This criterion is no longer active', 'bp-group-reviews' ); ?>"> 127 <small>(<?php esc_html_e( 'legacy', 'bp-group-reviews' ); ?>)</small> 128 </span> 129 <?php 130 } 99 131 ?> 100 <div class="multi-review"> 101 <div class="bgr-col-6"> 102 <?php echo esc_html( $review_field ) . ' : '; ?> 103 </div> 104 <div class="bgr-col-6"> 132 </div> 133 <div class="bgr-col-6"> 134 <?php 135 $stars_on = absint( $rating_value ); 136 $stars_off = 5 - $stars_on; 137 for ( $i = 1; $i <= $stars_on; $i++ ) { 138 ?> 139 <span class="fas fa-star stars bgr-star-rate"></span> 105 140 <?php 106 /*** Ratings *****/ 107 $stars_on = $review_ratings[0][ $review_field ]; 108 $stars_off = 5 - $stars_on; 109 for ( $i = 1; $i <= $stars_on; $i++ ) { 110 ?> 111 <span class="fas fa-star stars bgr-star-rate"></span> 112 <?php 113 } 114 for ( $i = 1; $i <= $stars_off; $i++ ) { 115 ?> 116 <span class="far fa-star stars bgr-star-rate"></span> 117 <?php 118 } 119 ?> 120 </div> 121 </div> 141 } 142 for ( $i = 1; $i <= $stars_off; $i++ ) { 143 ?> 144 <span class="far fa-star stars bgr-star-rate"></span> 122 145 <?php 123 146 } 124 } 125 endif; 147 ?> 148 </div> 149 </div> 150 <?php 151 } 126 152 } 127 153 -
review-buddypress-groups/trunk/includes/bgr-scripts.php
r3430846 r3431049 191 191 wp_enqueue_script( 'bgr-ratings-js' ); 192 192 } 193 194 // Enqueue group criteria admin script on group admin pages. 195 if ( function_exists( 'bp_is_group' ) && bp_is_group() && bp_is_group_admin_page() ) { 196 wp_register_script( 197 'bgr-group-criteria-admin-js', 198 BGR_PLUGIN_URL . 'assets/js' . $script_path . '/bgr-group-criteria-admin' . $script_extension, 199 array( 'jquery' ), 200 BGR_PLUGIN_VERSION, 201 true 202 ); 203 wp_enqueue_script( 'bgr-group-criteria-admin-js' ); 204 wp_localize_script( 205 'bgr-group-criteria-admin-js', 206 'bgr_group_criteria', 207 array( 208 'ajaxurl' => admin_url( 'admin-ajax.php' ), 209 'nonce' => wp_create_nonce( 'bgr_group_criteria_nonce' ), 210 ) 211 ); 212 } 193 213 } 194 214 -
review-buddypress-groups/trunk/includes/bgr-shortcodes.php
r3430846 r3431049 42 42 global $bgr; 43 43 $review_rating_fields = $bgr['review_rating_fields']; 44 $active_rating_fields = $bgr['active_rating_fields'];45 44 $review_label = $bgr['review_label']; 46 45 $admin_exclude_groups = $bgr['exclude_groups']; … … 55 54 $current_group_id = bp_get_current_group_id(); 56 55 } 57 $group_args = array( 56 57 // Use group-level criteria if available, otherwise fall back to global. 58 $active_rating_fields = function_exists( 'bgr_get_effective_criteria' ) && $current_group_id 59 ? bgr_get_effective_criteria( $current_group_id ) 60 : $bgr['active_rating_fields']; 61 $group_args = array( 58 62 'post_type' => 'review', 59 63 'category' => 'group', … … 71 75 ), 72 76 ); 73 $reviews_args = new WP_Query( $group_args );77 $reviews_args = new WP_Query( $group_args ); 74 78 if ( ! is_user_logged_in() ) { 75 79 $output .= '<div id="message" class="bp-messages bp-feedback error">'; … … 174 178 </p> 175 179 <?php $this->bp_group_review_display_form_rating(); ?> 176 <span class="bgr-error-fields">*<?php esc_html_e( 'This field is required.', 'bp-group-reviews' ); ?></span>177 180 <?php /* translators: %s: search term */ ?> 178 <textarea class="review_desc" name="review-desc" placeholder="<?php printf( esc_attr__( '%1$s Description ', 'bp-group-reviews' ), esc_attr( $review_label ) ); ?>" rows="3" cols="50" required></textarea>181 <textarea class="review_desc" name="review-desc" placeholder="<?php printf( esc_attr__( '%1$s Description (optional)', 'bp-group-reviews' ), esc_attr( $review_label ) ); ?>" rows="3" cols="50"></textarea> 179 182 <br/> 180 183 <p> … … 200 203 public function bp_group_review_display_form_rating() { 201 204 global $bgr; 202 $this->bp_group_review_display_form_star_rating(); 205 $group_id = bp_get_current_group_id(); 206 $this->bp_group_review_display_form_star_rating( $group_id ); 203 207 } 204 208 … … 206 210 * Check active rating fields 207 211 * 212 * @param int $group_id Optional group ID for group-level criteria. 208 213 * @return bool True if there are active rating fields, false otherwise. 209 214 */ 210 public function bp_group_review_display_star() { 211 global $bgr; 212 $active_rating_fields = $bgr['active_rating_fields']; 215 public function bp_group_review_display_star( $group_id = 0 ) { 216 global $bgr; 217 // Use group-level criteria if available. 218 $active_rating_fields = function_exists( 'bgr_get_effective_criteria' ) && $group_id 219 ? bgr_get_effective_criteria( $group_id ) 220 : $bgr['active_rating_fields']; 213 221 if ( ! empty( $active_rating_fields ) ) { 214 222 $show_rating = true; … … 224 232 * @since 1.0.0 225 233 * @author Wbcom Designs 226 */ 227 public function bp_group_review_display_form_star_rating() { 228 global $bgr; 229 $review_rating_fields = $bgr['review_rating_fields']; 230 $active_rating_fields = $bgr['active_rating_fields']; 231 $bp_group_review_display_star = $this->bp_group_review_display_star(); 234 * @param int $group_id Optional group ID for group-level criteria. 235 */ 236 public function bp_group_review_display_form_star_rating( $group_id = 0 ) { 237 global $bgr; 238 // Use group-level criteria if available. 239 $active_rating_fields = function_exists( 'bgr_get_effective_criteria' ) && $group_id 240 ? bgr_get_effective_criteria( $group_id ) 241 : $bgr['active_rating_fields']; 242 // For the form, we only show the active criteria (whether global or group-level). 243 $review_rating_fields = $active_rating_fields; 244 $bp_group_review_display_star = $this->bp_group_review_display_star( $group_id ); 232 245 if ( true === $bp_group_review_display_star ) { 233 246 $field_counter = 1; -
review-buddypress-groups/trunk/includes/templates/bgr-single-review-template.php
r3430846 r3431049 18 18 $review_id = 0; 19 19 if ( preg_match( '/\/view\/(\d+)/', $url, $matches ) ) { 20 $review_id = absint( $matches[1] );20 $review_id = absint( $matches[1] ); 21 21 } 22 22 23 23 // Bail early if no valid review ID found. 24 24 if ( empty( $review_id ) ) { 25 echo '<div class="bp-feedback error"><p>' . esc_html__( 'Review not found.', 'bp-group-reviews' ) . '</p></div>';26 return;25 echo '<div class="bp-feedback error"><p>' . esc_html__( 'Review not found.', 'bp-group-reviews' ) . '</p></div>'; 26 return; 27 27 } 28 28 … … 31 31 // Bail if review doesn't exist. 32 32 if ( ! $review || 'review' !== $review->post_type ) { 33 echo '<div class="bp-feedback error"><p>' . esc_html__( 'Review not found.', 'bp-group-reviews' ) . '</p></div>';34 return;33 echo '<div class="bp-feedback error"><p>' . esc_html__( 'Review not found.', 'bp-group-reviews' ) . '</p></div>'; 34 return; 35 35 } 36 $review_title = $review->post_title;37 $author = absint( $review->post_author );38 $author_details = get_userdata( $author );36 $review_title = $review->post_title; 37 $author = absint( $review->post_author ); 38 $author_details = get_userdata( $author ); 39 39 ?> 40 40 <div class="bgr-single-review"> … … 52 52 <div class="item-description"> 53 53 <div class="review-description"> 54 <?php if ( ! empty( $review->post_content ) ) : ?> 54 55 <div class="bgr-col-12"> 55 56 <?php echo esc_html( $review->post_content ); ?> 56 57 </div> 58 <?php endif; ?> 57 59 <?php 58 60 $review_ratings = get_post_meta( $review_id, 'review_star_rating', false ); -
review-buddypress-groups/trunk/languages/bp-group-reviews.pot
r3430846 r3431049 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Wbcom Designs - BuddyPress Group Reviews 3. 6.0\n"5 "Project-Id-Version: Wbcom Designs - BuddyPress Group Reviews 3.7.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/buddypress-groups-review\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-01-02T 04:15:17+00:00\n"12 "POT-Creation-Date: 2026-01-02T12:17:30+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 96 96 97 97 #: admin/bgr-admin.php:95 98 #: admin/review-admin-options-page.php:4 1999 #: admin/review-admin-options-page.php:4 63100 #: admin/review-admin-options-page.php:5 0698 #: admin/review-admin-options-page.php:437 99 #: admin/review-admin-options-page.php:481 100 #: admin/review-admin-options-page.php:524 101 101 msgid "Emails" 102 102 msgstr "" … … 104 104 #: admin/bgr-admin.php:107 105 105 #: admin/wbcom/templates/wbcom-license-page.php:9 106 #: includes/bgr-filters.php: 996106 #: includes/bgr-filters.php:1023 107 107 msgid "BuddyPress Group Review" 108 108 msgstr "" … … 116 116 117 117 #: admin/bgr-admin.php:121 118 #: admin/review-admin-options-page.php:3 52118 #: admin/review-admin-options-page.php:370 119 119 msgid "Settings Saved." 120 120 msgstr "" 121 121 122 122 #: admin/bgr-admin.php:125 123 #: admin/review-admin-options-page.php:3 55123 #: admin/review-admin-options-page.php:373 124 124 msgid "Dismiss this notice." 125 125 msgstr "" … … 129 129 #: admin/bgr-admin.php:154 130 130 #: admin/review-admin-options-page.php:241 131 #: includes/bgr-globals.php:9 1132 #: includes/bgr-globals.php:9 5133 #: includes/bgr-globals.php:13 5131 #: includes/bgr-globals.php:93 132 #: includes/bgr-globals.php:97 133 #: includes/bgr-globals.php:138 134 134 #: includes/bgr-grp-extn.php:52 135 135 #: includes/bgr-grp-extn.php:134 … … 140 140 #: admin/bgr-admin.php:152 141 141 #: admin/review-admin-options-page.php:121 142 #: includes/bgr-filters.php:4 45143 #: includes/bgr-filters.php: 795144 #: includes/bgr-globals.php:9 0145 #: includes/bgr-globals.php:9 4146 #: includes/bgr-globals.php:14 3142 #: includes/bgr-filters.php:453 143 #: includes/bgr-filters.php:803 144 #: includes/bgr-globals.php:92 145 #: includes/bgr-globals.php:96 146 #: includes/bgr-globals.php:146 147 147 #: includes/bgr-grp-extn.php:53 148 148 msgid "Review" … … 277 277 278 278 #: admin/review-admin-options-page.php:60 279 #: includes/bgr-grp-extn.php:318 280 #: includes/bgr-grp-extn.php:322 279 281 msgid "Review Criteria" 280 282 msgstr "" … … 294 296 #: admin/review-admin-options-page.php:93 295 297 #: admin/review-admin-options-page.php:150 296 #: admin/review-admin-options-page.php:3 31298 #: admin/review-admin-options-page.php:349 297 299 msgid "Save Settings" 298 300 msgstr "" … … 389 391 390 392 #: admin/review-admin-options-page.php:306 393 msgid "Enable Group-Level Criteria" 394 msgstr "" 395 396 #: admin/review-admin-options-page.php:307 397 msgid "Allow group admins to customize review criteria for their specific groups." 398 msgstr "" 399 400 #: admin/review-admin-options-page.php:324 391 401 msgid "Exclude Groups from Reviews" 392 402 msgstr "" 393 403 394 #: admin/review-admin-options-page.php:3 07404 #: admin/review-admin-options-page.php:325 395 405 msgid "Select the groups that should not have review functionality." 396 406 msgstr "" 397 407 398 #: admin/review-admin-options-page.php:3 61408 #: admin/review-admin-options-page.php:379 399 409 msgid "Email Settings" 400 410 msgstr "" 401 411 402 #: admin/review-admin-options-page.php:4 14412 #: admin/review-admin-options-page.php:432 403 413 msgid "Review Submission" 404 414 msgstr "" 405 415 406 #: admin/review-admin-options-page.php:4 20416 #: admin/review-admin-options-page.php:438 407 417 msgid "Enable this option to notify the group admin and reviewer via email when a review is added, accepted, or denied." 408 418 msgstr "" 409 419 410 #: admin/review-admin-options-page.php:4 32411 #: admin/review-admin-options-page.php:4 75412 #: admin/review-admin-options-page.php:5 19420 #: admin/review-admin-options-page.php:450 421 #: admin/review-admin-options-page.php:493 422 #: admin/review-admin-options-page.php:537 413 423 msgid "Email Subject" 414 424 msgstr "" 415 425 416 #: admin/review-admin-options-page.php:4 33426 #: admin/review-admin-options-page.php:451 417 427 msgid "Enter the email subject for review notifications." 418 428 msgstr "" 419 429 420 #: admin/review-admin-options-page.php:4 42421 #: admin/review-admin-options-page.php: 485422 #: admin/review-admin-options-page.php:5 29430 #: admin/review-admin-options-page.php:460 431 #: admin/review-admin-options-page.php:503 432 #: admin/review-admin-options-page.php:547 423 433 msgid "Email Message" 424 434 msgstr "" 425 435 426 #: admin/review-admin-options-page.php:4 43436 #: admin/review-admin-options-page.php:461 427 437 msgid "Enter the email message for review notifications." 428 438 msgstr "" 429 439 430 #: admin/review-admin-options-page.php:4 60440 #: admin/review-admin-options-page.php:478 431 441 msgid "Review Acceptance" 432 442 msgstr "" 433 443 434 #: admin/review-admin-options-page.php:4 64444 #: admin/review-admin-options-page.php:482 435 445 msgid "Enable this option to notify the reviewer via email when their review is accepted." 436 446 msgstr "" 437 447 438 #: admin/review-admin-options-page.php:4 76448 #: admin/review-admin-options-page.php:494 439 449 msgid "Enter the email subject for review acceptance notifications." 440 450 msgstr "" 441 451 442 #: admin/review-admin-options-page.php: 486452 #: admin/review-admin-options-page.php:504 443 453 msgid "Enter the email message for review acceptance notifications." 444 454 msgstr "" 445 455 446 #: admin/review-admin-options-page.php:5 03456 #: admin/review-admin-options-page.php:521 447 457 msgid "Review Denial" 448 458 msgstr "" 449 459 450 #: admin/review-admin-options-page.php:5 07460 #: admin/review-admin-options-page.php:525 451 461 msgid "Enable this option to notify the reviewer via email when their review is denied." 452 462 msgstr "" 453 463 454 #: admin/review-admin-options-page.php:5 20464 #: admin/review-admin-options-page.php:538 455 465 msgid "Enter the email subject for review denial notifications." 456 466 msgstr "" 457 467 458 #: admin/review-admin-options-page.php:5 30468 #: admin/review-admin-options-page.php:548 459 469 msgid "Enter the email message for review denial notifications." 460 470 msgstr "" … … 481 491 #: admin/wbcom/templates/wbcom-license-page.php:29 482 492 #: admin/wbcom/templates/wbcom-license-page.php:41 483 #: includes/bgr-filters.php:66 1493 #: includes/bgr-filters.php:669 484 494 msgid "Status" 485 495 msgstr "" … … 1131 1141 1132 1142 #: admin/wbcom/wbcom-admin-settings.php:211 1133 #: includes/bgr-scripts.php:2 321143 #: includes/bgr-scripts.php:252 1134 1144 msgid "Activate" 1135 1145 msgstr "" 1136 1146 1137 1147 #: admin/wbcom/wbcom-admin-settings.php:212 1138 #: includes/bgr-scripts.php:2 331148 #: includes/bgr-scripts.php:253 1139 1149 msgid "Deactivate" 1140 1150 msgstr "" … … 1158 1168 1159 1169 #: admin/wbcom/wbcom-admin-settings.php:328 1160 #: review-bp-grps.php:16 31170 #: review-bp-grps.php:162 1161 1171 msgid "Settings" 1162 1172 msgstr "" … … 1187 1197 #: includes/bgr-ajax.php:191 1188 1198 #: includes/bgr-ajax.php:229 1189 #: includes/bgr-ajax.php:360 1190 #: includes/bgr-ajax.php:610 1191 #: includes/bgr-ajax.php:725 1192 #: includes/bgr-ajax.php:834 1193 #: includes/bgr-filters.php:625 1199 #: includes/bgr-ajax.php:395 1200 #: includes/bgr-ajax.php:643 1201 #: includes/bgr-ajax.php:758 1202 #: includes/bgr-ajax.php:867 1203 #: includes/bgr-filters.php:633 1204 #: includes/bgr-group-criteria-ajax.php:23 1205 #: includes/bgr-group-criteria-ajax.php:75 1206 #: includes/bgr-group-criteria-ajax.php:124 1207 #: includes/bgr-group-criteria-ajax.php:162 1208 #: includes/bgr-group-criteria-ajax.php:200 1209 #: includes/bgr-group-criteria-ajax.php:239 1194 1210 msgid "Security check failed." 1195 1211 msgstr "" … … 1214 1230 #: includes/bgr-ajax.php:200 1215 1231 #: includes/bgr-ajax.php:238 1216 #: includes/bgr-ajax.php:6 221217 #: includes/bgr-ajax.php:7 361218 #: includes/bgr-ajax.php:8 441219 #: includes/bgr-bp-rest-integration.php:5 091220 #: includes/bgr-bp-rest-integration.php:5 371221 #: includes/bgr-bp-rest-integration.php:5 771222 #: includes/bgr-bp-rest-integration.php:6 481223 #: includes/bgr-bp-rest-integration.php:6 691232 #: includes/bgr-ajax.php:655 1233 #: includes/bgr-ajax.php:769 1234 #: includes/bgr-ajax.php:877 1235 #: includes/bgr-bp-rest-integration.php:515 1236 #: includes/bgr-bp-rest-integration.php:543 1237 #: includes/bgr-bp-rest-integration.php:589 1238 #: includes/bgr-bp-rest-integration.php:660 1239 #: includes/bgr-bp-rest-integration.php:681 1224 1240 msgid "Invalid review ID." 1225 1241 msgstr "" … … 1227 1243 #: includes/bgr-ajax.php:206 1228 1244 #: includes/bgr-ajax.php:244 1229 #: includes/bgr-ajax.php:6 281230 #: includes/bgr-ajax.php:7 421231 #: includes/bgr-ajax.php:8 501245 #: includes/bgr-ajax.php:661 1246 #: includes/bgr-ajax.php:775 1247 #: includes/bgr-ajax.php:883 1232 1248 #: includes/templates/bgr-single-review-template.php:25 1233 1249 #: includes/templates/bgr-single-review-template.php:33 … … 1235 1251 msgstr "" 1236 1252 1237 #: includes/bgr-ajax.php:3 641253 #: includes/bgr-ajax.php:399 1238 1254 msgid "You must be logged in to submit a review." 1239 1255 msgstr "" 1240 1256 1241 #: includes/bgr-ajax.php: 3731257 #: includes/bgr-ajax.php:408 1242 1258 msgid "Invalid form data." 1243 1259 msgstr "" 1244 1260 1245 #: includes/bgr-ajax.php:382 1246 msgid "Review description is required." 1247 msgstr "" 1248 1249 #: includes/bgr-ajax.php:387 1261 #: includes/bgr-ajax.php:417 1250 1262 msgid "Invalid group." 1251 1263 msgstr "" 1252 1264 1253 #: includes/bgr-ajax.php: 3941265 #: includes/bgr-ajax.php:424 1254 1266 msgid "Group not found." 1255 1267 msgstr "" 1256 1268 1257 #: includes/bgr-ajax.php:4 021269 #: includes/bgr-ajax.php:432 1258 1270 msgid "Group administrators cannot review their own groups." 1259 1271 msgstr "" 1260 1272 1261 #: includes/bgr-ajax.php:4 071273 #: includes/bgr-ajax.php:437 1262 1274 #: includes/bgr-bp-rest-integration.php:430 1263 1275 msgid "You must be a member of this group to submit a review." 1264 1276 msgstr "" 1265 1277 1266 #: includes/bgr-ajax.php:4 141278 #: includes/bgr-ajax.php:444 1267 1279 msgid "Reviews are not enabled for this group." 1268 1280 msgstr "" 1269 1281 1270 1282 #. Translators: %1$s: Review Label 1271 #: includes/bgr-ajax.php:4 281283 #: includes/bgr-ajax.php:461 1272 1284 #, php-format 1273 1285 msgid "A new %1$s posted." … … 1275 1287 1276 1288 #. Translators: %1$s: Review Label %2$s Group Name %3$s User Name %4$s User Link 1277 #: includes/bgr-ajax.php:4 301289 #: includes/bgr-ajax.php:463 1278 1290 #, php-format 1279 1291 msgid "A new %1$s for %2$s added by %3$s. Link: %4$s" … … 1281 1293 1282 1294 #. Translators: %1$s: User Name %2$s Review Label %3$s Group Name 1283 #: includes/bgr-ajax.php:4 331295 #: includes/bgr-ajax.php:466 1284 1296 #, php-format 1285 1297 msgid "%1$s %2$ss Group %3$s." … … 1287 1299 1288 1300 #. translators: %1$s is replaced with review_label 1289 #: includes/bgr-ajax.php:4 631301 #: includes/bgr-ajax.php:496 1290 1302 #, php-format 1291 1303 msgid "You have already submitted a %1$s for this group." 1292 1304 msgstr "" 1293 1305 1294 #: includes/bgr-ajax.php: 4701306 #: includes/bgr-ajax.php:503 1295 1307 msgid "Please wait, your review is being processed." 1296 1308 msgstr "" 1297 1309 1298 1310 #. translators: %1$s is replaced with review_label 1299 #: includes/bgr-ajax.php: 4801311 #: includes/bgr-ajax.php:513 1300 1312 #, php-format 1301 1313 msgid "Thank you for sharing your %1$s!" … … 1303 1315 1304 1316 #. translators: %1$s is replaced with review_label 1305 #: includes/bgr-ajax.php: 4841317 #: includes/bgr-ajax.php:517 1306 1318 #, php-format 1307 1319 msgid "Thank you for your %1$s! It will be published after the group admin approves it." 1308 1320 msgstr "" 1309 1321 1310 #: includes/bgr-ajax.php:5 091322 #: includes/bgr-ajax.php:542 1311 1323 msgid "Failed to create review. Please try again." 1312 1324 msgstr "" 1313 1325 1314 1326 #. translators: %1$s: review label, %2$s: group name 1315 #: includes/bgr-ajax.php:5 471327 #: includes/bgr-ajax.php:580 1316 1328 #, php-format 1317 1329 msgid "New %1$s submitted for %2$s" 1318 1330 msgstr "" 1319 1331 1320 #: includes/bgr-ajax.php:6 141321 #: includes/bgr-ajax.php:7 291322 #: includes/bgr-ajax.php:8 381332 #: includes/bgr-ajax.php:647 1333 #: includes/bgr-ajax.php:762 1334 #: includes/bgr-ajax.php:871 1323 1335 msgid "You must be logged in." 1324 1336 msgstr "" 1325 1337 1326 #: includes/bgr-ajax.php:6 341327 #: includes/bgr-ajax.php:7 481328 #: includes/bgr-ajax.php:8 561338 #: includes/bgr-ajax.php:667 1339 #: includes/bgr-ajax.php:781 1340 #: includes/bgr-ajax.php:889 1329 1341 msgid "Invalid group for this review." 1330 1342 msgstr "" 1331 1343 1332 #: includes/bgr-ajax.php:6 401333 #: includes/bgr-ajax.php:7 541344 #: includes/bgr-ajax.php:673 1345 #: includes/bgr-ajax.php:787 1334 1346 msgid "You do not have permission to manage reviews for this group." 1335 1347 msgstr "" 1336 1348 1337 1349 #. translators: %1$s: review label, %2$s: group name 1338 #: includes/bgr-ajax.php: 6791350 #: includes/bgr-ajax.php:712 1339 1351 #, php-format 1340 1352 msgid "Your %1$s for %2$s has been approved" … … 1342 1354 1343 1355 #. translators: %1$s: review label, %2$s: group name 1344 #: includes/bgr-ajax.php: 7901356 #: includes/bgr-ajax.php:823 1345 1357 #, php-format 1346 1358 msgid "Your %1$s for %2$s was not approved" 1347 1359 msgstr "" 1348 1360 1349 #: includes/bgr-ajax.php:8 621361 #: includes/bgr-ajax.php:895 1350 1362 msgid "You do not have permission to remove reviews for this group." 1351 1363 msgstr "" … … 1372 1384 1373 1385 #: includes/bgr-bp-rest-integration.php:420 1386 #: includes/bgr-group-criteria-ajax.php:30 1387 #: includes/bgr-group-criteria-ajax.php:245 1374 1388 msgid "Invalid group ID." 1375 1389 msgstr "" … … 1387 1401 msgstr "" 1388 1402 1389 #: includes/bgr-bp-rest-integration.php:5 151403 #: includes/bgr-bp-rest-integration.php:521 1390 1404 msgid "Review does not belong to this group." 1391 1405 msgstr "" 1392 1406 1393 #: includes/bgr-bp-rest-integration.php:5 831407 #: includes/bgr-bp-rest-integration.php:595 1394 1408 msgid "The review could not be deleted." 1395 1409 msgstr "" 1396 1410 1397 #: includes/bgr-bp-rest-integration.php:6 521411 #: includes/bgr-bp-rest-integration.php:664 1398 1412 msgid "You do not have permission to edit this review." 1399 1413 msgstr "" 1400 1414 1401 #: includes/bgr-bp-rest-integration.php:6 731415 #: includes/bgr-bp-rest-integration.php:685 1402 1416 msgid "You do not have permission to delete this review." 1403 1417 msgstr "" 1404 1418 1405 #: includes/bgr-bp-rest-integration.php: 6911419 #: includes/bgr-bp-rest-integration.php:703 1406 1420 msgid "Review ID." 1407 1421 msgstr "" 1408 1422 1409 #: includes/bgr-bp-rest-integration.php: 6971423 #: includes/bgr-bp-rest-integration.php:709 1410 1424 msgid "Group ID." 1411 1425 msgstr "" 1412 1426 1413 #: includes/bgr-bp-rest-integration.php:7 031427 #: includes/bgr-bp-rest-integration.php:715 1414 1428 msgid "Review title." 1415 1429 msgstr "" 1416 1430 1417 #: includes/bgr-bp-rest-integration.php:7 091431 #: includes/bgr-bp-rest-integration.php:721 1418 1432 msgid "Review content." 1419 1433 msgstr "" 1420 1434 1421 #: includes/bgr-bp-rest-integration.php:7 151435 #: includes/bgr-bp-rest-integration.php:727 1422 1436 msgid "Review status." 1423 1437 msgstr "" 1424 1438 1425 #: includes/bgr-bp-rest-integration.php:7 211439 #: includes/bgr-bp-rest-integration.php:733 1426 1440 msgid "Review author." 1427 1441 msgstr "" 1428 1442 1429 #: includes/bgr-bp-rest-integration.php:7 271443 #: includes/bgr-bp-rest-integration.php:739 1430 1444 msgid "Star ratings by criteria." 1431 1445 msgstr "" 1432 1446 1433 #: includes/bgr-bp-rest-integration.php:7 321447 #: includes/bgr-bp-rest-integration.php:744 1434 1448 msgid "Creation date." 1435 1449 msgstr "" 1436 1450 1437 #: includes/bgr-bp-rest-integration.php:7 391451 #: includes/bgr-bp-rest-integration.php:751 1438 1452 msgid "Last modified date." 1439 1453 msgstr "" 1440 1454 1441 1455 #. translators: %1$s is replaced with bp_group_review_add_review_tab_name() 1442 #: includes/bgr-filters.php:2 631456 #: includes/bgr-filters.php:271 1443 1457 #, php-format 1444 1458 msgid "Add %1$s" 1445 1459 msgstr "" 1446 1460 1447 #: includes/bgr-filters.php:4 471461 #: includes/bgr-filters.php:455 1448 1462 msgid "Rating " 1449 1463 msgstr "" 1450 1464 1451 #: includes/bgr-filters.php:4 681452 #: includes/bgr-filters.php:7 541465 #: includes/bgr-filters.php:476 1466 #: includes/bgr-filters.php:762 1453 1467 msgid "Approve" 1454 1468 msgstr "" 1455 1469 1456 #: includes/bgr-filters.php:4 691457 #: includes/bgr-filters.php:7 591458 #: includes/bgr-grp-extn.php:21 01470 #: includes/bgr-filters.php:477 1471 #: includes/bgr-filters.php:767 1472 #: includes/bgr-grp-extn.php:216 1459 1473 msgid "Deny" 1460 1474 msgstr "" 1461 1475 1462 1476 #. translators: %d: number of reviews 1463 #: includes/bgr-filters.php:5 551477 #: includes/bgr-filters.php:563 1464 1478 #, php-format 1465 1479 msgid "%d review approved." … … 1469 1483 1470 1484 #. translators: %d: number of reviews 1471 #: includes/bgr-filters.php:5 671485 #: includes/bgr-filters.php:575 1472 1486 #, php-format 1473 1487 msgid "%d review denied and moved to trash." … … 1476 1490 msgstr[1] "" 1477 1491 1478 #: includes/bgr-filters.php:6 041492 #: includes/bgr-filters.php:612 1479 1493 msgid "Export to CSV" 1480 1494 msgstr "" 1481 1495 1482 #: includes/bgr-filters.php:62 11496 #: includes/bgr-filters.php:629 1483 1497 msgid "You do not have permission to export reviews." 1484 1498 msgstr "" 1485 1499 1486 #: includes/bgr-filters.php:6 591500 #: includes/bgr-filters.php:667 1487 1501 msgid "Review ID" 1488 1502 msgstr "" 1489 1503 1490 #: includes/bgr-filters.php:66 01504 #: includes/bgr-filters.php:668 1491 1505 msgid "Date" 1492 1506 msgstr "" 1493 1507 1494 #: includes/bgr-filters.php:6 621508 #: includes/bgr-filters.php:670 1495 1509 msgid "Reviewer" 1496 1510 msgstr "" 1497 1511 1498 #: includes/bgr-filters.php:6 631512 #: includes/bgr-filters.php:671 1499 1513 msgid "Reviewer Email" 1500 1514 msgstr "" 1501 1515 1502 #: includes/bgr-filters.php:6 641516 #: includes/bgr-filters.php:672 1503 1517 msgid "Group Name" 1504 1518 msgstr "" 1505 1519 1506 #: includes/bgr-filters.php:6 651520 #: includes/bgr-filters.php:673 1507 1521 msgid "Group ID" 1508 1522 msgstr "" 1509 1523 1510 #: includes/bgr-filters.php:6 661524 #: includes/bgr-filters.php:674 1511 1525 msgid "Review Content" 1512 1526 msgstr "" 1513 1527 1514 #: includes/bgr-filters.php:6 671528 #: includes/bgr-filters.php:675 1515 1529 msgid "Average Rating" 1516 1530 msgstr "" 1517 1531 1518 #: includes/bgr-filters.php:6 721519 #: includes/bgr-rating-display.php:1 551532 #: includes/bgr-filters.php:680 1533 #: includes/bgr-rating-display.php:181 1520 1534 msgid "Rating" 1521 1535 msgstr "" 1522 1536 1523 #: includes/bgr-filters.php:6 831537 #: includes/bgr-filters.php:691 1524 1538 msgid "Unknown Group" 1525 1539 msgstr "" 1526 1540 1527 #: includes/bgr-filters.php: 6961541 #: includes/bgr-filters.php:704 1528 1542 msgid "Unknown" 1529 1543 msgstr "" 1530 1544 1531 #: includes/bgr-filters.php:75 01545 #: includes/bgr-filters.php:758 1532 1546 msgid "View" 1533 1547 msgstr "" 1534 1548 1535 1549 #. translators: %s: review label (e.g., "Review") 1536 #: includes/bgr-filters.php:8 411537 #: includes/bgr-filters.php:8 671538 #: includes/bgr-filters.php: 8931550 #: includes/bgr-filters.php:862 1551 #: includes/bgr-filters.php:892 1552 #: includes/bgr-filters.php:922 1539 1553 #, php-format 1540 1554 msgid "Adds %s" 1541 1555 msgstr "" 1542 1556 1543 #: includes/bgr-filters.php: 9801557 #: includes/bgr-filters.php:1007 1544 1558 msgid "Your Response added. This will be published when group admin has approved it." 1545 1559 msgstr "" 1546 1560 1547 #: includes/bgr-filters.php: 9971561 #: includes/bgr-filters.php:1024 1548 1562 msgid "Give Group Review" 1563 msgstr "" 1564 1565 #: includes/bgr-group-criteria-ajax.php:35 1566 #: includes/bgr-group-criteria-ajax.php:86 1567 #: includes/bgr-group-criteria-ajax.php:135 1568 #: includes/bgr-group-criteria-ajax.php:173 1569 #: includes/bgr-group-criteria-ajax.php:212 1570 msgid "You do not have permission to manage this group." 1571 msgstr "" 1572 1573 #: includes/bgr-group-criteria-ajax.php:60 1574 msgid "Criteria settings saved successfully." 1575 msgstr "" 1576 1577 #: includes/bgr-group-criteria-ajax.php:82 1578 #: includes/bgr-group-criteria-ajax.php:131 1579 #: includes/bgr-group-criteria-ajax.php:169 1580 #: includes/bgr-group-criteria-ajax.php:208 1581 msgid "Invalid group ID or criteria name." 1582 msgstr "" 1583 1584 #: includes/bgr-group-criteria-ajax.php:93 1585 msgid "Criteria name must be 50 characters or less." 1586 msgstr "" 1587 1588 #: includes/bgr-group-criteria-ajax.php:98 1589 msgid "A global criterion with this name already exists." 1590 msgstr "" 1591 1592 #: includes/bgr-group-criteria-ajax.php:106 1593 msgid "Custom criterion added successfully." 1594 msgstr "" 1595 1596 #: includes/bgr-group-criteria-ajax.php:111 1597 msgid "A criterion with this name already exists." 1598 msgstr "" 1599 1600 #: includes/bgr-group-criteria-ajax.php:144 1601 msgid "Criterion archived successfully." 1602 msgstr "" 1603 1604 #: includes/bgr-group-criteria-ajax.php:149 1605 msgid "Failed to archive criterion." 1606 msgstr "" 1607 1608 #: includes/bgr-group-criteria-ajax.php:182 1609 msgid "Criterion deleted successfully." 1610 msgstr "" 1611 1612 #: includes/bgr-group-criteria-ajax.php:187 1613 msgid "Failed to delete criterion." 1614 msgstr "" 1615 1616 #: includes/bgr-group-criteria-ajax.php:221 1617 msgid "Criterion enabled." 1618 msgstr "" 1619 1620 #: includes/bgr-group-criteria-ajax.php:221 1621 msgid "Criterion disabled." 1622 msgstr "" 1623 1624 #: includes/bgr-group-criteria-ajax.php:226 1625 msgid "Failed to update criterion." 1549 1626 msgstr "" 1550 1627 … … 1556 1633 msgstr "" 1557 1634 1558 #: includes/bgr-grp-extn.php:1 781635 #: includes/bgr-grp-extn.php:182 1559 1636 msgid "Short Description " 1560 1637 msgstr "" 1561 1638 1562 #: includes/bgr-grp-extn.php:19 51639 #: includes/bgr-grp-extn.php:196 1563 1640 msgid "Full Description" 1564 1641 msgstr "" 1565 1642 1566 #: includes/bgr-grp-extn.php:20 11643 #: includes/bgr-grp-extn.php:202 1567 1644 #: includes/bgr-scripts.php:180 1568 1645 msgid "View More.." 1569 1646 msgstr "" 1570 1647 1571 #: includes/bgr-grp-extn.php:2 071648 #: includes/bgr-grp-extn.php:213 1572 1649 msgid "Accept" 1573 1650 msgstr "" 1574 1651 1575 #: includes/bgr-grp-extn.php:23 11652 #: includes/bgr-grp-extn.php:237 1576 1653 msgid "Prev" 1577 1654 msgstr "" 1578 1655 1579 #: includes/bgr-grp-extn.php:23 21656 #: includes/bgr-grp-extn.php:238 1580 1657 msgid "Next" 1581 1658 msgstr "" 1582 1659 1583 1660 #. translators: %s is replaced with review_label 1584 #: includes/bgr-grp-extn.php:2 541661 #: includes/bgr-grp-extn.php:260 1585 1662 #, php-format 1586 1663 msgid "Sorry, no %s were found." … … 1621 1698 #, php-format 1622 1699 msgid "Your %1$s for %2$s was denied by the group admin." 1700 msgstr "" 1701 1702 #: includes/bgr-rating-display.php:126 1703 msgid "This criterion is no longer active" 1704 msgstr "" 1705 1706 #: includes/bgr-rating-display.php:127 1707 msgid "legacy" 1623 1708 msgstr "" 1624 1709 … … 1633 1718 1634 1719 #. translators: %1$s is used for review lable 1635 #: includes/bgr-shortcodes.php:8 01720 #: includes/bgr-shortcodes.php:84 1636 1721 #, php-format 1637 1722 msgid "You should %1$s for post %2$s." 1638 1723 msgstr "" 1639 1724 1640 #: includes/bgr-shortcodes.php:8 11725 #: includes/bgr-shortcodes.php:85 1641 1726 msgid "login" 1642 1727 msgstr "" 1643 1728 1644 1729 #. translators: %1$s is used for review label 1645 #: includes/bgr-shortcodes.php:1 081730 #: includes/bgr-shortcodes.php:112 1646 1731 #, php-format 1647 1732 msgid "You already posted a %1$s for this group." … … 1649 1734 1650 1735 #. translators: %1$s is used for review label 1651 #: includes/bgr-shortcodes.php:1 671736 #: includes/bgr-shortcodes.php:171 1652 1737 #, php-format 1653 1738 msgid "Write a %1$s" 1654 1739 msgstr "" 1655 1740 1656 #: includes/bgr-shortcodes.php:176 1657 #: includes/bgr-shortcodes.php:246 1658 #: includes/bgr-shortcodes.php:266 1741 #. translators: %s: search term 1742 #: includes/bgr-shortcodes.php:181 1743 #, php-format 1744 msgid "%1$s Description (optional)" 1745 msgstr "" 1746 1747 #. translators: %1$s is used for review label 1748 #: includes/bgr-shortcodes.php:189 1749 #, php-format 1750 msgid "Submit %1$s" 1751 msgstr "" 1752 1753 #: includes/bgr-shortcodes.php:259 1754 #: includes/bgr-shortcodes.php:279 1659 1755 msgid "This field is required." 1660 1756 msgstr "" 1661 1757 1662 #. translators: %s: search term 1663 #: includes/bgr-shortcodes.php:178 1664 #, php-format 1665 msgid "%1$s Description" 1666 msgstr "" 1667 1668 #. translators: %1$s is used for review label 1669 #: includes/bgr-shortcodes.php:186 1670 #, php-format 1671 msgid "Submit %1$s" 1672 msgstr "" 1673 1674 #: includes/bgr-shortcodes.php:258 1758 #: includes/bgr-shortcodes.php:271 1675 1759 msgid "Your Rating" 1676 1760 msgstr "" … … 1692 1776 #, php-format 1693 1777 msgid "%1$s requires BuddyPress to be active on this subsite. The plugin has been deactivated." 1778 msgstr "" 1779 1780 #: includes/templates/bgr-group-criteria-settings.php:33 1781 msgid "Criteria Mode" 1782 msgstr "" 1783 1784 #: includes/templates/bgr-group-criteria-settings.php:34 1785 msgid "Choose whether to use site-wide criteria or customize criteria for this group." 1786 msgstr "" 1787 1788 #: includes/templates/bgr-group-criteria-settings.php:40 1789 msgid "Use site-wide criteria" 1790 msgstr "" 1791 1792 #: includes/templates/bgr-group-criteria-settings.php:41 1793 msgid "Reviews will use the default criteria set by the site administrator." 1794 msgstr "" 1795 1796 #: includes/templates/bgr-group-criteria-settings.php:48 1797 msgid "Customize criteria for this group" 1798 msgstr "" 1799 1800 #: includes/templates/bgr-group-criteria-settings.php:49 1801 msgid "Choose which criteria to enable and add custom criteria for this group." 1802 msgstr "" 1803 1804 #: includes/templates/bgr-group-criteria-settings.php:59 1805 msgid "Site-Wide Criteria" 1806 msgstr "" 1807 1808 #: includes/templates/bgr-group-criteria-settings.php:60 1809 msgid "Select which site-wide criteria to enable for this group." 1810 msgstr "" 1811 1812 #: includes/templates/bgr-group-criteria-settings.php:73 1813 msgid "Inactive globally" 1814 msgstr "" 1815 1816 #: includes/templates/bgr-group-criteria-settings.php:78 1817 msgid "No site-wide criteria defined." 1818 msgstr "" 1819 1820 #: includes/templates/bgr-group-criteria-settings.php:86 1821 msgid "Custom Criteria" 1822 msgstr "" 1823 1824 #: includes/templates/bgr-group-criteria-settings.php:87 1825 msgid "Add custom criteria specific to this group." 1826 msgstr "" 1827 1828 #: includes/templates/bgr-group-criteria-settings.php:96 1829 msgid "Archive" 1830 msgstr "" 1831 1832 #: includes/templates/bgr-group-criteria-settings.php:105 1833 msgid "Enter criteria name..." 1834 msgstr "" 1835 1836 #: includes/templates/bgr-group-criteria-settings.php:107 1837 msgid "Add Criteria" 1838 msgstr "" 1839 1840 #: includes/templates/bgr-group-criteria-settings.php:122 1841 msgid "Archived Criteria" 1842 msgstr "" 1843 1844 #: includes/templates/bgr-group-criteria-settings.php:123 1845 msgid "These criteria are no longer active but may have historical reviews." 1846 msgstr "" 1847 1848 #: includes/templates/bgr-group-criteria-settings.php:128 1849 #: includes/templates/bgr-group-criteria-settings.php:140 1850 msgid "Archived" 1851 msgstr "" 1852 1853 #: includes/templates/bgr-group-criteria-settings.php:138 1854 msgid "Global criteria removed" 1855 msgstr "" 1856 1857 #: includes/templates/bgr-group-criteria-settings.php:155 1858 msgid "Save Criteria Settings" 1859 msgstr "" 1860 1861 #: includes/templates/bgr-group-criteria-settings.php:161 1862 msgid "Current Active Criteria" 1863 msgstr "" 1864 1865 #: includes/templates/bgr-group-criteria-settings.php:162 1866 msgid "These criteria will be shown on the review form for this group." 1694 1867 msgstr "" 1695 1868 … … 1845 2018 msgstr "" 1846 2019 1847 #: review-bp-grps.php:1 502020 #: review-bp-grps.php:149 1848 2021 msgid "BuddyPress Group Reviews requires the BuddyPress Groups Component to be active." 1849 2022 msgstr "" -
review-buddypress-groups/trunk/readme.txt
r3430846 r3431049 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 3. 6.08 Stable tag: 3.7.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 110 110 111 111 == Changelog == 112 113 = 3.7.0 = 114 * New: Group-Level Review Criteria - Group admins can now customize review criteria for their specific groups 115 * New: Site admin toggle to enable/disable group-level criteria customization 116 * New: Groups can use global criteria, select specific criteria, or add custom criteria 117 * New: Archived criteria tracking when global criteria are deactivated 118 * Fixed: jQuery deprecation warnings for .submit(), .mouseenter(), .mouseleave() methods 119 * Fixed: Added missing CSS file for group criteria admin panel 120 * Improved: Better separation of global vs group-specific review criteria 112 121 113 122 = 3.6.0 = -
review-buddypress-groups/trunk/review-bp-grps.php
r3430846 r3431049 16 16 * Plugin URI: https://wbcomdesigns.com/contact/ 17 17 * Description: This plugin allows BuddyPress Members to give reviews to BuddyPress groups on the site. The review form allows users to give text reviews and even rate the group based on multiple criteria. 18 * Version: 3. 6.018 * Version: 3.7.0 19 19 * Author: Wbcom Designs 20 20 * Author URI: http://wbcomdesigns.com … … 46 46 function bp_group_review_load_textdomain() { 47 47 $domain = 'bp-group-reviews'; 48 load_plugin_textdomain( $domain, false, plugin_basename( dirname( __FILE__ )) . '/languages' );48 load_plugin_textdomain( $domain, false, plugin_basename( __DIR__ ) . '/languages' ); 49 49 } 50 50 … … 55 55 * @author Wbcom Designs 56 56 */ 57 define( 'BGR_PLUGIN_VERSION', '3. 6.0' );57 define( 'BGR_PLUGIN_VERSION', '3.7.0' ); 58 58 define( 'BGR_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 59 59 define( 'BGR_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 60 60 61 61 if ( ! defined( 'BP_ROOT_BLOG' ) ) { 62 define( 'BP_ROOT_BLOG', 1 );62 define( 'BP_ROOT_BLOG', 1 ); 63 63 } 64 64 … … 120 120 function bp_group_review_admin_notice() { 121 121 if ( is_multisite() ) { 122 return;123 }122 return; 123 } 124 124 $bpquotes_plugin = esc_html__( 'BuddyPress Group Reviews', 'bp-group-reviews' ); 125 125 $bp_plugin = esc_html__( 'BuddyPress', 'bp-group-reviews' ); 126 126 echo '<div class="error"><p>'; 127 if ( class_exists( 'BuddyPress' ) ){128 if ( ! bp_is_active( 'groups' ) ){129 $bp_gp_component = esc_html__( 'BuddyPress Groups Component', 'bp-group-reviews' );127 if ( class_exists( 'BuddyPress' ) ) { 128 if ( ! bp_is_active( 'groups' ) ) { 129 $bp_gp_component = esc_html__( 'BuddyPress Groups Component', 'bp-group-reviews' ); 130 130 /* translators: %s: search term */ 131 echo sprintf( esc_html__( '%1$s requires %2$s to be installed and active, and the %3$s to be enabled.', 'bp-group-reviews' ), '<strong>' . esc_html( $bpquotes_plugin ) . '</strong>', '<strong>' . esc_html( $bp_plugin ) . '</strong>', '<strong>' . esc_html( $bp_gp_component ) . '</strong>' );131 printf( esc_html__( '%1$s requires %2$s to be installed and active, and the %3$s to be enabled.', 'bp-group-reviews' ), '<strong>' . esc_html( $bpquotes_plugin ) . '</strong>', '<strong>' . esc_html( $bp_plugin ) . '</strong>', '<strong>' . esc_html( $bp_gp_component ) . '</strong>' ); 132 132 } 133 133 } else { 134 134 /* translators: %s: search term */ 135 echo sprintf( esc_html__( '%1$s requires %2$s to be installed and active.', 'bp-group-reviews' ), '<strong>' . esc_html( $bpquotes_plugin ) . '</strong>', '<strong>' . esc_html( $bp_plugin ) . '</strong>' );135 printf( esc_html__( '%1$s requires %2$s to be installed and active.', 'bp-group-reviews' ), '<strong>' . esc_html( $bpquotes_plugin ) . '</strong>', '<strong>' . esc_html( $bp_plugin ) . '</strong>' ); 136 136 } 137 137 echo '</p></div>'; 138 139 138 } 140 139 … … 196 195 'includes/widgets/group-rating.php', 197 196 'includes/bgr-functions.php', 197 'includes/class-bgr-group-criteria.php', 198 'includes/bgr-group-criteria-functions.php', 199 'includes/bgr-group-criteria-ajax.php', 198 200 ); 199 201 foreach ( $include_files as $include_file ) { … … 202 204 } 203 205 } 206 207 // Initialize the group criteria singleton to register its hooks. 208 if ( class_exists( 'BGR_Group_Criteria' ) ) { 209 BGR_Group_Criteria::get_instance(); 210 } 204 211 } 205 212 … … 209 216 * @return void 210 217 */ 211 function bp_group_review_add_multi_support(){218 function bp_group_review_add_multi_support() { 212 219 include 'includes/class-bgr-multi-support.php'; 213 220 } … … 230 237 } 231 238 } 232 233 239 } 234 240 add_action( 'activated_plugin', 'bp_group_review_activation_redirect_settings' );
Note: See TracChangeset
for help on using the changeset viewer.