Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'admin_init', 'auto_add_jeg_font_preview' );
- /**
- * Auto add Jeg Font Preview Data to all product on sale.
- */
- function auto_add_jeg_font_preview() {
- // Get FONT data from product ID.
- $custom_meta = get_post_meta( 165, 'jfp-woocommerce-settings', true ); /* change 165 with your product ID */
- // Get All product on sale.
- $sale_products = wc_get_product_ids_on_sale();
- /**
- * Add Font data to all sale product.
- */
- foreach ( $sale_products as $product_id ) {
- update_post_meta( $product_id, 'jfp-woocommerce-settings', $custom_meta );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment