From 61da4c6161dfc5ba6a1dfbb78ce22934aab27ec3 Mon Sep 17 00:00:00 2001 From: Chris Greys Date: Wed, 12 Apr 2023 16:52:18 +0900 Subject: [PATCH 01/11] Dev - Allow to filter wc_help_tip output (#37485) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: NĂ©stor Soriano --- plugins/woocommerce/changelog/fix-36543 | 4 ++++ .../woocommerce/includes/wc-core-functions.php | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/fix-36543 diff --git a/plugins/woocommerce/changelog/fix-36543 b/plugins/woocommerce/changelog/fix-36543 new file mode 100644 index 00000000000..483efbe86c4 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-36543 @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Dev - Allow to filter wc_help_tip diff --git a/plugins/woocommerce/includes/wc-core-functions.php b/plugins/woocommerce/includes/wc-core-functions.php index 68d88a6ec12..9c1d0a57248 100644 --- a/plugins/woocommerce/includes/wc-core-functions.php +++ b/plugins/woocommerce/includes/wc-core-functions.php @@ -1593,12 +1593,24 @@ function wc_back_link( $label, $url ) { */ function wc_help_tip( $tip, $allow_html = false ) { if ( $allow_html ) { - $tip = wc_sanitize_tooltip( $tip ); + $sanitized_tip = wc_sanitize_tooltip( $tip ); } else { - $tip = esc_attr( $tip ); + $sanitized_tip = esc_attr( $tip ); } - return ''; + /** + * Filter the help tip. + * + * @since 7.7.0 + * + * @param string $tip_html Help tip HTML. + * @param string $sanitized_tip Sanitized help tip text. + * @param string $tip Original help tip text. + * @param bool $allow_html Allow sanitized HTML if true or escape. + * + * @return string + */ + return apply_filters( 'wc_help_tip', '', $sanitized_tip, $tip, $allow_html ); } /** From e8c8581a4ec4b2bde461835e702e14ebbffb6965 Mon Sep 17 00:00:00 2001 From: Chris Lilitsas Date: Wed, 12 Apr 2023 10:54:58 +0300 Subject: [PATCH 02/11] Fix TT2 styles and typography in the single product's attributes table (#37639) --- .../changelog/fix-37636-attributes-table | 4 ++++ .../client/legacy/css/twenty-twenty-two.scss | 22 ++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/fix-37636-attributes-table diff --git a/plugins/woocommerce/changelog/fix-37636-attributes-table b/plugins/woocommerce/changelog/fix-37636-attributes-table new file mode 100644 index 00000000000..547c8a21564 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-37636-attributes-table @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fixed the attributes table styling in TT2 tabs content area diff --git a/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss b/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss index be8519c50e1..dfd10c6d8f7 100644 --- a/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss +++ b/plugins/woocommerce/client/legacy/css/twenty-twenty-two.scss @@ -594,9 +594,29 @@ ul.wc-tabs { font-size: var(--wp--preset--font-size--small); margin-left: 1em; - h2 { + // Hide repeated heading. + h2:first-of-type { display: none; } + + // Attributes table styles. + table.woocommerce-product-attributes { + tbody { + + td, th { + padding: 0.2rem 0.2rem 0.2rem 0; + + p { + margin: 0; + } + } + + th { + text-align: left; + padding-right: 1rem; + } + } + } } /** From 77bdd24aa8a3c8314bd65e7cab123d456bc91607 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 12 Apr 2023 16:46:21 +0800 Subject: [PATCH 03/11] Revert "Check min. WP and PHP versions before suggesting plugins" (#37674) Revert "Check min. WP and PHP versions before suggesting plugins (#37611)" This reverts commit 30536f636ed8b5b2acb57d40ab37c3af8d900084. --- ...ate-16525-check-php-version-for-extensions | 4 --- .../DefaultFreeExtensions.php | 26 ++++++++----------- .../EvaluateExtension.php | 9 ------- 3 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 plugins/woocommerce/changelog/update-16525-check-php-version-for-extensions diff --git a/plugins/woocommerce/changelog/update-16525-check-php-version-for-extensions b/plugins/woocommerce/changelog/update-16525-check-php-version-for-extensions deleted file mode 100644 index 9cb44346db3..00000000000 --- a/plugins/woocommerce/changelog/update-16525-check-php-version-for-extensions +++ /dev/null @@ -1,4 +0,0 @@ -Significance: minor -Type: update - -Support min_php_version and min_wp_version for the free extensions feed diff --git a/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php b/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php index e893afd283e..99055062238 100644 --- a/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php +++ b/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php @@ -79,18 +79,17 @@ class DefaultFreeExtensions { public static function get_plugin( $slug ) { $plugins = array( 'google-listings-and-ads' => [ - 'min_php_version' => '7.4', - 'name' => __( 'Google Listings & Ads', 'woocommerce' ), - 'description' => sprintf( + 'name' => __( 'Google Listings & Ads', 'woocommerce' ), + 'description' => sprintf( /* translators: 1: opening product link tag. 2: closing link tag */ __( 'Drive sales with %1$sGoogle Listings and Ads%2$s', 'woocommerce' ), '', '' ), - 'image_url' => plugins_url( '/assets/images/onboarding/google.svg', WC_PLUGIN_FILE ), - 'manage_url' => 'admin.php?page=wc-admin&path=%2Fgoogle%2Fstart', - 'is_built_by_wc' => true, - 'is_visible' => [ + 'image_url' => plugins_url( '/assets/images/onboarding/google.svg', WC_PLUGIN_FILE ), + 'manage_url' => 'admin.php?page=wc-admin&path=%2Fgoogle%2Fstart', + 'is_built_by_wc' => true, + 'is_visible' => [ [ 'type' => 'not', 'operand' => [ @@ -126,12 +125,11 @@ class DefaultFreeExtensions { 'is_built_by_wc' => false, ], 'pinterest-for-woocommerce' => [ - 'name' => __( 'Pinterest for WooCommerce', 'woocommerce' ), - 'description' => __( 'Get your products in front of Pinners searching for ideas and things to buy.', 'woocommerce' ), - 'image_url' => plugins_url( '/assets/images/onboarding/pinterest.png', WC_PLUGIN_FILE ), - 'manage_url' => 'admin.php?page=wc-admin&path=%2Fpinterest%2Flanding', - 'is_built_by_wc' => true, - 'min_php_version' => '7.3', + 'name' => __( 'Pinterest for WooCommerce', 'woocommerce' ), + 'description' => __( 'Get your products in front of Pinners searching for ideas and things to buy.', 'woocommerce' ), + 'image_url' => plugins_url( '/assets/images/onboarding/pinterest.png', WC_PLUGIN_FILE ), + 'manage_url' => 'admin.php?page=wc-admin&path=%2Fpinterest%2Flanding', + 'is_built_by_wc' => true, ], 'pinterest-for-woocommerce:alt' => [ 'name' => __( 'Pinterest for WooCommerce', 'woocommerce' ), @@ -351,7 +349,6 @@ class DefaultFreeExtensions { DefaultPaymentGateways::get_rules_for_cbd( false ), ], 'is_built_by_wc' => true, - 'min_wp_version' => '5.9', ], 'woocommerce-services:shipping' => [ 'description' => sprintf( @@ -519,7 +516,6 @@ class DefaultFreeExtensions { ], ], 'is_built_by_wc' => false, - 'min_wp_version' => '6.0', ], 'mailpoet' => [ 'name' => __( 'MailPoet', 'woocommerce' ), diff --git a/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/EvaluateExtension.php b/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/EvaluateExtension.php index 8256be19ce3..100dd94a125 100644 --- a/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/EvaluateExtension.php +++ b/plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/EvaluateExtension.php @@ -21,7 +21,6 @@ class EvaluateExtension { * @return object The evaluated extension. */ public static function evaluate( $extension ) { - global $wp_version; $rule_evaluator = new RuleEvaluator(); if ( isset( $extension->is_visible ) ) { @@ -31,14 +30,6 @@ class EvaluateExtension { $extension->is_visible = true; } - if ( isset( $extension->min_php_version ) ) { - $extension->is_visible = version_compare( PHP_VERSION, $extension->min_php_version, '>=' ); - } - - if ( isset( $extension->min_wp_version ) ) { - $extension->is_visible = version_compare( $wp_version, $extension->min_wp_version, '>=' ); - } - $installed_plugins = PluginsHelper::get_installed_plugin_slugs(); $activated_plugins = PluginsHelper::get_active_plugin_slugs(); $extension->is_installed = in_array( explode( ':', $extension->key )[0], $installed_plugins, true ); From 2722ef4763d0fab378be0ac6f7e03af2f848b421 Mon Sep 17 00:00:00 2001 From: Fernando Marichal Date: Wed, 12 Apr 2023 14:30:15 -0300 Subject: [PATCH 04/11] Item controls for attribute creation are always visible (#37620) * Fix dropdown menu style * Move items * Add changelog * Remove class `select` --------- Co-authored-by: Fernando Marichal --- ...37159_item_controls_for_attribute_always_visible | 4 ++++ plugins/woocommerce/client/legacy/css/admin.scss | 13 +++---------- .../meta-boxes/views/html-product-attribute.php | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 plugins/woocommerce/changelog/dev-37159_item_controls_for_attribute_always_visible diff --git a/plugins/woocommerce/changelog/dev-37159_item_controls_for_attribute_always_visible b/plugins/woocommerce/changelog/dev-37159_item_controls_for_attribute_always_visible new file mode 100644 index 00000000000..07536bf189a --- /dev/null +++ b/plugins/woocommerce/changelog/dev-37159_item_controls_for_attribute_always_visible @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Item controls for attribute creation are always visible diff --git a/plugins/woocommerce/client/legacy/css/admin.scss b/plugins/woocommerce/client/legacy/css/admin.scss index ad9a3e3d1cf..5548210a923 100644 --- a/plugins/woocommerce/client/legacy/css/admin.scss +++ b/plugins/woocommerce/client/legacy/css/admin.scss @@ -1130,6 +1130,7 @@ $default-line-height: 18px; } .toolbar-top { .button, + .attribute_taxonomy, .select2-container { margin: 1px; } @@ -5620,6 +5621,7 @@ img.help_tip { a.delete, a.edit { float: right; + margin-right: 12px; } a.delete { @@ -5655,7 +5657,7 @@ img.help_tip { .handlediv { background-position: 6px 5px !important; - visibility: hidden; + margin: 4px 0 -1px !important; height: 26px; } @@ -5671,7 +5673,6 @@ img.help_tip { a.delete, a.edit, - .handlediv, .sort { margin-top: 0.25em; } @@ -5684,14 +5685,6 @@ img.help_tip { } } - h3:hover, - &.ui-sortable-helper { - a.delete, - .handlediv { - visibility: visible; - } - } - table { width: 100%; position: relative; diff --git a/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php b/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php index 50efad423aa..80587895b71 100644 --- a/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php +++ b/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-attribute.php @@ -5,9 +5,9 @@ if ( ! defined( 'ABSPATH' ) ) { ?>

-
+ get_name() !== '' ? wc_attribute_label( $attribute->get_name() ) : __( 'Custom attribute', 'woocommerce' ) ); ?>