AnsPress_Query::add_prefetch_id( string $type, integer $id, false|integer $key = false )
Description #
Add pre fetch ids.
Parameters #
- $typestring (Required) ids type.
- $idinteger (Required) id.
- $keyfalse | integer (Optional) Object key. Default value: false
Source #
File: includes/class-query.php
public function add_prefetch_id( $type, $id, $key = false ) { if ( empty( $id ) ) { return; } if ( ! isset( $this->ids[ $type ] ) ) { $this->ids[ $type ] = array(); } if ( ! in_array( $id, $this->ids[ $type ], true ) ) { $this->ids[ $type ][] = (int) $id; } if ( false !== $key ) { $this->add_pos( $type, $id, $key ); } }
Expand full source code Collapse full source code View on GitHub: includes/class-query.php:249
Add your comment