Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Adds "user defined" shortcodes via ACF options and repeater plugins
- */
- function addUserDefinedShortCodes()
- {
- if( have_rows('codes','option') ):
- // loop through the rows of data
- while ( have_rows('codes','option') ) : the_row();
- $content = get_sub_field('sc_content');
- add_shortcode(get_sub_field('shortcode'), function() use ($content) {
- return $content;
- });
- endwhile;
- endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement