Multiple Filter Function
-
I have a query coded like this:
query="select A, B, C, D, E, F where A='USER_APPARTEMENT' "and a Filter Funtion coded like this:
function filter_gdoc_query ($query, $atts) { if ('https://docs.google.com/spreadsheets/--myfile1--/edit?usp=sharing' !== $atts['key']) { return $query; } $user_id = get_current_user_id(); $key = 'appartement'; $single = true; $appartement = get_user_meta( $user_id, $key, $single ); return str_replace('USER_APPARTEMENT', $appartement, $query); } add_filter('gdoc_query', 'filter_gdoc_query', 10, 2);That is working fine for –myfile1–.
Now I want to to the same for –myfile2-.
Questions:
1. Should I code a new Filter Function ?
2. Should I modify the above Filter Function ?
3. In both cases what would be the proper code ?Thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Multiple Filter Function’ is closed to new replies.