Shortcode and plugin
-
Morning everyone,
I’m have some issue with shortcode defined by a plugin that I’m working on. Shortcode are define by users, saved into a table (wpdb) and called by relative shortcode:
ex. user define: [text] -> here-my-recall
What I have since now is :function callback($att,$content,$tag){ global $wpdb; /* Row result from SQL query */ $data = $wpdb->get_results($sql); foreach($data as $row) { $shortcode = $row->shortcode; $code = $row->code; if(strcmp($tag,$shortcode)) { return $code; break; } } } function shortcode_add() { global $wpdb; /* Row result from SQL query */ $data = $wpdb->get_results($sql); foreach($data as $row) { $shortcode = $row->shortcode; add_shortcode($shortcode,'callback'); } }Now how can I let WP learn them and use everywhere?
Thanks for help
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Shortcode and plugin’ is closed to new replies.