Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter("gform_allowable_tags_13", "allow_basic_tags", 10, 3);
- function allow_basic_tags($allowable_tags) {
- return true;
- }
- add_action("gform_pre_submission_13", "add_catlink");
- function add_catlink($form){
- // assuming your dropdown list includes all of the categories in your site the information a user selects will have a category name
- // we then need to grab that category name find out its ID and then build a link
- $categoryname = $_POST["input_7"];
- $category_id = get_cat_ID($categoryname);
- $category_link = get_category_link($category_id);
- // lastly, we need to change the POST value from just being the name of the category to being a link.
- $_POST["input_7"] = '<a href="'. esc_url($category_link) .'">'. $categoryname .'</a>';
- }
Advertisement
Add Comment
Please, Sign In to add comment