Used For Variations checkbox

This customization requires the PW Bulk Edit Pro version.

The “Used For Variations” checkbox can be added to the bulk editor by following these steps:

1. Download the free Code Snippets plugin https://wordpress.org/plugins/code-snippets/
2. Create a Snippet with the following code (Note: If you are more comfortable with editing your functions.php you can do that instead of Code Snippets.):

function pw_bulk_edit_custom_columns( $columns ) {
    $attributes = PWBE_Attributes::get_attributes();
    foreach ( $attributes as $attribute ) {
        $columns[] = array(
            'name' => $attribute['name'] . ' used for variations',
            'type' => 'checkbox',
            'table' => 'attributes',
            'field' => '_attribute_variations_' . $attribute['slug'],
            'readonly' => 'false',
            'visibility' => 'parent',
            'sortable' => 'false',
            'views' => array( 'all' )
        );
    }

    return $columns;
}
add_filter( 'pwbe_product_columns', 'pw_bulk_edit_custom_columns' );
By default, when you check the “Used for Variations” checkbox in the bulk editor, all appropriate Variations will be created automatically. If you do not want to automatically create the Variations, include the following line after the code above:
define( 'PWBE_IS_VARIATION_CREATES_ALL_VARIATIONS', false );
Skip to content