Пример #1
0
	/**
	 * get, add, or delete moderators for this category
	 *
	 * @param null|array $addUsers
	 * @param null|array $deleteUsers
	 * @return array
	 */
	public function moderators( $addUsers = null, $deleteUsers = null )
	{
		if ( ! $this->_category ) {
			return array();
		}

		if ( $addUsers !== null ) {
			if ( is_array( $addUsers ) ) {
				$this->_category->addModerators( $addUsers );
			} else {
				$this->_category->addModerator( $addUsers );
			}
		}

		if ( $deleteUsers !== null ) {
			if ( is_array( $deleteUsers ) ) {
				foreach ( $deleteUsers as $deleteUser ) {
					$this->_category->removeModerator( $deleteUser );
				}
			} else {
				$this->_category->removeModerator( $deleteUsers );
			}
		}

		return $this->_category->getModerators( false, false );
	}