We are using your plugin and we upgraded it to the last upgrade version. Nevertheless we cannot access the dashboard settings on wordpress.
When we go to settings, a window with a “notice” appears preventing the access to the dashboard and settings.
The notice says: “New: Serve images faster with Ultra Smush” with the explanation below of what it does.
By the way, we deactivate/activate the plugin while clearing caches but it didn’t make any difference.
So, what can we do to fix this issue and be able to access the smush dashboard and check/change our settings?
In advance, thank you for your help and interest!
]]>I’m going to list two separate ways to achieve what you’re looking for:
Solution 1: Easier Approach:
This code snippet does the following:
_order_key
), Billing Last Name (_billing_last_name
), and Billing Email (_billing_email
).function custom_woocommerce_shop_order_search_fields( $search_fields ) {
// Remove default search fields
$search_fields = array();
// Add custom search fields: Order ID, Billing Last Name, and Billing Email
$search_fields[] = '_order_key'; // Order ID
$search_fields[] = '_billing_last_name'; // Billing Last Name
$search_fields[] = '_billing_email'; // Billing Email
return $search_fields;
}
add_filter( 'woocommerce_shop_order_search_fields', 'custom_woocommerce_shop_order_search_fields' );
Solution 2: Comprehensive Approach:
This code snippet combines everything into one. It will:
The JavaScript is added to the admin footer and will execute on the order search page, adding the dropdown dynamically.
This approach ensures that all modifications are contained within a single function and are executed in the correct context.
function custom_woocommerce_order_search_dropdown_and_custom_search() {
// Add JavaScript to insert the dropdown
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
var dropdownHtml = '<select name="search_by" id="search_by" style="margin-right: 8px;">' +
'<option value="order_id">Order ID</option>' +
'<option value="email">Email</option>' +
'</select>';
$(dropdownHtml).insertBefore('#post-search-input');
});
</script>
<?php
// Modify the search query based on the selected option in the dropdown
add_filter( 'woocommerce_shop_order_search_fields', function ( $search_fields ) {
if ( isset( $_GET['search_by'] ) && 'email' === $_GET['search_by'] ) {
$search_fields = array('_billing_email'); // Search by Billing Email
} elseif ( isset( $_GET['search_by'] ) && 'order_id' === $_GET['search_by'] ) {
$search_fields = array('_order_key'); // Search by Order ID
}
return $search_fields;
}, 10, 2 );
}
add_action( 'admin_footer', 'custom_woocommerce_order_search_dropdown_and_custom_search' );
As always, testing on a staging environment first is highly recommended.
After adding either of these two solutions to your functions.php
file, your WooCommerce order search should only look through these specified fields, which could potentially speed up the search process.
It has its quirks; the setting language can sound a little technical, and the visible Jetpack guides appear to disable some gallery lightboxes whilst in WP Admin (editing mode).However, any initial worries have been replaced by happiness with a site that just works better. I haven’t delved into the Image Content Delivery Network, but everything else is set to ‘on’ with no bugs to report; even the lightboxes still run perfectly on the user side of the site.
I’d definitely recommend Jetpack Boost and the Jetpack brand, it just works!
]]>