Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_shortcode('clearfix', 'clearfix_shortcode');
- function clearfix_shortcode($args = []) {
- $args_lc = array_map('strtolower', (array)$args);
- if (array_search('left', $args_lc) !== false) {
- $direction = 'left';
- }
- else if (array_search('right', $args_lc) !== false) {
- $direction = 'right';
- }
- else {
- $direction = 'both';
- }
- return '<div style="display:block;visibility:hidden;height:0;clear:' . $direction . ';"></div>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement