woocommerce_rest_insert_{$this->post_type}_object

woocommerce_rest_insert_{$this->post_type}_object

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

do_action('woocommerce_rest_insert_{$this->post_type}_object') is found 2 times:

  • /includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php line 221
    			 * @param WC_Data         $object    Inserted object.
    			 * @param WP_REST_Request $request   Request object.
    			 * @param boolean         $creating  True when creating object, false when updating.
    			 */
    			do_action( "woocommerce_rest_insert_{$this->post_type}_object", $object, $request, true );
    		} catch ( WC_Data_Exception $e ) {
    			$object->delete();
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    		} catch ( WC_REST_Exception $e ) {
    			$object->delete();
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
    
  • /includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php line 268
    			 * @param WC_Data         $object    Inserted object.
    			 * @param WP_REST_Request $request   Request object.
    			 * @param boolean         $creating  True when creating object, false when updating.
    			 */
    			do_action( "woocommerce_rest_insert_{$this->post_type}_object", $object, $request, false );
    		} catch ( WC_Data_Exception $e ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    		} catch ( WC_REST_Exception $e ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
    		}
    
    

See this hook used in plugins: