BP_REST_Learndash_Courses_Endpoint::get_collection_params()
Get the query params for collections.
Description
Return
(array)
Source
File: bp-integrations/learndash/classes/class-bp-rest-learndash-courses-endpoint.php
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | public function get_collection_params() { $params = parent::get_collection_params(); $params [ 'context' ][ 'default' ] = 'view' ; $params [ 'author' ] = array ( 'description' => __( 'Limit result set to posts assigned to specific authors.' , 'buddyboss' ), 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'author_exclude' ] = array ( 'description' => __( 'Ensure result set excludes posts assigned to specific authors.' , 'buddyboss' ), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'after' ] = array ( 'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.' , 'buddyboss' ), 'type' => 'string' , 'format' => 'date-time' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'before' ] = array ( 'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.' , 'buddyboss' ), 'type' => 'string' , 'format' => 'date-time' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'exclude' ] = array ( 'description' => __( 'Ensure result set excludes specific IDs.' , 'buddyboss' ), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'include' ] = array ( 'description' => __( 'Limit result set to specific IDs.' , 'buddyboss' ), 'type' => 'array' , 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'offset' ] = array ( 'description' => __( 'Offset the result set by a specific number of items.' , 'buddyboss' ), 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'order' ] = array ( 'description' => __( 'Order sort attribute ascending or descending.' , 'buddyboss' ), 'type' => 'string' , 'default' => 'asc' , 'enum' => array ( 'asc' , 'desc' ), 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'orderby' ] = array ( 'description' => __( 'Sort collection by object attribute.' , 'buddyboss' ), 'type' => 'string' , 'default' => 'date' , 'enum' => array ( 'author' , 'date' , 'id' , 'include' , 'modified' , 'parent' , 'relevance' , 'slug' , 'include_slugs' , 'title' , 'menu_order' , ), 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'status' ] = array ( 'description' => __( 'Limit result set to posts assigned one or more statuses.' , 'buddyboss' ), 'type' => 'array' , 'enum' => array ( 'publish' , 'future' , 'draft' , 'pending' , 'private' , 'trash' , 'auto-draft' , 'inherit' , 'request-pending' , 'request-confirmed' , 'request-failed' , 'request-completed' , 'closed' , 'spam' , 'orphan' , 'hidden' , 'graded' , 'not_graded' , 'any' , ), 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'course_category' ] = array ( 'description' => __( 'Limit result set to all items that have the specified term assigned in the ld_course_category taxonomy.' , 'buddyboss' ), 'type' => 'array' , 'default' => array (), 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'course_category_exclude' ] = array ( 'description' => __( 'Limit result set to all items except those that have the specified term assigned in the ld_course_category taxonomy.' , 'buddyboss' ), 'type' => 'array' , 'default' => array (), 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'course_tag' ] = array ( 'description' => __( 'Limit result set to all items that have the specified term assigned in the ld_course_tag taxonomy.' , 'buddyboss' ), 'type' => 'array' , 'default' => array (), 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'course_tag_exclude' ] = array ( 'description' => __( 'Limit result set to all items except those that have the specified term assigned in the ld_course_tag taxonomy.' , 'buddyboss' ), 'type' => 'array' , 'default' => array (), 'items' => array ( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list' , 'validate_callback' => 'rest_validate_request_arg' , ); $params [ 'group_id' ] = array ( 'description' => __( 'Limit response to specific buddypress group.' , 'buddyboss' ), 'type' => 'integer' , 'sanitize_callback' => 'absint' , 'validate_callback' => 'rest_validate_request_arg' , ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_learndash_courses_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.