llms_merge_code_button( string $target = 'content', boolean $echo = true, array $codes = array() )

Add a “merge code” button that to auto-add merge codes to email & etc.


Description Description

..


Top ↑

Parameters Parameters

$target

(string) (Optional) Target to add the merge code to. Accepts the ID of a tinymce editor or a DOM ID (#element-id).

Default value: 'content'

$echo

(boolean) (Optional) If true, echos the HTML output.

Default value: true

$codes

(array) (Optional) array of custom codes to pass in, otherwise the codes are determined what is available for the post type.

Default value: array()


Top ↑

Return Return

(string) Returns the HTML for the merge code button.


Top ↑

Source Source

File: includes/admin/llms.functions.admin.php

236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
    return apply_filters(
        'llms_sales_page_types',
        array(
            'none'    => __( 'Display default course content', 'lifterlms' ),
            'content' => __( 'Show custom content', 'lifterlms' ),
            'page'    => __( 'Redirect to WordPress Page', 'lifterlms' ),
            'url'     => __( 'Redirect to custom URL', 'lifterlms' ),
        )
    );
}
 
/**
 * Get an array of available course/membership checkout redirection options
 *
 * @since    3.30.0
 * @version  3.30.0
 *
 * @param    string $product_type The product type, Course or Membership
 * @return   array
 */
function llms_get_checkout_redirection_types( $product_type = '' ) {
 
    $product_type = empty( $product_type ) ? __( 'Course/Membership', 'lifterlms' ) : $product_type;
 
    return apply_filters(
        'llms_checkout_redirection_types',
        array(
            'self' => sprintf( __( '(Default) Return to %s', 'lifterlms' ), $product_type ),
            'page' => __( 'Redirect to a WordPress Page', 'lifterlms' ),
            'url'  => __( 'Redirect to a custom URL', 'lifterlms' ),
        )
    );
}
 
/**
 * Add a "merge code" button that to auto-add merge codes to email & etc...
 *
 * @since 3.1.0
 * @since 3.17.4 Unknown.
 * @since 6.0.0 Move HTML into view file: `includes/admin/views/merge-code-editor-button.php`.
 *                Move certificate merge code list to `llms_get_certificate_merge_codes()`.
 *
 * @param string  $target Target to add the merge code to. Accepts the ID of a tinymce editor or a DOM ID (#element-id).
 * @param boolean $echo   If `true`, echos the HTML output.
 * @param array   $codes  Optional array of custom codes to pass in, otherwise the codes are determined
 *                        what is available for the post type.
 * @return string Returns the HTML for the merge code button.
 */
function llms_merge_code_button( $target = 'content', $echo = true, $codes = array() ) {
 
    $screen = get_current_screen();
 
    if ( ! $codes && $screen && isset( $screen->post_type ) ) {
 
        switch ( $screen->post_type ) {


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Move HTML into view file: includes/admin/views/merge-code-editor-button.php. Move certificate merge code list to llms_get_certificate_merge_codes().
3.17.4 Unknown.
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.