@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | class Lsx_Bootstrap_Navwalker extends Walker_Nav_Menu { |
| 5 | 5 | |
@@ -10,15 +10,15 @@ discard block |
||
| 10 | 10 | * @param string $output Passed by reference. Used to append additional content. |
| 11 | 11 | * @param int $depth Depth of page. Used for padding. |
| 12 | 12 | */ |
| 13 | - public function start_lvl( &$output, $depth = 0, $args = array() ) { |
|
| 14 | - $indent = str_repeat( "\t", $depth ); |
|
| 13 | + public function start_lvl(&$output, $depth = 0, $args = array()) { |
|
| 14 | + $indent = str_repeat("\t", $depth); |
|
| 15 | 15 | $output .= "\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n"; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @param string $item Passed by reference. Used to append additional content. |
| 20 | 20 | */ |
| 21 | - public function filter_default_pages( &$item ) { |
|
| 21 | + public function filter_default_pages(&$item) { |
|
| 22 | 22 | |
| 23 | 23 | return $item; |
| 24 | 24 | } |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | * @param int $current_page Menu item ID. |
| 34 | 34 | * @param object $args |
| 35 | 35 | */ |
| 36 | - public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { |
|
| 37 | - $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; |
|
| 36 | + public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { |
|
| 37 | + $indent = ($depth) ? str_repeat("\t", $depth) : ''; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * If this is a default menu being called we need to fix |
| 41 | 41 | * the item object thats coming through. |
| 42 | 42 | */ |
| 43 | - if(!isset($item->title)){ |
|
| 43 | + if ( ! isset($item->title)) { |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -52,62 +52,62 @@ discard block |
||
| 52 | 52 | * comparison that is not case sensitive. The strcasecmp() function returns |
| 53 | 53 | * a 0 if the strings are equal. |
| 54 | 54 | */ |
| 55 | - if ( 0 == strcasecmp( $item->attr_title, 'divider' ) && 1 === $depth ) { |
|
| 55 | + if (0 == strcasecmp($item->attr_title, 'divider') && 1 === $depth) { |
|
| 56 | 56 | $output .= $indent . '<li role="presentation" class="divider">'; |
| 57 | - } elseif ( 0 == strcasecmp( $item->title, 'divider' ) && 1 === $depth ) { |
|
| 57 | + } elseif (0 == strcasecmp($item->title, 'divider') && 1 === $depth) { |
|
| 58 | 58 | $output .= $indent . '<li role="presentation" class="divider">'; |
| 59 | - } elseif ( 0 == strcasecmp( $item->attr_title, 'dropdown-header' ) && 1 === $depth ) { |
|
| 60 | - $output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr( $item->title ); |
|
| 61 | - } elseif ( 0 == strcasecmp( $item->attr_title, 'disabled' ) ) { |
|
| 62 | - $output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr( $item->title ) . '</a>'; |
|
| 59 | + } elseif (0 == strcasecmp($item->attr_title, 'dropdown-header') && 1 === $depth) { |
|
| 60 | + $output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr($item->title); |
|
| 61 | + } elseif (0 == strcasecmp($item->attr_title, 'disabled')) { |
|
| 62 | + $output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr($item->title) . '</a>'; |
|
| 63 | 63 | } else { |
| 64 | 64 | $class_names = $value = ''; |
| 65 | 65 | |
| 66 | - $classes = empty( $item->classes ) ? array() : (array) $item->classes; |
|
| 66 | + $classes = empty($item->classes) ? array() : (array) $item->classes; |
|
| 67 | 67 | $classes[] = 'menu-item-' . $item->ID; |
| 68 | 68 | |
| 69 | - $classes = apply_filters( 'lsx_nav_menu_css_class', array_filter( $classes ), $item, $args , $depth ); |
|
| 69 | + $classes = apply_filters('lsx_nav_menu_css_class', array_filter($classes), $item, $args, $depth); |
|
| 70 | 70 | |
| 71 | - $class_names = join( ' ', $classes ); |
|
| 71 | + $class_names = join(' ', $classes); |
|
| 72 | 72 | |
| 73 | - if ( $args->has_children ) |
|
| 73 | + if ($args->has_children) |
|
| 74 | 74 | $class_names .= ' dropdown'; |
| 75 | 75 | |
| 76 | - if ( in_array( 'current-menu-item', $classes ) ) |
|
| 76 | + if (in_array('current-menu-item', $classes)) |
|
| 77 | 77 | $class_names .= ' active'; |
| 78 | 78 | |
| 79 | - if ( in_array( 'current-menu-parent', $classes ) ) |
|
| 79 | + if (in_array('current-menu-parent', $classes)) |
|
| 80 | 80 | $class_names .= ' active'; |
| 81 | 81 | |
| 82 | 82 | //Check if this is ment to be a "social" type menu |
| 83 | - $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
|
| 83 | + $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : ''; |
|
| 84 | 84 | |
| 85 | - $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args ); |
|
| 86 | - $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; |
|
| 85 | + $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args); |
|
| 86 | + $id = $id ? ' id="' . esc_attr($id) . '"' : ''; |
|
| 87 | 87 | |
| 88 | - $output .= $indent . '<li' . $id . $value . $class_names .'>'; |
|
| 88 | + $output .= $indent . '<li' . $id . $value . $class_names . '>'; |
|
| 89 | 89 | |
| 90 | 90 | $atts = array(); |
| 91 | - $atts['title'] = ! empty( $item->title ) ? $item->title : ''; |
|
| 92 | - $atts['target'] = ! empty( $item->target ) ? $item->target : ''; |
|
| 93 | - $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : ''; |
|
| 91 | + $atts['title'] = ! empty($item->title) ? $item->title : ''; |
|
| 92 | + $atts['target'] = ! empty($item->target) ? $item->target : ''; |
|
| 93 | + $atts['rel'] = ! empty($item->xfn) ? $item->xfn : ''; |
|
| 94 | 94 | |
| 95 | 95 | // If item has_children add atts to a. |
| 96 | - if ( $args->has_children ) { |
|
| 97 | - $atts['href'] = ! empty( $item->url ) ? $item->url : ''; |
|
| 98 | - $atts['data-toggle'] = 'dropdown'; |
|
| 99 | - $atts['class'] = 'dropdown-toggle'; |
|
| 100 | - $atts['aria-haspopup'] = 'true'; |
|
| 96 | + if ($args->has_children) { |
|
| 97 | + $atts['href'] = ! empty($item->url) ? $item->url : ''; |
|
| 98 | + $atts['data-toggle'] = 'dropdown'; |
|
| 99 | + $atts['class'] = 'dropdown-toggle'; |
|
| 100 | + $atts['aria-haspopup'] = 'true'; |
|
| 101 | 101 | } else { |
| 102 | - $atts['href'] = ! empty( $item->url ) ? $item->url : ''; |
|
| 102 | + $atts['href'] = ! empty($item->url) ? $item->url : ''; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args ); |
|
| 105 | + $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args); |
|
| 106 | 106 | |
| 107 | 107 | $attributes = ''; |
| 108 | - foreach ( $atts as $attr => $value ) { |
|
| 109 | - if ( ! empty( $value ) ) { |
|
| 110 | - $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value ); |
|
| 108 | + foreach ($atts as $attr => $value) { |
|
| 109 | + if ( ! empty($value)) { |
|
| 110 | + $value = ('href' === $attr) ? esc_url($value) : esc_attr($value); |
|
| 111 | 111 | $attributes .= ' ' . $attr . '="' . $value . '"'; |
| 112 | 112 | } |
| 113 | 113 | } |
@@ -121,19 +121,19 @@ discard block |
||
| 121 | 121 | * if there is a value in the attr_title property. If the attr_title |
| 122 | 122 | * property is NOT null we apply it as the class name for the glyphicon. |
| 123 | 123 | */ |
| 124 | - if ( ! empty( $item->attr_title ) ) { |
|
| 125 | - $item_output .= '<a'. $attributes .'"><span class="glyphicon ' . esc_attr( $item->attr_title ) . '"></span> '; |
|
| 124 | + if ( ! empty($item->attr_title)) { |
|
| 125 | + $item_output .= '<a' . $attributes . '"><span class="glyphicon ' . esc_attr($item->attr_title) . '"></span> '; |
|
| 126 | 126 | } else { |
| 127 | - $item_output .= '<a'. $attributes .'>'; |
|
| 127 | + $item_output .= '<a' . $attributes . '>'; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; |
|
| 131 | - $item_output .= ( $args->has_children && 0 === $depth ) ? ' <span class="caret"></span></a>' : '</a>'; |
|
| 130 | + $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; |
|
| 131 | + $item_output .= ($args->has_children && 0 === $depth) ? ' <span class="caret"></span></a>' : '</a>'; |
|
| 132 | 132 | $item_output .= $args->after; |
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | |
| 136 | - $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); |
|
| 136 | + $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -157,17 +157,17 @@ discard block |
||
| 157 | 157 | * @param string $output Passed by reference. Used to append additional content. |
| 158 | 158 | * @return null Null on failure with no changes to parameters. |
| 159 | 159 | */ |
| 160 | - public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { |
|
| 161 | - if ( ! $element ) |
|
| 160 | + public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) { |
|
| 161 | + if ( ! $element) |
|
| 162 | 162 | return; |
| 163 | 163 | |
| 164 | 164 | $id_field = $this->db_fields['id']; |
| 165 | 165 | |
| 166 | 166 | // Display this element. |
| 167 | - if ( is_object( $args[0] ) ) |
|
| 168 | - $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 167 | + if (is_object($args[0])) |
|
| 168 | + $args[0]->has_children = ! empty($children_elements[$element->$id_field]); |
|
| 169 | 169 | |
| 170 | - parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); |
|
| 170 | + parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -181,17 +181,17 @@ discard block |
||
| 181 | 181 | * @param array $args passed from the wp_nav_menu function. |
| 182 | 182 | * |
| 183 | 183 | */ |
| 184 | - public static function fallback( $args ) { |
|
| 185 | - if ( current_user_can( 'manage_options' ) ) { |
|
| 184 | + public static function fallback($args) { |
|
| 185 | + if (current_user_can('manage_options')) { |
|
| 186 | 186 | $fb_output = null; |
| 187 | 187 | |
| 188 | - if ( $args['container'] ) { |
|
| 188 | + if ($args['container']) { |
|
| 189 | 189 | $fb_output = '<' . $args['container']; |
| 190 | 190 | |
| 191 | - if ( $args['container_id'] ) |
|
| 191 | + if ($args['container_id']) |
|
| 192 | 192 | $fb_output .= ' id="' . $args['container_id'] . '"'; |
| 193 | 193 | |
| 194 | - if ( $args['container_class'] ) |
|
| 194 | + if ($args['container_class']) |
|
| 195 | 195 | $fb_output .= ' class="' . $args['container_class'] . '"'; |
| 196 | 196 | |
| 197 | 197 | $fb_output .= '>'; |
@@ -199,20 +199,20 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | $fb_output .= '<ul'; |
| 201 | 201 | |
| 202 | - if ( $args['menu_id'] ) |
|
| 202 | + if ($args['menu_id']) |
|
| 203 | 203 | $fb_output .= ' id="' . $args['menu_id'] . '"'; |
| 204 | 204 | |
| 205 | - if ( $args['menu_class'] ) |
|
| 205 | + if ($args['menu_class']) |
|
| 206 | 206 | $fb_output .= ' class="' . $args['menu_class'] . '"'; |
| 207 | 207 | |
| 208 | 208 | $fb_output .= '>'; |
| 209 | - $fb_output .= '<li><a href="' . admin_url( 'nav-menus.php' ) . '">' . esc_html__( 'Add a menu', 'lsx' ) . '</a></li>'; |
|
| 209 | + $fb_output .= '<li><a href="' . admin_url('nav-menus.php') . '">' . esc_html__('Add a menu', 'lsx') . '</a></li>'; |
|
| 210 | 210 | $fb_output .= '</ul>'; |
| 211 | 211 | |
| 212 | - if ( $args['container'] ) |
|
| 212 | + if ($args['container']) |
|
| 213 | 213 | $fb_output .= '</' . $args['container'] . '>'; |
| 214 | 214 | |
| 215 | - echo wp_kses_post( $fb_output ); |
|
| 215 | + echo wp_kses_post($fb_output); |
|
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | 218 | } |
@@ -221,9 +221,9 @@ discard block |
||
| 221 | 221 | /** |
| 222 | 222 | * Add in our custom classes to the menus |
| 223 | 223 | */ |
| 224 | -function wpml_nav_language_switcher_fix( $items , $args ) { |
|
| 225 | - $items = str_replace('menu-item-language-current','menu-item-language-current dropdown',$items); |
|
| 226 | - $items = str_replace('submenu-languages','submenu-languages dropdown-menu',$items); |
|
| 224 | +function wpml_nav_language_switcher_fix($items, $args) { |
|
| 225 | + $items = str_replace('menu-item-language-current', 'menu-item-language-current dropdown', $items); |
|
| 226 | + $items = str_replace('submenu-languages', 'submenu-languages dropdown-menu', $items); |
|
| 227 | 227 | return $items; |
| 228 | 228 | } |
| 229 | -add_filter( 'wp_nav_menu_items', 'wpml_nav_language_switcher_fix', 10, 2 ); |
|
| 229 | +add_filter('wp_nav_menu_items', 'wpml_nav_language_switcher_fix', 10, 2); |
|
@@ -9,21 +9,21 @@ |
||
| 9 | 9 | <?php |
| 10 | 10 | $show_on_front = get_option('show_on_front'); |
| 11 | 11 | |
| 12 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 13 | - if('posts' == $show_on_front && is_home()){ |
|
| 12 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 13 | + if ('posts' == $show_on_front && is_home()) { |
|
| 14 | 14 | $sidebar = 'home'; |
| 15 | - }else{ |
|
| 15 | + } else { |
|
| 16 | 16 | $sidebar = 'sidebar-1'; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( '1c' !== $layout ) : ?> |
|
| 19 | + if ('1c' !== $layout) : ?> |
|
| 20 | 20 | |
| 21 | 21 | <?php lsx_sidebars_before(); ?> |
| 22 | 22 | |
| 23 | 23 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 24 | 24 | |
| 25 | 25 | <?php lsx_sidebar_top(); ?> |
| 26 | - <h2><?php esc_attr_e( 'Categories', 'lsx' ); ?></h2> |
|
| 26 | + <h2><?php esc_attr_e('Categories', 'lsx'); ?></h2> |
|
| 27 | 27 | <aside id="categories" class="widget widget_categories"> |
| 28 | 28 | <?php echo wp_tag_cloud(array('taxonomy'=>'category')); ?> |
| 29 | 29 | </aside> |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Allow Plugins and themes to disable the sidebar incase of very customized layouts. |
| 9 | -$sidebar_enabled = apply_filters('lsx_sidebar_enable',true); |
|
| 10 | -if(true !== $sidebar_enabled){return true;} |
|
| 9 | +$sidebar_enabled = apply_filters('lsx_sidebar_enable', true); |
|
| 10 | +if (true !== $sidebar_enabled) {return true; } |
|
| 11 | 11 | ?> |
| 12 | 12 | <?php |
| 13 | 13 | $show_on_front = get_option('show_on_front'); |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | $sidebar = 'home'; |
| 18 | 18 | } else { |
| 19 | 19 | |
| 20 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 21 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 20 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 21 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 22 | 22 | |
| 23 | - if('posts' == $show_on_front && is_home()){ |
|
| 23 | + if ('posts' == $show_on_front && is_home()) { |
|
| 24 | 24 | $sidebar = 'home'; |
| 25 | - }else{ |
|
| 25 | + } else { |
|
| 26 | 26 | $sidebar = 'sidebar-1'; |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | - if ( '1c' !== $layout ) : ?> |
|
| 29 | + if ('1c' !== $layout) : ?> |
|
| 30 | 30 | |
| 31 | 31 | <?php lsx_sidebars_before(); ?> |
| 32 | 32 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_home_sidebar_class()); ?>" role="complementary"> |
| 36 | 36 | |
| 37 | - <?php elseif ( is_page_template('page-templates/template-blog.php') ) : ?> |
|
| 37 | + <?php elseif (is_page_template('page-templates/template-blog.php')) : ?> |
|
| 38 | 38 | |
| 39 | 39 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 40 | 40 | |
@@ -42,25 +42,25 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 44 | 44 | |
| 45 | - <?php endif ; ?> |
|
| 45 | + <?php endif; ?> |
|
| 46 | 46 | |
| 47 | 47 | <?php lsx_sidebar_top(); ?> |
| 48 | 48 | |
| 49 | - <?php if ( ! dynamic_sidebar( $sidebar ) ) : ?> |
|
| 49 | + <?php if ( ! dynamic_sidebar($sidebar)) : ?> |
|
| 50 | 50 | |
| 51 | 51 | <aside id="search" class="widget widget_search"> |
| 52 | 52 | <?php get_search_form(); ?> |
| 53 | 53 | </aside> |
| 54 | 54 | |
| 55 | 55 | <aside id="archives" class="widget"> |
| 56 | - <h1 class="widget-title"><?php esc_attr_e( 'Archives', 'lsx' ); ?></h1> |
|
| 56 | + <h1 class="widget-title"><?php esc_attr_e('Archives', 'lsx'); ?></h1> |
|
| 57 | 57 | <ul> |
| 58 | - <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?> |
|
| 58 | + <?php wp_get_archives(array('type' => 'monthly')); ?> |
|
| 59 | 59 | </ul> |
| 60 | 60 | </aside> |
| 61 | 61 | |
| 62 | 62 | <aside id="meta" class="widget"> |
| 63 | - <h1 class="widget-title"><?php esc_attr_e( 'Meta', 'lsx' ); ?></h1> |
|
| 63 | + <h1 class="widget-title"><?php esc_attr_e('Meta', 'lsx'); ?></h1> |
|
| 64 | 64 | <ul> |
| 65 | 65 | <?php wp_register(); ?> |
| 66 | 66 | <li><?php wp_loginout(); ?></li> |
@@ -1,24 +1,24 @@ |
||
| 1 | 1 | <?php |
| 2 | - if ( isset( $GLOBALS['comment_depth'] ) ) { |
|
| 3 | - $depth = intval( $GLOBALS['comment_depth'] ); |
|
| 2 | + if (isset($GLOBALS['comment_depth'])) { |
|
| 3 | + $depth = intval($GLOBALS['comment_depth']); |
|
| 4 | 4 | } else { |
| 5 | 5 | $depth = 1; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - $max_depth = intval( get_option( 'thread_comments_depth' ) ); |
|
| 8 | + $max_depth = intval(get_option('thread_comments_depth')); |
|
| 9 | 9 | ?> |
| 10 | 10 | |
| 11 | 11 | <?php echo get_avatar($comment, '64'); ?> |
| 12 | 12 | <div class="media-body"> |
| 13 | 13 | <h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4> |
| 14 | - <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(), get_comment_time()); ?></a></time> |
|
| 14 | + <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(), get_comment_time()); ?></a></time> |
|
| 15 | 15 | <?php edit_comment_link(esc_html__('(Edit)', 'lsx'), '', ''); ?> |
| 16 | 16 | |
| 17 | - <?php if ( '0' == $comment->comment_approved ) : ?> |
|
| 17 | + <?php if ('0' == $comment->comment_approved) : ?> |
|
| 18 | 18 | <div class="alert alert-info"> |
| 19 | 19 | <?php esc_html_e('Your comment is awaiting moderation.', 'lsx'); ?> |
| 20 | 20 | </div> |
| 21 | 21 | <?php endif; ?> |
| 22 | 22 | |
| 23 | 23 | <?php comment_text(); ?> |
| 24 | -<?php comment_reply_link( array( 'depth' => $depth, 'max_depth' => $max_depth ) ); |
|
| 25 | 24 | \ No newline at end of file |
| 25 | +<?php comment_reply_link(array('depth' => $depth, 'max_depth' => $max_depth)); |
|
| 26 | 26 | \ No newline at end of file |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customizer Header Swatch Control Class |
| 6 | 6 | * |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | */ |
| 9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 10 | 10 | return; |
| 11 | 11 | } |
| 12 | 12 | class LSX_Customize_Header_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * @param string $id |
| 39 | 39 | * @param array $args |
| 40 | 40 | */ |
| 41 | - public function __construct( $manager, $id, $args = array() ) { |
|
| 42 | - parent::__construct( $manager, $id, $args ); |
|
| 43 | - if( !empty( $args['choices'] ) ){ |
|
| 41 | + public function __construct($manager, $id, $args = array()) { |
|
| 42 | + parent::__construct($manager, $id, $args); |
|
| 43 | + if ( ! empty($args['choices'])) { |
|
| 44 | 44 | $this->layouts = $args['choices']; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function enqueue() { |
| 54 | 54 | // |
| 55 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), LSX_VERSION, true ); |
|
| 55 | + wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), LSX_VERSION, true); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -62,30 +62,30 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function render_content() { |
| 64 | 64 | |
| 65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
| 65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
| 66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
| 67 | 67 | $value = $this->value(); |
| 68 | 68 | |
| 69 | 69 | ?> |
| 70 | 70 | <label> |
| 71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
| 71 | + <?php if ( ! empty($this->label)) { ?> |
|
| 72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
| 73 | 73 | <?php } |
| 74 | - if ( ! empty( $this->description ) ) { ?> |
|
| 75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
| 74 | + if ( ! empty($this->description)) { ?> |
|
| 75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
| 76 | 76 | <?php } ?> |
| 77 | 77 | <div class="header-layouts-selector"> |
| 78 | 78 | <?php |
| 79 | - foreach( $this->layouts as $layout ){ |
|
| 79 | + foreach ($this->layouts as $layout) { |
|
| 80 | 80 | $sel = 'border: 1px solid transparent;'; |
| 81 | - if( $value == $layout ){ |
|
| 81 | + if ($value == $layout) { |
|
| 82 | 82 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
| 83 | 83 | } |
| 84 | - echo '<img class="header-layout-button" style="padding:2px;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/header-' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">'; |
|
| 84 | + echo '<img class="header-layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/header-' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | ?> |
| 88 | - <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>> |
|
| 88 | + <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> |
|
| 89 | 89 | </div> |
| 90 | 90 | </label> |
| 91 | 91 | <?php |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customizer Configuration File |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @author [email protected] <lsdev.biz> |
| 10 | 10 | * |
| 11 | 11 | */ |
| 12 | -if ( ! class_exists( 'LSX_Theme_Customizer' ) ) { |
|
| 12 | +if ( ! class_exists('LSX_Theme_Customizer')) { |
|
| 13 | 13 | |
| 14 | 14 | class LSX_Theme_Customizer { |
| 15 | 15 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @since 1.0.0 |
| 31 | 31 | */ |
| 32 | - public function __construct( $controls ) { |
|
| 32 | + public function __construct($controls) { |
|
| 33 | 33 | require get_template_directory() . '/inc/google-font.php'; |
| 34 | 34 | require get_template_directory() . '/inc/google-font-collection.php'; |
| 35 | 35 | require get_template_directory() . '/inc/customizer-core.php'; |
@@ -40,19 +40,19 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $this->controls = $controls; |
| 42 | 42 | |
| 43 | - add_action( 'customize_preview_init', array($this,'customize_preview_js' ),20); |
|
| 44 | - add_action( 'customize_register', array($this,'customizer'), 11 ); |
|
| 43 | + add_action('customize_preview_init', array($this, 'customize_preview_js'), 20); |
|
| 44 | + add_action('customize_register', array($this, 'customizer'), 11); |
|
| 45 | 45 | |
| 46 | - add_action( 'wp_ajax_customizer_site_title', array($this,'ajax_site_title') ); |
|
| 47 | - add_action( 'wp_ajax_nopriv_customizer_site_title', array($this,'ajax_site_title') ); |
|
| 46 | + add_action('wp_ajax_customizer_site_title', array($this, 'ajax_site_title')); |
|
| 47 | + add_action('wp_ajax_nopriv_customizer_site_title', array($this, 'ajax_site_title')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
| 52 | 52 | */ |
| 53 | 53 | function customize_preview_js() { |
| 54 | - wp_enqueue_script( 'lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), LSX_VERSION, true ); |
|
| 55 | - wp_localize_script( 'lsx_customizer', 'lsx_customizer_params', array( 'template_directory' => get_template_directory_uri() ) ); |
|
| 54 | + wp_enqueue_script('lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), LSX_VERSION, true); |
|
| 55 | + wp_localize_script('lsx_customizer', 'lsx_customizer_params', array('template_directory' => get_template_directory_uri())); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -60,38 +60,38 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @since 1.0.0 |
| 62 | 62 | */ |
| 63 | - public function customizer( $wp_customize ) { |
|
| 63 | + public function customizer($wp_customize) { |
|
| 64 | 64 | // start panels |
| 65 | - if( !empty( $this->controls['panels'] ) ){ |
|
| 66 | - foreach( $this->controls['panels'] as $panel_slug => $args ){ |
|
| 67 | - $this->add_panel( $panel_slug, $args, $wp_customize ); |
|
| 65 | + if ( ! empty($this->controls['panels'])) { |
|
| 66 | + foreach ($this->controls['panels'] as $panel_slug => $args) { |
|
| 67 | + $this->add_panel($panel_slug, $args, $wp_customize); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // start sections |
| 72 | - if( !empty( $this->controls['sections'] ) ){ |
|
| 73 | - foreach( $this->controls['sections'] as $section_slug => $args ){ |
|
| 74 | - $this->add_section( $section_slug, $args, $wp_customize ); |
|
| 72 | + if ( ! empty($this->controls['sections'])) { |
|
| 73 | + foreach ($this->controls['sections'] as $section_slug => $args) { |
|
| 74 | + $this->add_section($section_slug, $args, $wp_customize); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // start settings |
| 79 | - if( !empty( $this->controls['settings'] ) ){ |
|
| 80 | - foreach( $this->controls['settings'] as $settings_slug => $args ){ |
|
| 81 | - $this->add_setting( $settings_slug, $args, $wp_customize ); |
|
| 79 | + if ( ! empty($this->controls['settings'])) { |
|
| 80 | + foreach ($this->controls['settings'] as $settings_slug => $args) { |
|
| 81 | + $this->add_setting($settings_slug, $args, $wp_customize); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // start fields |
| 86 | - if( !empty( $this->controls['fields'] ) ){ |
|
| 87 | - foreach( $this->controls['fields'] as $field_slug => $args ){ |
|
| 88 | - $this->add_control( $field_slug, $args, $wp_customize ); |
|
| 86 | + if ( ! empty($this->controls['fields'])) { |
|
| 87 | + foreach ($this->controls['fields'] as $field_slug => $args) { |
|
| 88 | + $this->add_control($field_slug, $args, $wp_customize); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
| 93 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
| 94 | - $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; |
|
| 92 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
| 93 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
| 94 | + $wp_customize->get_setting('background_color')->transport = 'postMessage'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @since 1.0.0 |
| 101 | 101 | */ |
| 102 | - private function add_panel( $slug, $args, $wp_customize ) { |
|
| 102 | + private function add_panel($slug, $args, $wp_customize) { |
|
| 103 | 103 | $default_args = array( |
| 104 | 104 | 'title' => null, |
| 105 | 105 | 'description' => null, |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $wp_customize->add_panel( |
| 109 | 109 | $slug, |
| 110 | - array_merge( $default_args, $args ) |
|
| 110 | + array_merge($default_args, $args) |
|
| 111 | 111 | ); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @since 1.0.0 |
| 118 | 118 | */ |
| 119 | - private function add_section( $slug, $args, $wp_customize ) { |
|
| 119 | + private function add_section($slug, $args, $wp_customize) { |
|
| 120 | 120 | $default_args = array( |
| 121 | 121 | 'capability' => 'edit_theme_options', //Capability needed to tweak |
| 122 | 122 | 'description' => null, //Descriptive tooltip |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - $wp_customize->add_section( $slug, |
|
| 126 | - array_merge( $default_args, $args ) |
|
| 125 | + $wp_customize->add_section($slug, |
|
| 126 | + array_merge($default_args, $args) |
|
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | * |
| 133 | 133 | * @since 1.0.0 |
| 134 | 134 | */ |
| 135 | - private function add_setting( $slug, $args, $wp_customize ) { |
|
| 136 | - $wp_customize->add_setting( $slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
| 137 | - array_merge( array( |
|
| 135 | + private function add_setting($slug, $args, $wp_customize) { |
|
| 136 | + $wp_customize->add_setting($slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
| 137 | + array_merge(array( |
|
| 138 | 138 | 'default' => null, //Default setting/value to save |
| 139 | 139 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 140 | 140 | 'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting. |
| 141 | 141 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 142 | 142 | 'sanitize_callback' => 'lsx_sanitize_choices' |
| 143 | - ), $args ) |
|
| 143 | + ), $args) |
|
| 144 | 144 | ); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,28 +149,28 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @since 1.0.0 |
| 151 | 151 | */ |
| 152 | - private function add_control( $slug, $args, $wp_customize ) { |
|
| 152 | + private function add_control($slug, $args, $wp_customize) { |
|
| 153 | 153 | $default_args = array( |
| 154 | 154 | |
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | - if( isset( $args['control'] ) && class_exists( $args['control'] )){ |
|
| 157 | + if (isset($args['control']) && class_exists($args['control'])) { |
|
| 158 | 158 | |
| 159 | 159 | $control_class = $args['control']; |
| 160 | - unset( $args['control'] ); |
|
| 160 | + unset($args['control']); |
|
| 161 | 161 | |
| 162 | - $control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) ); |
|
| 163 | - $wp_customize->add_control( $control ); |
|
| 162 | + $control = new $control_class($wp_customize, $slug, array_merge($default_args, $args)); |
|
| 163 | + $wp_customize->add_control($control); |
|
| 164 | 164 | |
| 165 | - }else{ |
|
| 165 | + } else { |
|
| 166 | 166 | |
| 167 | - if( isset( $args['control'] ) ){ |
|
| 168 | - unset( $args['control'] ); |
|
| 167 | + if (isset($args['control'])) { |
|
| 168 | + unset($args['control']); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $wp_customize->add_control( |
| 172 | 172 | $slug, |
| 173 | - array_merge( $default_args, $args ) |
|
| 173 | + array_merge($default_args, $args) |
|
| 174 | 174 | ); |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -12,26 +12,26 @@ discard block |
||
| 12 | 12 | * Hooks |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 ); |
|
| 16 | -remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 ); |
|
| 15 | +remove_action('sensei_before_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper'), 10); |
|
| 16 | +remove_action('sensei_after_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper_end'), 10); |
|
| 17 | 17 | |
| 18 | 18 | add_action('sensei_before_main_content', 'lsx_sensei_before_content', 10); |
| 19 | 19 | add_action('sensei_after_main_content', 'lsx_sensei_after_content', 10); |
| 20 | 20 | |
| 21 | 21 | //Switching the course filters and the headers around |
| 22 | -remove_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 ); |
|
| 23 | -remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ) ); |
|
| 24 | -remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ) ); |
|
| 25 | -add_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 ); |
|
| 26 | -add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ),12 ); |
|
| 27 | -add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ),12 ); |
|
| 22 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0); |
|
| 23 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting')); |
|
| 24 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters')); |
|
| 25 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0); |
|
| 26 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12); |
|
| 27 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12); |
|
| 28 | 28 | |
| 29 | 29 | // Moving course image up in DOM |
| 30 | -remove_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,10, 1 ); |
|
| 31 | -add_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,1, 1 ); |
|
| 30 | +remove_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 10, 1); |
|
| 31 | +add_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 1, 1); |
|
| 32 | 32 | |
| 33 | -remove_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 20 ); |
|
| 34 | -add_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 12 ); |
|
| 33 | +remove_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 20); |
|
| 34 | +add_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 12); |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Adds the top and primary divs for the layout. |
@@ -39,22 +39,22 @@ discard block |
||
| 39 | 39 | * @subpackage sensei |
| 40 | 40 | * @category layout |
| 41 | 41 | */ |
| 42 | -function lsx_sensei_wp_head(){ |
|
| 42 | +function lsx_sensei_wp_head() { |
|
| 43 | 43 | |
| 44 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 45 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 44 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 45 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 46 | 46 | |
| 47 | - if('1c' === $layout && is_post_type_archive(array('course','lesson'))) { |
|
| 48 | - add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11 ); |
|
| 47 | + if ('1c' === $layout && is_post_type_archive(array('course', 'lesson'))) { |
|
| 48 | + add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if('1c' === $layout && is_tax(array('module','course-category'))) { |
|
| 51 | + if ('1c' === $layout && is_tax(array('module', 'course-category'))) { |
|
| 52 | 52 | remove_action('lsx_content_top', 'lsx_breadcrumbs'); |
| 53 | - add_action( 'sensei_loop_course_before', 'lsx_breadcrumbs', 80 , 1 ); |
|
| 53 | + add_action('sensei_loop_course_before', 'lsx_breadcrumbs', 80, 1); |
|
| 54 | 54 | |
| 55 | - if(is_tax('module')){ |
|
| 56 | - remove_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 20 ); |
|
| 57 | - add_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 40 ); |
|
| 55 | + if (is_tax('module')) { |
|
| 56 | + remove_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 20); |
|
| 57 | + add_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 40); |
|
| 58 | 58 | |
| 59 | 59 | remove_action('sensei_content_lesson_inside_before', array('Sensei_Core_Modules', 'module_archive_description'), 11); |
| 60 | 60 | } |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | * @subpackage sensei |
| 74 | 74 | * @category layout |
| 75 | 75 | */ |
| 76 | -function lsx_sensei_before_content(){ ?> |
|
| 76 | +function lsx_sensei_before_content() { ?> |
|
| 77 | 77 | <?php lsx_content_wrap_before(); ?> |
| 78 | 78 | |
| 79 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 79 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 80 | 80 | |
| 81 | 81 | <?php lsx_content_before(); ?> |
| 82 | 82 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @subpackage sensei |
| 93 | 93 | * @category layout |
| 94 | 94 | */ |
| 95 | -function lsx_sensei_after_content(){ ?> |
|
| 95 | +function lsx_sensei_after_content() { ?> |
|
| 96 | 96 | <?php lsx_content_bottom(); ?> |
| 97 | 97 | |
| 98 | 98 | </main><!-- #main --> |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @subpackage sensei |
| 117 | 117 | * @category redirect |
| 118 | 118 | */ |
| 119 | -add_filter( 'sensei_disable_styles', '__return_true' ); |
|
| 119 | +add_filter('sensei_disable_styles', '__return_true'); |
|
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * Includes the sensei specific styles. |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | * @category styles |
| 126 | 126 | */ |
| 127 | 127 | function lsx_sensei_styles() { |
| 128 | - wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css', array(), LSX_VERSION ); |
|
| 128 | + wp_enqueue_style('sensei', get_template_directory_uri() . '/css/sensei.css', array(), LSX_VERSION); |
|
| 129 | 129 | } |
| 130 | -add_action( 'wp_enqueue_scripts', 'lsx_sensei_styles' ); |
|
| 130 | +add_action('wp_enqueue_scripts', 'lsx_sensei_styles'); |
|
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | 133 | * Redirects Lessons Archive to Courses Overview |
@@ -135,13 +135,13 @@ discard block |
||
| 135 | 135 | * @subpackage woocommerce |
| 136 | 136 | * @category styles |
| 137 | 137 | */ |
| 138 | -function lsx_sensei_redirect_to_home( $query ){ |
|
| 139 | - if(!is_admin() && is_post_type_archive( 'lesson' ) ) { |
|
| 140 | - wp_redirect( home_url() . '/courses-overview' ); |
|
| 138 | +function lsx_sensei_redirect_to_home($query) { |
|
| 139 | + if ( ! is_admin() && is_post_type_archive('lesson')) { |
|
| 140 | + wp_redirect(home_url() . '/courses-overview'); |
|
| 141 | 141 | exit; |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | -add_action( 'parse_query', 'lsx_sensei_redirect_to_home' ); |
|
| 144 | +add_action('parse_query', 'lsx_sensei_redirect_to_home'); |
|
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * Filters the archive title |
@@ -149,10 +149,10 @@ discard block |
||
| 149 | 149 | * @subpackage woocommerce |
| 150 | 150 | * @category styles |
| 151 | 151 | */ |
| 152 | -function lsx_sensei_category_title( $html,$term_id ){ |
|
| 153 | - $html = str_replace('h2','h1',$html); |
|
| 154 | - $html = str_replace('sensei-category-title','archive-title',$html); |
|
| 152 | +function lsx_sensei_category_title($html, $term_id) { |
|
| 153 | + $html = str_replace('h2', 'h1', $html); |
|
| 154 | + $html = str_replace('sensei-category-title', 'archive-title', $html); |
|
| 155 | 155 | |
| 156 | - return '<header class="archive-header">'.$html.'</header>'; |
|
| 156 | + return '<header class="archive-header">' . $html . '</header>'; |
|
| 157 | 157 | } |
| 158 | -add_filter( 'course_category_title', 'lsx_sensei_category_title',1,10 ); |
|
| 159 | 158 | \ No newline at end of file |
| 159 | +add_filter('course_category_title', 'lsx_sensei_category_title', 1, 10); |
|
| 160 | 160 | \ No newline at end of file |
@@ -14,6 +14,6 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | function lsx_wp_job_manager_styles() { |
| 17 | - wp_enqueue_style( 'wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css', array(), LSX_VERSION ); |
|
| 17 | + wp_enqueue_style('wp_job_manager', get_template_directory_uri() . '/css/wp-job-manager.css', array(), LSX_VERSION); |
|
| 18 | 18 | } |
| 19 | -add_action( 'wp_enqueue_scripts', 'lsx_wp_job_manager_styles' ); |
|
| 20 | 19 | \ No newline at end of file |
| 20 | +add_action('wp_enqueue_scripts', 'lsx_wp_job_manager_styles'); |
|
| 21 | 21 | \ No newline at end of file |
@@ -9,8 +9,8 @@ discard block |
||
| 9 | 9 | /* |
| 10 | 10 | * Hooks |
| 11 | 11 | */ |
| 12 | -remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
| 13 | -remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
| 12 | +remove_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); |
|
| 13 | +remove_action('woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); |
|
| 14 | 14 | |
| 15 | 15 | add_action('woocommerce_before_main_content', 'lsx_woocommerce_before_content', 10); |
| 16 | 16 | add_action('woocommerce_after_main_content', 'lsx_woocommerce_after_content', 10); |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | * @subpackage woocommerce |
| 26 | 26 | * @category layout |
| 27 | 27 | */ |
| 28 | -function lsx_woocommerce_before_content(){ ?> |
|
| 28 | +function lsx_woocommerce_before_content() { ?> |
|
| 29 | 29 | <?php lsx_content_wrap_before(); ?> |
| 30 | 30 | |
| 31 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 31 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 32 | 32 | |
| 33 | 33 | <?php lsx_content_before(); ?> |
| 34 | 34 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @subpackage woocommerce |
| 44 | 44 | * @category layout |
| 45 | 45 | */ |
| 46 | -function lsx_woocommerce_after_content(){ ?> |
|
| 46 | +function lsx_woocommerce_after_content() { ?> |
|
| 47 | 47 | <?php lsx_content_bottom(); ?> |
| 48 | 48 | |
| 49 | 49 | </main><!-- #main --> |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | * @subpackage woocommerce |
| 67 | 67 | * @category styles |
| 68 | 68 | */ |
| 69 | -add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
|
| 69 | +add_filter('woocommerce_enqueue_styles', '__return_empty_array'); |
|
| 70 | 70 | |
| 71 | 71 | function lsx_woocommerce_styles() { |
| 72 | - wp_enqueue_style( 'woocommerce-layout', get_template_directory_uri() . '/css/woocommerce-layout.css', array(), LSX_VERSION, 'all' ); |
|
| 73 | - wp_enqueue_style( 'woocommerce-smallscreen', get_template_directory_uri() . '/css/woocommerce-smallscreen.css', array( 'woocommerce-layout' ), LSX_VERSION, 'only screen and (max-width: 767px)' ); |
|
| 74 | - wp_enqueue_style( 'woocommerce-general', get_template_directory_uri() . '/css/woocommerce.css', array(), LSX_VERSION, 'all' ); |
|
| 72 | + wp_enqueue_style('woocommerce-layout', get_template_directory_uri() . '/css/woocommerce-layout.css', array(), LSX_VERSION, 'all'); |
|
| 73 | + wp_enqueue_style('woocommerce-smallscreen', get_template_directory_uri() . '/css/woocommerce-smallscreen.css', array('woocommerce-layout'), LSX_VERSION, 'only screen and (max-width: 767px)'); |
|
| 74 | + wp_enqueue_style('woocommerce-general', get_template_directory_uri() . '/css/woocommerce.css', array(), LSX_VERSION, 'all'); |
|
| 75 | 75 | } |
| 76 | -add_action( 'wp_enqueue_scripts', 'lsx_woocommerce_styles' ); |
|
| 77 | 76 | \ No newline at end of file |
| 77 | +add_action('wp_enqueue_scripts', 'lsx_woocommerce_styles'); |
|
| 78 | 78 | \ No newline at end of file |