LLMS_Notification_Controller_Purchase_Receipt::get_test_settings( string $type )
Get an array of LifterLMS Admin Page settings to send test notifications
Parameters Parameters
- $type
-
(string) (Required) Notification type [basic|email].
Return Return
(array)
Source Source
File: includes/notifications/controllers/class.llms.notification.controller.purchase.receipt.php
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | public function get_test_settings( $type ) { $query = new WP_Query( array ( 'post_type' => 'llms_transaction' , 'posts_per_page' => 25, ) ); $options = array ( '' => '' , ); foreach ( $query ->posts as $post ) { $transaction = llms_get_post( $post ); $order = $transaction ->get_order(); $student = llms_get_student( $order ->get( 'user_id' ) ); if ( $transaction && $student ) { $options [ $transaction ->get( 'id' ) ] = esc_attr( sprintf( // Translators: %1$d = The Order ID; %2$s The customer's full name; %3$s The product title. __( 'Order #%1$d from %2$s for "%3$s"' , 'lifterlms' ), $order ->get( 'id' ), $student ->get_name(), $order ->get( 'product_title' ) ) ); } } return array ( array ( 'class' => 'llms-select2' , 'custom_attributes' => array ( 'data-allow-clear' => true, 'data-placeholder' => __( 'Select a transaction' , 'lifterlms' ), ), 'default' => '' , 'id' => 'transaction_id' , 'desc' => '<br/>' . __( 'Send yourself a test notification using information from the selected transaction.' , 'lifterlms' ), 'options' => $options , 'title' => __( 'Send a Test' , 'lifterlms' ), 'type' => 'select' , // 'selected' => false, ), ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.24.0 | Introduced. |