Created
December 10, 2015 19:14
-
-
Save aiiddqd/c9e9634136869592f744 to your computer and use it in GitHub Desktop.
Сохраним значение поля через форму
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
//Сохранение данных поля uuid для категории продуктов | |
function mss_uuid_product_cat_form_edit($term_id){ | |
if ( ! isset( $_POST['mss_uuid_product_cat'] ) || ! wp_verify_nonce( $_POST['mss_uuid_product_cat_nonce'], basename( __FILE__ ) ) ) | |
return; | |
$mss_uuid_product_cat = $_POST['mss_uuid_product_cat']; | |
if(empty($mss_uuid_product_cat)) { | |
delete_term_meta( $term_id, 'uuid_product_category_mss' ); | |
} else { | |
update_term_meta( $term_id, 'uuid_product_category_mss', $mss_uuid_product_cat ); | |
} | |
} | |
add_action( 'edit_product_cat', 'mss_uuid_product_cat_form_edit' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment