LLMS_Transaction::get_creation_args( int $order_id )
Retrieves the array of default arguments to pass to {@see LLMS_Transaction::create()} when creating a new post.
Parameters Parameters
- $order_id
-
(int) (Required) LLMS_Order ID of the related order.
Return Return
(array)
Source Source
File: includes/models/model.llms.transaction.php
protected function get_creation_args( $order_id = 0 ) {
$date = llms_current_time( 'mysql' );
$title = sprintf(
// Translators: %1$d = Order ID; %2$s = Transaction creation date.
__( 'Transaction for Order #%1$d – %2$s', 'lifterlms' ),
$order_id,
date_format( date_create( $date ), 'M d, Y @ h:i A' )
);
// This filter is documented in includes/abstracts/abstract.llms.post.model.php.
return apply_filters(
"llms_{$this->model_post_type}_get_creation_args",
array(
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_author' => 0,
'post_content' => '',
'post_date' => $date,
'post_excerpt' => '',
'post_password' => uniqid( 'order_' ),
'post_status' => 'llms-' . apply_filters( 'llms_default_order_status', 'txn-pending' ),
'post_title' => $title,
'post_type' => $this->get( 'db_post_type' ),
),
$this
);
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.9.0 | Remove usage of deprecated strftime(). |
| 3.37.6 | Add a default date information using llms_current_time(). Remove ordering placeholders from strftime(). |
| 3.0.0 | Introduced. |