You appear to be a bot. Output may be restricted
Description
Apply sanity checks to the ID
OK. So we've found an integer. We need to check the context. In the absence of any other logic, post IDs are not normally littered willy nilly in content. Places where we might expect to see them are:
- in shortcodes e.g. [gallery ids=123,456] [bw_link 123] [bw_pages post_parent=456]
- in ugly URLs e.g http://example.com/?p=123
Anywhere else it's probably just a number e.g. 1 + 1 = 2 Ignore 0's as well
Usage
OIK_clone_informal_relationships::maybe_add_id( $id, $t );
Parameters
- $id
- ( mixed ) required –
- $t
- ( mixed ) required –
Returns
void
Source
File name: oik-clone/admin/class-oik-clone-informal-relationships.php
Lines:
1 to 7 of 7
function maybe_add_id( $id, $t ) { $intvalid = intval( $id ); if ( $intvalid && $this->is_in_context( $t ) ) { //echo "Token $t a goodun" . PHP_EOL; $this->handle_id( $id, $t ); } }