LLMS_REST_Posts_Controller::create_llms_post( array $object_args )

Create an LLMS_Post_Model


Parameters Parameters

$object_args

(array) (Required) Object args.


Top ↑

Return Return

(LLMS_Post_Model|WP_Error)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-posts-controller.php

	protected function create_llms_post( $object_args ) {

		$class = $this->llms_post_class_from_post_type();

		if ( ! $class ) {
			return new WP_Error(
				'llms_rest_cannot_create_object',
				/* translators: %s: post type */
				sprintf( __( 'The %s cannot be created.', 'lifterlms' ), $this->post_type ),
				array( 'status' => 500 )
			);
		}

		$object = new $class( 'new', $object_args );
		return $object && is_a( $object, $class ) ? $object : llms_rest_not_found_error();
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.9 Implement generic llms post creation.
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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