LLMS_Instructor::add_parent( $parent_ids )
Add a parent instructor to an assistant instructor
Description Description
Parameters Parameters
- $parent_id
-
(mixed) (Required) WP User ID of the parent instructor or array of User IDs to add multiple
Return Return
(boolean)
Source Source
File: includes/models/model.llms.instructor.php
public function add_parent( $parent_ids ) { // get existing parents $parents = $this->get( 'parent_instructors' ); // no existing, use an empty array as the default if ( ! $parents ) { $parents = array(); } if ( ! is_array( $parent_ids ) ) { $parent_ids = array( $parent_ids ); } // make ints $parent_ids = array_map( 'absint', $parent_ids ); // add the new parents $parents = array_unique( array_merge( $parents, $parent_ids ) ); // remove duplicates and save return $this->set( 'parent_instructors', array_unique( $parents ) ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.13.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: