Problem:
Replace the dash character with space in text outputted from other shortcode, for example:
wpv-search-term
Solution:
I suggest you try to create another shortcode to achieve what you want, for example,
1) add below codes into your theme/functions.php:
add_shortcode('dash2space', 'dash2space_func'); function dash2space_func($atts, $content){ $content = do_shortcode($content); $content = str_replace('-', ' ', $content); return $content; }
2) Use above shortcode [dash2space], like this:
[dash2space] ...wpv-search-term param="type"... [/dash2space]
Relevant Documentation:
http://php.net/manual/en/function.str-replace.php
https://codex.wordpress.org/Function_Reference/add_shortcode
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Hong_Kong (GMT+08:00)
This topic contains 3 replies, has 2 voices.
Last updated by 7 years, 3 months ago.
Assisted by: Luo Yang.
The forum ‘Types Community Support’ is closed to new topics and replies.