Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 779 Bytes

order_name.rst

File metadata and controls

40 lines (30 loc) · 779 Bytes

fast_events_order_name

The filter is called for every new order. Filter the name and return a WP_Error if necessary.

<?php
function your_filter_order_name( $name ) {
  if ( in_array( $name, array( 'Idiot', 'Moron' ) ) ) {
      return new WP_Error( 'invalid_name', 'This name is not allowed', array( 'status' => 400 ) );
  }
  return $name;
}

add_filter( 'fast_events_order_name', 'your_filter_order_name', 10, 1 );

Parameters

$name

(string) Name of the buyer.


Return

(string | WP_Error) The name or WP_Error.


Changelog

Version Description
2.2.0 Introduced.