Advertisement
julien731

AS EDD SL License Optional

Sep 6th, 2016
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. if ( function_exists( 'asedd_cf_param_product_license' ) ) {
  2.     add_filter( 'as_edd_product_license_field_args', 'wpas_edd_sl_license_optional' );
  3.     /**
  4.      * Make the license field optional
  5.      *
  6.      * Removed the "required" attribute from the license field displayed in the ticket submission form.
  7.      *
  8.      * @param array $args Custom field arguments
  9.      *
  10.      * @return array
  11.      */
  12.     function wpas_edd_sl_license_optional( $args ) {
  13.  
  14.         $args['required'] = false;
  15.  
  16.         return $args;
  17.  
  18.     }
  19. }
  20.  
  21. if ( function_exists( 'asedd_check_license_key' ) ) {
  22.     /**
  23.      * Remove license validity verification on ticket submission process
  24.      */
  25.     remove_filter( 'wpas_before_submit_new_ticket_checks', 'asedd_check_license_key', 10 );
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement