WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #41714, comment 1


Ignore:
Timestamp:
08/25/2017 01:33:41 PM (2 years ago)
Author:
subrataemfluence
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #41714, comment 1

    initial v1  
    1 If I understand correctly you want more control over core `get_post()` method so that you can build a query with specific '''"WHERE"''' filters in order to fetch the type of records you want, not just '''"ALL"''' posts.
     1If I understand correctly you want more control over core `get_posts()` method so that you can build a query with specific '''"WHERE"''' filters in order to fetch the type of records you want, not just '''"ALL"''' posts.
    22
    3 To achieve this you have the option to build an array and pass it through `$args` parameter `get_post()` (`function get_posts( $args = null ) { ... }`) method, which by default is set to null. If you do not pass any argument, all posts would be retrieved while if you have a properly built argument, `get_post()` will use this to fetch matching records according to criteria you set in the query.
     3To achieve this you have the option to build an array and pass it through `$args` parameter `get_posts()` (`function get_posts( $args = null ) { ... }`) method, which by default is set to null. If you do not pass any argument, all posts would be retrieved while if you have a properly built argument, `get_posts()` will use this to fetch matching records according to criteria you set in the query.
    44
    55[https://developer.wordpress.org/reference/functions/get_posts/]