Hallo, ich bin momentan dabei ein eigenes Plugin zu entwickeln und versuche die ATK Hook mit einzubinden.
Ich habe Folgenden Code:
Code
namespace Inc\Product;
use \Inc\Base\BaseController;
use \Inc\Api\SettingsApi;
/**
*
*/
class Nike extends BaseController {
function atkp_product_updated_callback2($product_id) {
require_once ATKP_PLUGIN_DIR.'/includes/atkp_product.php';
/* Get Woocommerce Product ID*/
$woo_product = atkp_product::get_woo_product($product_id);
$woocommerce_product_id = $woo_product->ID;
$name = ATKPTools::get_post_setting( $product_id, ATKP_PRODUCT_POSTTYPE.'_title');
/* Get Brand List */
$brand = 'Nike';
/* Check if brandname in product name */
$brandchecker = strpos($name, $brand);
if ($brandchecker === false) {
/* */
} else {
/* if true add to brand*/
ATKPTools::check_taxonomy($woocommerce_product_id, 'store', $brand); /* Add to the Woocommerce Store Taxonmy */
}
}
add_action('atkp_product_updated', 'atkp_product_updated_callback2');
}
Display More
Welcher auch mit Zb "Custom Functions" Funktioniert aber in meinem Plugin leider nicht ich bekomme immer diese Meldung
Parse error: syntax error, unexpected 'add_action' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in C:\xampp\htdocs\wordpress\wp-content\plugins\pluginname\inc\Product\nike.php on line 30
Und ich wollte dich fragen ob du mir sagen kannst was ich falsch gemacht habe?