shortcode to create dynamic dropdown box form shortcode attributes

Based on your example at the bottom of your question, and your statement that you would like something like that for readability, I’d do something like this: function dropdown_option($atts) { $dropid = (isset($atts[‘dropid’])) ? $atts[‘dropid’] : ”; global $sco_array; if (!empty($atts[‘value’]) && !empty($atts[‘text’])) { $sco_array[$dropid][$atts[‘value’]] = $atts[‘text’]; } } add_shortcode(‘sco’,’dropdown_option’); function sc_dropdown($atts) { $id = … Read more

Getting the count of a shortcode that is nested

Here is very, very rough code that should get you started: add_shortcode(‘outer_shortcode’,function($attts,$content){return 1;}); add_shortcode(‘inner_code’,function($attts,$content){return 1;}); $str=”[outer_shortcode][inner_code url=”#” title=”Hello”][inner_code url=”#2″ title=”Hello2″][/outer_shortcode]”; $reg = get_shortcode_regex(); preg_match_all(‘~’.$reg.’~’,$str,$matches); var_dump($matches); preg_match_all(‘~’.$reg.’~’,$matches[5][0],$matches2); var_dump($matches2); What is happening is that you are parsing the string which matches and “pulls apart” the outer shortcode. You then need to parse that shortcode’s content (array element … Read more

TinyMCE popup windows using WP functions

The popup of a TinyMCE is outside WordPress. You must include the wp-load.php, same handle like outside the WordPress install. But think about this solution and maybe it is cleaner, that you create your data in a json string and handle this data in the popup. It is helpful to reads this post about the … Read more

Execute shortcode within shortcode

I haven’t tried this, but you could try pseudo-changing the priority of your shortcode hook. Basically, you force your shortcode to execute before it would normally. That link shows how to execute your shortcode separately – and, more importantly, before – the other shortcodes get implemented. This works by caching and temporarily removing all existing … Read more

How can I run shortcode after click with ajax

You should try to replace the following jQuery part: action: ‘process_shortcode_on_tab_click’ with this one: action: ‘process_shortcode_on_tab_click_action’ to match your wp_ajax_process_shortcode_on_tab_click_action and wp_ajax_nopriv_process_shortcode_on_tab_click_action actions. Check for example the Codex on how to name the custom wp_ajax_$youraction hook.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)