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
..
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()
Return Return
(string) Returns the HTML for the merge code button.
Source Source
File: includes/admin/llms.functions.admin.php
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 ) {
Expand full source code Collapse full source code View on GitHub
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. |