BP_REST_Document_Endpoint::get_collection_params()
Get the query params for collections.
Description
Return
(array)
Source
File: bp-document/classes/class-bp-rest-document-endpoint.php
1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 | public function get_collection_params() { $params = parent::get_collection_params(); $params [ 'order' ] = array ( 'description' => __( 'Order sort attribute ascending or descending.' , 'buddyboss' ), 'default' => 'asc' , 'type' => 'string' , 'enum' => array ( 'asc' , 'desc' ), 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'orderby' ] = array ( 'description' => __( 'Order documents by which attribute.' , 'buddyboss' ), 'default' => 'title' , 'type' => 'string' , 'enum' => array ( 'title' , 'date_created' , 'date_modified' , 'group_id' , 'privacy' ), 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'max' ] = array ( 'description' => __( 'Maximum number of results to return' , 'buddyboss' ), 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'scope' ] = array ( 'description' => __( 'Scope of the Document.' , 'buddyboss' ), 'type' => 'array' , 'items' => array ( 'enum' => array ( 'public' , 'friends' , 'groups' , 'personal' ), 'type' => 'string' , ), 'sanitize_callback' => 'bp_rest_sanitize_string_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'user_id' ] = array ( 'description' => __( 'Limit results to a specific user.' , 'buddyboss' ), 'default' => 0, 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'folder_id' ] = array ( 'description' => __( 'A unique numeric ID for the Folder.' , 'buddyboss' ), 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'group_id' ] = array ( 'description' => __( 'A unique numeric ID for the Group.' , 'buddyboss' ), 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'activity_id' ] = array ( 'description' => __( 'A unique numeric ID for the Document\'s Activity.' , 'buddyboss' ), 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'privacy' ] = array ( 'description' => __( 'Privacy of the Document.' , 'buddyboss' ), 'type' => 'array' , 'items' => array ( 'enum' => array ( 'public' , 'loggedin' , 'friends' , 'onlyme' , 'grouponly' , 'message' , 'forums' ), 'type' => 'string' , ), 'sanitize_callback' => 'bp_rest_sanitize_string_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'include' ] = array ( 'description' => __( 'Ensure result set includes specific document IDs.' , 'buddyboss' ), 'default' => array (), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'exclude' ] = array ( 'description' => __( 'Ensure result set excludes specific document IDs.' , 'buddyboss' ), 'default' => array (), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'count_total' ] = array ( 'description' => __( 'Show total count or not.' , 'buddyboss' ), 'default' => true, 'type' => 'boolean' , ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_document_collection_params' , $params ); } |
Changelog
Version | Description |
---|---|
0.1.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.