LLMS_Generator_Courses::setup_raw_for_clone( array $raw )
Modifies incoming raw data when creating a clone of a course or lesson
Description Description
When a clone is created, it will automatically have "(Clone)" appended to the existing title and will be created with the "Draft" status.
Parameters Parameters
- $raw
-
(array) (Required) Raw data array for the course or lesson.
Return Return
(array)
Source Source
File: includes/class-llms-generator-courses.php
protected function setup_raw_for_clone( $raw ) {
/**
* Filters the suffix appended to the WP_Post title of a duplicated post when cloning a course or lesson
*
* @since 4.13.0
*
* @param string $status The WP_Post status to use for the duplicate of the post. Default: "draft".
* @param array $raw Raw data array passed into the generator.
* @param LLMS_Generator $generator Generator instance.
*/
$raw['title'] .= apply_filters( 'llms_generator_cloned_post_title_suffix', sprintf( ' (%s)', __( 'Clone', 'lifterlms' ) ), $raw, $this );
/**
* Filters the WP_Post status used for the duplicated post when cloning a course or lesson
*
* @since 4.13.0
*
* @param string $status The WP_Post status to use for the duplicate of the post. Default: "draft".
* @param array $raw Raw data array passed into the generator.
* @param LLMS_Generator $generator Generator instance.
*/
$raw['status'] = apply_filters( 'llms_generator_cloned_post_status', 'draft', $raw, $this );
return $raw;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.13.0 | Introduced. |