Skip to content

Commit 723eb7a

Browse files
Merge pull request #83 from bigboxwc/release/1.15.0
release/1.15.0
2 parents 9b710a4 + 124acf3 commit 723eb7a

File tree

23 files changed

+1332
-2227
lines changed

23 files changed

+1332
-2227
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.15.0] - 2018-12-25
2+
3+
### New
4+
5+
- Gutenberg 3.9+ compatibility.
6+
- Continued codebase improvements.
7+
18
## [1.14.0] - 2018-08-25
29

310
### New

app/customize/output/editor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,21 @@
5151
]
5252
);
5353

54-
$type = [
54+
$type_base = [
5555
'font-weight' => $weight_base,
5656
'font-size' => "{$size}em",
5757
];
5858

5959
if ( $family ) {
60-
$type['font-family'] = $family;
60+
$type_base['font-family'] = $family;
6161
}
6262

6363
$css->add(
6464
[
6565
'selectors' => [
6666
'.mce-content-body',
6767
],
68-
'declarations' => $type,
68+
'declarations' => $type_base,
6969
]
7070
);
7171

app/integrations/facetwp/views/partials/navbar-search.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,44 @@
2626
*/
2727
$form_url = apply_filters( 'bigbox_navbar_search_form_url', wc_get_page_permalink( 'shop' ) );
2828

29-
$dropdown = FWP()->helper->get_facet_by_name( bigbox_get_navbar_search_source( 'dropdown', 'categories' ) );
30-
$search = FWP()->helper->get_facet_by_name( bigbox_get_navbar_search_source( 'search', 'keyword' ) );
29+
$dropdown_facet = FWP()->helper->get_facet_by_name( bigbox_get_navbar_search_source( 'dropdown', 'categories' ) );
30+
$search_facet = FWP()->helper->get_facet_by_name( bigbox_get_navbar_search_source( 'search', 'keyword' ) );
3131

32-
if ( ! ( $search || $dropdown ) ) :
32+
if ( ! ( $search_facet || $dropdown_facet ) ) :
3333
return;
3434
endif;
3535
?>
3636

3737
<form id="<?php echo esc_attr( bigbox_is_shop() ? 'facetwp-' : '' ); ?>primary-search" action="<?php echo esc_url( $form_url ); ?>" method="GET" class="navbar-search">
3838

3939
<?php
40-
$taxonomy = get_taxonomy( str_replace( 'tax/', '', $dropdown['source'] ) );
40+
$search_taxonomy = get_taxonomy( str_replace( 'tax/', '', $dropdown_facet['source'] ) );
4141

42-
if ( $taxonomy ) :
43-
$name = FWP()->helper->get_setting( 'prefix' ) . $dropdown['name'];
44-
$all = esc_html( isset( $dropdown['label_any'] ) ? $dropdown['label_any'] : __( 'All', 'bigbox' ) );
42+
if ( $search_taxonomy ) :
43+
$name = FWP()->helper->get_setting( 'prefix' ) . $dropdown_facet['name'];
44+
$all = esc_html( isset( $dropdown['label_any'] ) ? $dropdown_facet['label_any'] : __( 'All', 'bigbox' ) );
4545
?>
4646

4747
<div id="navbar-search__category" class="navbar-search__category">
4848
<label for="<?php echo esc_attr( $name ); ?>" class="screen-reader-text">
49-
<?php echo esc_html( $dropdown['label'] ); ?>:
49+
<?php echo esc_html( $dropdown_facet['label'] ); ?>:
5050
</label>
5151

5252
<div id="search-dropdown-real">
5353
<?php
5454
if ( bigbox_is_shop() && ! is_customize_preview() ) :
55-
echo facetwp_display( 'facet', $dropdown['name'] ); // WPCS: XSS okay.
55+
echo facetwp_display( 'facet', $dropdown_facet['name'] ); // WPCS: XSS okay.
5656
else :
5757
$navbar_search_dropdown = [
5858
'show_option_all' => $all,
5959
'name' => $name,
60-
'taxonomy' => $taxonomy->name,
61-
'hierarchical' => 'no' !== $dropdown['hierarchical'],
60+
'taxonomy' => $search_taxonomy->name,
61+
'hierarchical' => 'no' !== $dropdown_facet['hierarchical'],
6262
'value_field' => 'slug',
6363
'show_count' => true,
64-
'orderby' => $dropdown['orderby'],
64+
'orderby' => $dropdown_facet['orderby'],
6565
'order' => 'ASC',
66-
'number' => $dropdown['count'],
66+
'number' => $dropdown_facet['count'],
6767
];
6868

6969
wp_dropdown_categories(
@@ -88,21 +88,21 @@
8888
<?php
8989
endif;
9090

91-
if ( $search ) :
92-
$name = FWP()->helper->get_setting( 'prefix' ) . $search['name'];
91+
if ( $search_facet ) :
92+
$name = FWP()->helper->get_setting( 'prefix' ) . $search_facet['name'];
9393
?>
9494

9595
<div class="navbar-search__keywords">
9696
<label for="<?php echo esc_attr( $name ); ?>" class="screen-reader-text">
97-
<?php echo esc_html( $dropdown['label'] ); ?>:
97+
<?php echo esc_html( $dropdown_facet['label'] ); ?>:
9898
</label>
9999

100100
<?php
101101
if ( bigbox_is_shop() && ! is_customize_preview() ) :
102-
echo facetwp_display( 'facet', $search['name'] ); // WPCS: XSS okay.
102+
echo facetwp_display( 'facet', $search_facet['name'] ); // WPCS: XSS okay.
103103
else :
104104
?>
105-
<input type="search" id="<?php echo esc_attr( $name ); ?>" name="<?php echo esc_attr( $name ); ?>" class="form-input" placeholder="<?php echo esc_attr( $search['placeholder'] ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" />
105+
<input type="search" id="<?php echo esc_attr( $name ); ?>" name="<?php echo esc_attr( $name ); ?>" class="form-input" placeholder="<?php echo esc_attr( $search_facet['placeholder'] ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>" />
106106
<?php endif; ?>
107107
</div>
108108

app/integrations/woocommerce-product-vendors/template-functions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ function bigbox_wcpv_display_vendor_logo_profile() {
122122
$show_profile = get_option( 'wcpv_vendor_settings_vendor_display_profile', 'yes' );
123123

124124
if ( ! empty( $vendor_data['profile'] ) && 'yes' === $show_profile ) {
125-
echo '<div class="wcpv-vendor-profile entry-summary">' . wpautop( wp_kses_post( do_shortcode( $vendor_data['profile'] ) ) ) . '</div>' . PHP_EOL;
125+
echo '<div class="wcpv-vendor-profile entry-summary">';
126+
echo wpautop( wp_kses_post( do_shortcode( $vendor_data['profile'] ) ) ); // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
127+
echo '</div>';
126128
}
127129
}
128130

app/integrations/woocommerce-product-vendors/templates/shortcode-registration-form.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
*/
1313

1414
if ( ! defined( 'ABSPATH' ) ) {
15-
exit; // Exit if accessed directly
15+
exit; // Exit if accessed directly.
1616
}
17+
18+
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
19+
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
20+
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
1721
?>
1822

1923
<form class="wcpv-shortcode-registration-form">
@@ -63,7 +67,7 @@
6367
<textarea class="input-text" name="vendor_description" id="wcpv-vendor-description" rows="4" tabindex="7">
6468
<?php
6569
if ( ! empty( $_POST['vendor_description'] ) ) :
66-
echo esc_textarea( $_POST['vendor_description'] );
70+
echo esc_textarea( $_POST['vendor_description'] );
6771
endif;
6872
?>
6973
</textarea>

app/integrations/woocommerce/templates/cart/cart-totals.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@
9393
if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) :
9494
?>
9595

96-
<?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
96+
<?php foreach ( WC()->cart->get_tax_totals() as $code => $tax_total ) : ?>
9797
<div class="tax-rate action-list__item">
9898
<div id="tax-rate-<?php echo esc_attr( sanitize_title( $code ) ); ?>" class="action-list__item-label">
99-
<?php echo $tax->label . ': ' . $estimated_text; // WPCS: XSS okay. ?>
99+
<?php echo $tax_total->label . ': ' . $estimated_text; // WPCS: XSS okay. ?>
100100
</div>
101101
<div class="action-list__item-value action-list__item-value--no-flex" labelledby="tax-rate-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
102102
<span class="woocommerce-totals-plus">&plus; </span>
103-
<?php echo $tax->formatted_amount; // WPCS: XSS okay. ?>
103+
<?php echo $tax_total->formatted_amount; // WPCS: XSS okay. ?>
104104
</div>
105105
</div>
106106
<?php endforeach; ?>

app/integrations/woocommerce/templates/global/navbar-search.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
<form id="primary-search" action="<?php echo esc_url( $form_url ); ?>" method="GET" class="navbar-search">
3131

3232
<?php
33-
$taxonomy = get_taxonomy( bigbox_get_navbar_search_source( 'dropdown', 'product_cat' ) );
33+
$search_taxonomy = get_taxonomy( bigbox_get_navbar_search_source( 'dropdown', 'product_cat' ) );
3434

35-
if ( $taxonomy ) :
36-
$selected = isset( $_GET[ $taxonomy->name ] ) ? esc_attr( $_GET[ $taxonomy->name ] ) : null; // @codingStandardsIgnoreLine
35+
if ( $search_taxonomy ) :
36+
$selected = isset( $_GET[ $search_taxonomy->name ] ) ? esc_attr( $_GET[ $search_taxonomy->name ] ) : null; // @codingStandardsIgnoreLine
3737

3838
/* translators: %s Header dropdown "All" label. */
39-
$all = esc_html( sprintf( __( 'All %s', 'bigbox' ), strtolower( $taxonomy->labels->name ) ) );
39+
$all = esc_html( sprintf( __( 'All %s', 'bigbox' ), strtolower( $search_taxonomy->labels->name ) ) );
4040
?>
4141

4242
<div id="navbar-search__category" class="navbar-search__category">
43-
<label for="<?php echo esc_attr( $taxonomy->name ); ?>" class="screen-reader-text">
43+
<label for="<?php echo esc_attr( $search_taxonomy->name ); ?>" class="screen-reader-text">
4444
<?php
45-
/* translators: %s Header dropdown taxonomy name. */
46-
echo esc_html( sprintf( __( 'Choose a %s', 'bigbox' ), strtolower( $taxonomy->labels->singular_name ) ) );
45+
/* translators: %s Header dropdown search_taxonomy name. */
46+
echo esc_html( sprintf( __( 'Choose a %s', 'bigbox' ), strtolower( $search_taxonomy->labels->singular_name ) ) );
4747
?>
4848
:
4949
</label>
@@ -53,8 +53,8 @@
5353
$navbar_search_dropdown = [
5454
'show_option_all' => $all,
5555
'selected' => $selected,
56-
'name' => $taxonomy->name,
57-
'taxonomy' => $taxonomy->name,
56+
'name' => $search_taxonomy->name,
57+
'taxonomy' => $search_taxonomy->name,
5858
'hierarchical' => true,
5959
'value_field' => 'slug',
6060
'show_count' => true,

app/integrations/woocommerce/templates/loop/no-products-found.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
exit; // Exit if accessed directly.
2121
}
2222

23-
$tag = bigbox_is_integration_active( 'facetwp' ) ? 'li' : 'div';
23+
$html_tag = bigbox_is_integration_active( 'facetwp' ) ? 'li' : 'div';
2424
?>
2525

26-
<<?php echo esc_attr( $tag ); ?> class="woocommerce-info">
26+
<<?php echo esc_attr( $html_tag ); ?> class="woocommerce-info">
2727
<?php esc_html_e( 'No products were found matching your selection.', 'bigbox' ); ?>
2828
</<?php echo esc_attr( $tag ); ?>>

app/integrations/woocommerce/templates/order/order-details.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
exit;
2121
}
2222

23-
$order = wc_get_order( $order_id );
23+
$wc_order = wc_get_order( $order_id );
2424

2525
if ( ! $order ) :
2626
return;
2727
endif;
2828

29-
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
30-
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', [ 'completed', 'processing' ] ) );
29+
$order_items = $wc_order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
30+
$show_purchase_note = $wc_order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', [ 'completed', 'processing' ] ) );
3131
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
32-
$downloads = $order->get_downloadable_items();
33-
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted();
32+
$downloads = $wc_order->get_downloadable_items();
33+
$show_downloads = $wc_order->has_downloadable_item() && $wc_order->is_download_permitted();
3434
?>
3535

3636
<div class="woocommerce-receipt-wrapper">
@@ -49,19 +49,19 @@
4949
?>
5050

5151
<section class="woocommerce-order-details">
52-
<?php do_action( 'woocommerce_order_details_before_order_table', $order ); ?>
52+
<?php do_action( 'woocommerce_order_details_before_order_table', $wc_order ); ?>
5353

5454
<ul class="products products-main columns-1">
5555
<?php
56-
do_action( 'woocommerce_order_details_before_order_table_items', $order );
56+
do_action( 'woocommerce_order_details_before_order_table_items', $wc_order );
5757

5858
foreach ( $order_items as $item_id => $item ) :
5959
$product = $item->get_product();
6060

6161
wc_get_template(
6262
'order/order-details-item.php',
6363
[
64-
'order' => $order,
64+
'order' => $wc_order,
6565
'item_id' => $item_id,
6666
'item' => $item,
6767
'show_purchase_note' => $show_purchase_note,
@@ -71,20 +71,20 @@
7171
);
7272
endforeach;
7373

74-
do_action( 'woocommerce_order_details_after_order_table_items', $order );
74+
do_action( 'woocommerce_order_details_after_order_table_items', $wc_order );
7575
?>
7676
</ul>
7777

7878
<table class="woocommerce-table woocommerce-table--order-details shop_table order_details">
7979
<tfoot>
80-
<?php foreach ( $order->get_order_item_totals() as $key => $total ) : ?>
80+
<?php foreach ( $wc_order->get_order_item_totals() as $key => $total ) : ?>
8181
<tr>
8282
<th scope="row"><?php echo esc_html( $total['label'] ); ?></th>
8383
<td><?php echo wp_kses_post( $total['value'] ); ?></td>
8484
</tr>
8585
<?php endforeach; ?>
8686

87-
<?php if ( $order->get_customer_note() ) : ?>
87+
<?php if ( $wc_order->get_customer_note() ) : ?>
8888
<tr>
8989
<th><?php esc_html_e( 'Note:', 'bigbox' ); ?></th>
9090
<td><?php echo wp_kses_post( wptexturize( $order->get_customer_note() ) ); ?></td>
@@ -93,13 +93,13 @@
9393
</tfoot>
9494
</table>
9595

96-
<?php do_action( 'woocommerce_order_details_after_order_table', $order ); ?>
96+
<?php do_action( 'woocommerce_order_details_after_order_table', $wc_order ); ?>
9797
</section>
9898
</div>
9999

100100
<?php if ( $show_customer_details ) : ?>
101101
<div class="woocommerce-receipt-wrapper__info">
102-
<?php wc_get_template( 'order/order-details-customer.php', [ 'order' => $order ] ); ?>
102+
<?php wc_get_template( 'order/order-details-customer.php', [ 'order' => $wc_order ] ); ?>
103103
</div>
104104
<?php endif; ?>
105105
</div>

app/integrations/woocommerce/templates/single-product/tabs/tabs.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
*
2828
* @see woocommerce_default_product_tabs()
2929
*/
30-
$tabs = apply_filters( 'woocommerce_product_tabs', [] );
30+
$wc_tabs = apply_filters( 'woocommerce_product_tabs', [] );
3131

3232
if ( ! empty( $tabs ) ) : ?>
3333

3434
<div class="woocommerce-single-product-data">
3535

3636
<?php
37-
foreach ( $tabs as $key => $tab ) :
38-
if ( isset( $tab['callback'] ) ) :
37+
foreach ( $wc_tabs as $key => $wc_tab ) :
38+
if ( isset( $wc_tab['callback'] ) ) :
3939
ob_start();
4040

41-
call_user_func( $tab['callback'] );
41+
call_user_func( $wc_tab['callback'] );
4242

4343
$content = trim( ob_get_clean() );
4444

0 commit comments

Comments
 (0)