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.


Top ↑

Parameters Parameters

$raw

(array) (Required) Raw data array for the course or lesson.


Top ↑

Return Return

(array)


Top ↑

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;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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