0

First i tried this one

add_action('template_redirect', 'hooker');
function hooker(){

    delete_post_meta( 1054, 'Душ, шт.');
    delete_post_meta( 1054, 'Ванная, шт.');
    delete_post_meta( 1054, 'Кол-во пользователей');
}

It doesn't work, i understood they are in array and i need something like this:

$attributes = get_post_meta( $product_id, '_product_attributes' );

Than find ones i need and do

update_post_meta($product_id, '_product_attributes', $product_attributes);

Is it a proper way to do this? How can I delete that attributes in array?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.