Help with identifying function of this snippet?
-
I know the executive level summary of what happens. A variable in the URL is pulled, and it uses that to match up stories in the db that have the same post_title. However, this isn’t flexible and I want the variable to be matched up with a meta instead of the post_title. But I’m not sure how to do this. Below is the code that should handle this. Does anyone have any idea on this is working?
if ($_GET['symbol']) { add_filter( 'posts_where', 'filter_where_title' ); } function filter_where_title($where = ' ') { $where .= ' AND post_title = "'.strtoupper($_GET['symbol']).'"'; return $where; }
To be honest I don’t have a clear understanding of what actually happens here. My first guess is that the code is executing a SQL query. “AND post title = ‘GETVARIABLEFROMURL'” , however I have no idea where that query lives….
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Help with identifying function of this snippet?’ is closed to new replies.