Skip to content

Commit

Permalink
[REF] woocommerce-acf: rename the plugin to a more suitable name
Browse files Browse the repository at this point in the history
  • Loading branch information
eantones committed Nov 4, 2024
1 parent 3d3332d commit 791affc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ACF WooCommerce
# WooCommerce ACF

**Version:** 1.0.0<br>
**Version:** 1.0.1<br>
**Author:** NuoBiT Solutions, S.L.<br>
**License:** GPLv3 or later

Expand Down
12 changes: 6 additions & 6 deletions acf-woocommerce.php → woocommerce-acf.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/**
* Plugin Name: ACF WooCommerce
* Plugin URI: https://github.com/yourusername/acf-to-wc-rest-api
* Plugin Name: WooCommerce ACF
* Plugin URI: https://github.com/nuobit/woocommerce-acf
* Description: Handles updating Advanced Custom Fields (ACF) repeater fields through the WooCommerce REST API.
* Version: 1.0.0
* Version: 1.0.1
* Author: NuoBiT Solutions, S.L.
* Author URI: https://www.nuobit.com/
* License: GPLv3 or later
* Text Domain: acf-to-wc-rest-api
* Text Domain: woocommerce-acf
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/

Expand All @@ -17,7 +17,7 @@
}

// Add a filter to modify the product object before it's inserted via the WooCommerce REST API
add_filter('woocommerce_rest_pre_insert_product_object', 'acf_repeater_to_woocommerce_rest_pre_insert_product_object', 10, 2);
add_filter('woocommerce_rest_pre_insert_product_object', 'woocommerce_acf_repeater_rest_pre_insert_product_object', 10, 2);

/**
* Handles updating ACF repeater fields through the WooCommerce REST API.
Expand All @@ -26,7 +26,7 @@
* @param WP_REST_Request $request The request object from the REST API.
* @return WC_Product The modified product object.
*/
function acf_repeater_to_woocommerce_rest_pre_insert_product_object( $product, $request ) {
function woocommerce_acf_repeater_rest_pre_insert_product_object( $product, $request ) {
// Check if 'meta_data' is set and is an array in the request
if ( isset( $request['meta_data'] ) && is_array( $request['meta_data'] ) ) {
$meta_data = $request['meta_data'];
Expand Down

0 comments on commit 791affc

Please sign in to comment.