Created
June 11, 2012 21:56
-
-
Save kimisgold/2912993 to your computer and use it in GitHub Desktop.
Custom link to items with element text helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bc_link_to_items_with_element_text($text = null, $props = array(), $action = 'browse', $elementId = null, $elementText = null) { | |
$queryParams = array(); | |
$queryParams['advanced']['element_id'] = $elementId; | |
$queryParams['advanced']['type'] = 'contains'; | |
$queryParams['advanced']['terms'] = $elementText; | |
if ($text === null) { | |
$text = $elementText; | |
} | |
return link_to('items', $action, $text, $props, $queryParams); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment