BP_REST_Activity_Endpoint::get_collection_params()
Get the query params for collections of plugins.
Description
Return
(array)
Source
File: bp-activity/classes/class-bp-rest-activity-endpoint.php
1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 | public function get_collection_params() { $params = parent::get_collection_params(); $params [ 'context' ][ 'default' ] = 'view' ; $params [ 'exclude' ] = array ( 'description' => __( 'Ensure result set excludes specific IDs.' , 'buddyboss' ), 'default' => array (), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'include' ] = array ( 'description' => __( 'Ensure result set includes specific IDs.' , 'buddyboss' ), 'default' => array (), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'order' ] = array ( 'description' => __( 'Order sort attribute ascending or descending.' , 'buddyboss' ), 'default' => 'desc' , 'type' => 'string' , 'enum' => array ( 'asc' , 'desc' ), 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'after' ] = array ( 'description' => __( 'Limit result set to items published after a given ISO8601 compliant date.' , 'buddyboss' ), 'type' => 'string' , 'format' => 'date-time' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'user_id' ] = array ( 'description' => __( 'Limit result set to items created by a specific user (ID).' , 'buddyboss' ), 'default' => 0, 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'status' ] = array ( 'description' => __( 'Limit result set to items with a specific status.' , 'buddyboss' ), 'default' => 'ham_only' , 'type' => 'string' , 'enum' => array ( 'ham_only' , 'spam_only' , 'all' ), 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'scope' ] = array ( 'description' => __( 'Limit result set to items with a specific scope.' , 'buddyboss' ), 'type' => 'string' , 'enum' => array ( 'just-me' , 'friends' , 'groups' , 'favorites' , 'mentions' , 'following' ), 'sanitize_callback' => 'sanitize_text_field' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'group_id' ] = array ( 'description' => __( 'Limit result set to items created by a specific group.' , 'buddyboss' ), 'default' => 0, 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'site_id' ] = array ( 'description' => __( 'Limit result set to items created by a specific site.' , 'buddyboss' ), 'default' => 0, 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'primary_id' ] = array ( 'description' => __( 'Limit result set to items with a specific prime association ID.' , 'buddyboss' ), 'default' => 0, 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'secondary_id' ] = array ( 'description' => __( 'Limit result set to items with a specific secondary association ID.' , 'buddyboss' ), 'default' => 0, 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'component' ] = array ( 'description' => __( 'Limit result set to items with a specific active BuddyPress component.' , 'buddyboss' ), 'type' => 'string' , 'enum' => array_keys ( buddypress()->active_components ), 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'type' ] = array ( 'description' => __( 'Limit result set to items with a specific activity type.' , 'buddyboss' ), 'type' => 'string' , 'enum' => array_keys ( bp_activity_get_types() ), 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'display_comments' ] = array ( 'description' => __( 'No comments by default, stream for within stream display, threaded for below each activity item.' , 'buddyboss' ), 'default' => '' , 'type' => 'string' , 'sanitize_callback' => 'sanitize_key' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'privacy' ] = array ( 'description' => __( 'Privacy of the activity.' , 'buddyboss' ), 'type' => 'array' , 'items' => array ( 'type' => 'string' , 'enum' => array ( 'public' , 'loggedin' , 'onlyme' , 'friends' , 'media' ), ), 'sanitize_callback' => 'bp_rest_sanitize_string_list' , 'validate_callback' => 'rest_validate_request_arg' , ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_activity_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.