Some minor improvements in the custom orders table implmentation.
This commit is contained in:
parent
746d6a99b1
commit
71cc725bb5
|
@ -275,7 +275,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
|
|||
break;
|
||||
|
||||
case 'info':
|
||||
echo '<tr><th scope="row" class="titledesc"/><td style="' . esc_html( $value['css'] ) . '">';
|
||||
echo '<tr><th scope="row" class="titledesc"/><td style="' . esc_attr( $value['css'] ) . '">';
|
||||
echo wp_kses_post( wpautop( wptexturize( $value['text'] ) ) );
|
||||
echo '</td></tr>';
|
||||
break;
|
||||
|
@ -443,7 +443,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
|
|||
name="<?php echo esc_attr( $value['id'] ); ?>"
|
||||
value="<?php echo esc_attr( $key ); ?>"
|
||||
type="radio"
|
||||
<?php if(in_array($key, $disabled_values)) { echo 'disabled'; } ?>
|
||||
<?php if( in_array( $key, $disabled_values ) ) { echo 'disabled'; } ?>
|
||||
style="<?php echo esc_attr( $value['css'] ); ?>"
|
||||
class="<?php echo esc_attr( $value['class'] ); ?>"
|
||||
<?php echo implode( ' ', $custom_attributes ); // WPCS: XSS ok. ?>
|
||||
|
|
|
@ -322,19 +322,19 @@ class CustomOrdersTableController {
|
|||
|
||||
if ( $sync_is_pending ) {
|
||||
$initial_pending_count = $sync_status['initial_pending_count'];
|
||||
$current_pending_count = $sync_status['current_pending_count'];
|
||||
if ( $initial_pending_count ) {
|
||||
$text = sprintf(
|
||||
/* translators: %1$s=current number of orders pending sync, %2$s=initial number of orders pending sync */
|
||||
__( 'There are %1$s orders (out of a total of %2$s) pending sync!', 'woocommerce' ),
|
||||
$sync_status['current_pending_count'],
|
||||
$initial_pending_count
|
||||
);
|
||||
$text =
|
||||
sprintf(
|
||||
/* translators: %1$s=current number of orders pending sync, %2$s=initial number of orders pending sync */
|
||||
_n( 'There\'s %1$s order (out of a total of %2$s) pending sync!', 'There are %1$s orders (out of a total of %2$s) pending sync!', $current_pending_count, 'woocommerce' ),
|
||||
$current_pending_count,
|
||||
$initial_pending_count
|
||||
);
|
||||
} else {
|
||||
$text = sprintf(
|
||||
/* translators: %1$s=current number of orders pending sync */
|
||||
__( 'There are %1$s orders pending sync!', 'woocommerce' ),
|
||||
$sync_status['current_pending_count']
|
||||
);
|
||||
$text =
|
||||
/* translators: %s=initial number of orders pending sync */
|
||||
sprintf( _n( 'There\'s %s order pending sync!', 'There are %s orders pending sync!', $current_pending_count, 'woocommerce' ), $current_pending_count, 'woocommerce' );
|
||||
}
|
||||
|
||||
if ( $this->data_synchronizer->pending_data_sync_is_in_progress() ) {
|
||||
|
|
|
@ -159,12 +159,10 @@ class DataSynchronizer {
|
|||
$missing_orders_count_sql = "SELECT COUNT(1) FROM $orders_table WHERE post_id IS NULL";
|
||||
} else {
|
||||
$missing_orders_count_sql = "
|
||||
SELECT COUNT(1) FROM (
|
||||
SELECT posts.ID,orders.post_id FROM $wpdb->posts posts
|
||||
LEFT JOIN $orders_table orders ON posts.ID = orders.post_id
|
||||
WHERE posts.post_type='shop_order' AND orders.post_id IS NULL
|
||||
AND posts.post_status != 'auto-draft'
|
||||
) x";
|
||||
SELECT COUNT( posts.ID ) FROM $wpdb->posts posts
|
||||
LEFT JOIN $orders_table orders ON posts.ID = orders.post_id
|
||||
WHERE posts.post_type='shop_order' AND orders.post_id IS NULL
|
||||
AND posts.post_status != 'auto-draft'";
|
||||
}
|
||||
|
||||
$sql = "
|
||||
|
|
Loading…
Reference in New Issue