**
* Remove the generated product schema markup from Product Category and Shop pages.
*/
function wc_remove_product_schema_product_archive() {
remove_action( 'woocommerce_shop_loop', array( WC()->structured_data, 'generate_product_data' ), 10, 0 );
}
add_action( 'woocommerce_init', 'wc_remove_product_schema_product_archive' );
<?php
add_action('before_delete_post', 'wps_remove_attachment_with_post', 10);
function wps_remove_attachment_with_post($post_id)
{
// We check if the global post type isn't ours and just return
global $post_type;
if ($post_type != 'my_product_post_type')
return;
$media = get_attached_media('image', $post_id);
foreach ($media as $image) {
wp_delete_attachment($image->ID, true);
}
}
?>
<?php
$value = ... // значение из базы
?>
<input type="radio" name="rt1" value="1" <?php echo $value == 1 ? 'checked' : ''; ?>/>1
<input type="radio" name="rt1" value="2" <?php echo $value == 2 ? 'checked' : ''; ?>/>2
<input type="radio" name="rt1" value="3" <?php echo $value == 3 ? 'checked' : ''; ?>/>3