This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Автоматическое удаление изображений Woocommerce после удаления продукта | |
// Automatically Delete Woocommerce Images After Deleting a Product | |
add_action( 'before_delete_post', 'delete_product_images', 10, 1 ); | |
function delete_product_images( $post_id ) | |
{ | |
$product = wc_get_product( $post_id ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Добавляем поле описания в форму редактирования атрибута | |
add_action( 'woocommerce_after_edit_attribute_fields', 'scf_atts_fields', 20 ); | |
function scf_atts_fields() { | |
$term_descr = get_term_meta( $_GET['edit'], 'descr', true ) ? get_term_meta( $_GET['edit'], 'descr', true ) : ''; | |
?> | |
<tr class="form-field form-required"> | |
<th scope="row" valign="top"> | |
<label>Описание атрибута</label> | |
</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Сортировка атрибутов в админке по алфавиту | |
* | |
* @param $attr | |
* | |
* @return array | |
* | |
* @testedwith WooCommerce 6.0 | |
* @author Artem Abramovich | |
*/ |
NewerOlder