1. Home
  2. Docs
  3. Function Reference
  4. Functions
  5. simpods_select()

simpods_select()

Get entries from a table, taking Simpods Hierachy, Simpods Linked Areas, Pods into account.

Copy to Clipboard

Parameters

$fields

Fields to search. Prefix _exc_ to implement NOT LIKE, _find_ to search substring, _prev_ for the previous record of the search target and _next_ for the record after. _prev_ and _next_ only work with order ASC.

array{ 'id' => 1, // search id 1 '_exc_id' => 2, // exclude id 2 '_find_post_name' => 'test', '_prev_id' => 3, // find the record before id 3 '_next_id' => 4, // find the record after id 4 }

$attributes

SQL attributes array:

Copy to Clipboard

$can_echo_query

If true the query will be echoed out (default false)

$can_prefix

If true, prefixes table names with the WordPress table prefix (default true)

Return

array

Array of found rows. If there are none, the array will be empty.

Example

Basic use:

Copy to Clipboard

Advanced use – getting children from a parent post organised by Simpods Hierachy:

Copy to Clipboard
Tags