__( 'Exclusive Drop', 'hyperdrop' ), 'target' => 'hyperdrop_drop_panel', 'class' => array(), 'priority' => 75, ); return $tabs; } public static function panel() { global $post; $s = HyperDrop_Drop::settings( $post->ID ); ?>
get_id() ) ) { return; } $product->update_meta_data( '_hyperdrop_enabled', isset( $_POST['_hyperdrop_enabled'] ) ? 'yes' : 'no' ); $product->update_meta_data( '_hyperdrop_testing', isset( $_POST['_hyperdrop_testing'] ) ? 'yes' : 'no' ); $sch = HyperDrop_Schedule::from_input( isset( $_POST['_hyperdrop_sch_start'] ) ? sanitize_text_field( wp_unslash( $_POST['_hyperdrop_sch_start'] ) ) : '', isset( $_POST['_hyperdrop_sch_release'] ) ? sanitize_text_field( wp_unslash( $_POST['_hyperdrop_sch_release'] ) ) : '', isset( $_POST['_hyperdrop_sch_end'] ) ? sanitize_text_field( wp_unslash( $_POST['_hyperdrop_sch_end'] ) ) : '', ! empty( $_POST['_hyperdrop_sch_notify'] ) ); if ( is_array( $sch ) ) { $product->update_meta_data( '_hyperdrop_start_at', $sch[0] ); $product->update_meta_data( '_hyperdrop_release_at', $sch[1] ); $product->update_meta_data( '_hyperdrop_end_at', $sch[2] ); $product->update_meta_data( '_hyperdrop_notify_start', $sch[3] ? 'yes' : 'no' ); } else { HyperDrop_Schedule::flash_error( $sch ); } $signup = isset( $_POST['_hyperdrop_signup'] ) ? sanitize_key( wp_unslash( $_POST['_hyperdrop_signup'] ) ) : 'auto'; $product->update_meta_data( '_hyperdrop_signup', array_key_exists( $signup, HyperDrop_Drop::signup_modes() ) ? $signup : 'auto' ); $product->update_meta_data( '_hyperdrop_max_qty', isset( $_POST['_hyperdrop_max_qty'] ) ? absint( $_POST['_hyperdrop_max_qty'] ) : 0 ); $product->update_meta_data( '_hyperdrop_message', isset( $_POST['_hyperdrop_message'] ) ? sanitize_textarea_field( wp_unslash( $_POST['_hyperdrop_message'] ) ) : '' ); /** Add-ons save their own fields here (the nonce is already verified). */ do_action( 'hyperdrop_save_product', $product ); } public static function column( $cols ) { $cols['hyperdrop'] = __( 'Drop', 'hyperdrop' ); return $cols; } public static function column_value( $col, $post_id ) { if ( 'hyperdrop' !== $col ) { return; } $s = HyperDrop_Drop::settings( $post_id ); if ( ! $s['enabled'] ) { echo '–'; } elseif ( 'upcoming' === HyperDrop_Schedule::phase( 'p:' . $post_id ) ) { echo 'โณ'; } elseif ( 'ended' === HyperDrop_Schedule::phase( 'p:' . $post_id ) ) { echo 'โ'; } elseif ( HyperDrop_Drop::is_gated( $post_id ) ) { echo '๐'; } else { echo '๐'; } } }