Пример #1
0
 public function __construct(WP_Term $term = null)
 {
     $this->term = $term ?: new WP_Term((object) ['taxonomy' => $this->taxonomy]);
     parent::__construct($this->term->to_array());
 }
Пример #2
0
 public function __construct(WP_Post $post = null)
 {
     $this->post = $post ?: new WP_Post((object) ['post_status' => $this->post_status, 'post_type' => $this->post_type]);
     parent::__construct($this->post->to_array());
 }
Пример #3
0
 public function __construct(WP_Role $role = null)
 {
     $this->role = $role ?: new WP_Role($this->name, $this->capabilities);
     parent::__construct((array) $this->role);
 }
Пример #4
0
 public function __construct(WP_User $user = null)
 {
     $this->user = $user ?: new WP_User();
     parent::__construct($this->user->to_array());
 }