@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * Add our action to init to set up our vars first. |
| 14 | 14 | */ |
| 15 | 15 | function lsx_projects_load_plugin_textdomain() { |
| 16 | - load_plugin_textdomain( 'lsx-projects', false, basename( LSX_PROJECTS_PATH ) . '/languages' ); |
|
| 16 | + load_plugin_textdomain( 'lsx-projects', false, basename( LSX_PROJECTS_PATH ) . '/languages' ); |
|
| 17 | 17 | } |
| 18 | 18 | add_action( 'init', 'lsx_projects_load_plugin_textdomain' ); |
| 19 | 19 | |
@@ -21,16 +21,16 @@ discard block |
||
| 21 | 21 | * Wraps the output class in a function to be called in templates |
| 22 | 22 | */ |
| 23 | 23 | function lsx_projects( $args ) { |
| 24 | - $lsx_projects = new LSX_Projects; |
|
| 25 | - echo wp_kses_post( $lsx_projects->output( $args ) ); |
|
| 24 | + $lsx_projects = new LSX_Projects; |
|
| 25 | + echo wp_kses_post( $lsx_projects->output( $args ) ); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Shortcode |
| 30 | 30 | */ |
| 31 | 31 | function lsx_projects_shortcode( $atts ) { |
| 32 | - $lsx_projects = new LSX_Projects; |
|
| 33 | - return $lsx_projects->output( $atts ); |
|
| 32 | + $lsx_projects = new LSX_Projects; |
|
| 33 | + return $lsx_projects->output( $atts ); |
|
| 34 | 34 | } |
| 35 | 35 | add_shortcode( 'lsx_projects', 'lsx_projects_shortcode' ); |
| 36 | 36 | |
@@ -38,23 +38,23 @@ discard block |
||
| 38 | 38 | * Wraps the output class in a function to be called in templates |
| 39 | 39 | */ |
| 40 | 40 | function lsx_groups_list() { |
| 41 | - do_action( 'lsx_groups_list' ); |
|
| 41 | + do_action( 'lsx_groups_list' ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | function lsx_child_group_list() { |
| 45 | - do_action( 'lsx_child_group_list' ); |
|
| 45 | + do_action( 'lsx_child_group_list' ); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | function lsx_projects_list() { |
| 49 | - do_action( 'lsx_projects_list' ); |
|
| 49 | + do_action( 'lsx_projects_list' ); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | function lsx_projects_sidebar() { |
| 53 | - do_action( 'lsx_projects_sidebar' ); |
|
| 53 | + do_action( 'lsx_projects_sidebar' ); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | function lsx_projects_single_tag() { |
| 57 | - do_action( 'lsx_projects_single_tag' ); |
|
| 57 | + do_action( 'lsx_projects_single_tag' ); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -65,23 +65,23 @@ discard block |
||
| 65 | 65 | * @return mixed Option value |
| 66 | 66 | */ |
| 67 | 67 | function projects_get_options() { |
| 68 | - $options = array(); |
|
| 69 | - if ( function_exists( 'tour_operator' ) ) { |
|
| 70 | - $options = get_option( '_lsx-to_settings', false ); |
|
| 71 | - } else { |
|
| 72 | - $options = get_option( '_lsx_settings', false ); |
|
| 73 | - |
|
| 74 | - if ( false === $options ) { |
|
| 75 | - $options = get_option( '_lsx_lsx-settings', false ); |
|
| 76 | - } |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - // If there are new CMB2 options available, then use those. |
|
| 80 | - $new_options = get_option( 'lsx_projects_options', false ); |
|
| 81 | - if ( false !== $new_options ) { |
|
| 82 | - $options['display'] = $new_options; |
|
| 83 | - } |
|
| 84 | - return $options; |
|
| 68 | + $options = array(); |
|
| 69 | + if ( function_exists( 'tour_operator' ) ) { |
|
| 70 | + $options = get_option( '_lsx-to_settings', false ); |
|
| 71 | + } else { |
|
| 72 | + $options = get_option( '_lsx_settings', false ); |
|
| 73 | + |
|
| 74 | + if ( false === $options ) { |
|
| 75 | + $options = get_option( '_lsx_lsx-settings', false ); |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + // If there are new CMB2 options available, then use those. |
|
| 80 | + $new_options = get_option( 'lsx_projects_options', false ); |
|
| 81 | + if ( false !== $new_options ) { |
|
| 82 | + $options['display'] = $new_options; |
|
| 83 | + } |
|
| 84 | + return $options; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -92,28 +92,28 @@ discard block |
||
| 92 | 92 | * @return mixed Option value |
| 93 | 93 | */ |
| 94 | 94 | function projects_get_option( $key = '', $default = false ) { |
| 95 | - $options = array(); |
|
| 96 | - $value = $default; |
|
| 97 | - if ( function_exists( 'tour_operator' ) ) { |
|
| 98 | - $options = get_option( '_lsx-to_settings', false ); |
|
| 99 | - } else { |
|
| 100 | - $options = get_option( '_lsx_settings', false ); |
|
| 101 | - |
|
| 102 | - if ( false === $options ) { |
|
| 103 | - $options = get_option( '_lsx_lsx-settings', false ); |
|
| 104 | - } |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - // If there are new CMB2 options available, then use those. |
|
| 108 | - $new_options = get_option( 'lsx_projects_options', false ); |
|
| 109 | - if ( false !== $new_options ) { |
|
| 110 | - $options['display'] = $new_options; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - if ( isset( $options['display'] ) && isset( $options['display'][ $key ] ) ) { |
|
| 114 | - $value = $options['display'][ $key ]; |
|
| 115 | - } |
|
| 116 | - return $value; |
|
| 95 | + $options = array(); |
|
| 96 | + $value = $default; |
|
| 97 | + if ( function_exists( 'tour_operator' ) ) { |
|
| 98 | + $options = get_option( '_lsx-to_settings', false ); |
|
| 99 | + } else { |
|
| 100 | + $options = get_option( '_lsx_settings', false ); |
|
| 101 | + |
|
| 102 | + if ( false === $options ) { |
|
| 103 | + $options = get_option( '_lsx_lsx-settings', false ); |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + // If there are new CMB2 options available, then use those. |
|
| 108 | + $new_options = get_option( 'lsx_projects_options', false ); |
|
| 109 | + if ( false !== $new_options ) { |
|
| 110 | + $options['display'] = $new_options; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + if ( isset( $options['display'] ) && isset( $options['display'][ $key ] ) ) { |
|
| 114 | + $value = $options['display'][ $key ]; |
|
| 115 | + } |
|
| 116 | + return $value; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -124,10 +124,10 @@ discard block |
||
| 124 | 124 | * @return void |
| 125 | 125 | */ |
| 126 | 126 | function portfolio_modify_archive_title( $title ) { |
| 127 | - if ( ! is_post_type_archive( 'project' ) ) { |
|
| 128 | - return $title; |
|
| 129 | - } |
|
| 130 | - $title = __( 'Portfolio', 'lsx' ); |
|
| 131 | - return $title; |
|
| 127 | + if ( ! is_post_type_archive( 'project' ) ) { |
|
| 128 | + return $title; |
|
| 129 | + } |
|
| 130 | + $title = __( 'Portfolio', 'lsx' ); |
|
| 131 | + return $title; |
|
| 132 | 132 | } |
| 133 | 133 | add_filter( 'get_the_archive_title', 'portfolio_modify_archive_title', 10, 1 ); |
@@ -13,48 +13,48 @@ discard block |
||
| 13 | 13 | * Add our action to init to set up our vars first. |
| 14 | 14 | */ |
| 15 | 15 | function lsx_projects_load_plugin_textdomain() { |
| 16 | - load_plugin_textdomain( 'lsx-projects', false, basename( LSX_PROJECTS_PATH ) . '/languages' ); |
|
| 16 | + load_plugin_textdomain('lsx-projects', false, basename(LSX_PROJECTS_PATH) . '/languages'); |
|
| 17 | 17 | } |
| 18 | -add_action( 'init', 'lsx_projects_load_plugin_textdomain' ); |
|
| 18 | +add_action('init', 'lsx_projects_load_plugin_textdomain'); |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Wraps the output class in a function to be called in templates |
| 22 | 22 | */ |
| 23 | -function lsx_projects( $args ) { |
|
| 23 | +function lsx_projects($args) { |
|
| 24 | 24 | $lsx_projects = new LSX_Projects; |
| 25 | - echo wp_kses_post( $lsx_projects->output( $args ) ); |
|
| 25 | + echo wp_kses_post($lsx_projects->output($args)); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Shortcode |
| 30 | 30 | */ |
| 31 | -function lsx_projects_shortcode( $atts ) { |
|
| 31 | +function lsx_projects_shortcode($atts) { |
|
| 32 | 32 | $lsx_projects = new LSX_Projects; |
| 33 | - return $lsx_projects->output( $atts ); |
|
| 33 | + return $lsx_projects->output($atts); |
|
| 34 | 34 | } |
| 35 | -add_shortcode( 'lsx_projects', 'lsx_projects_shortcode' ); |
|
| 35 | +add_shortcode('lsx_projects', 'lsx_projects_shortcode'); |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Wraps the output class in a function to be called in templates |
| 39 | 39 | */ |
| 40 | 40 | function lsx_groups_list() { |
| 41 | - do_action( 'lsx_groups_list' ); |
|
| 41 | + do_action('lsx_groups_list'); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | function lsx_child_group_list() { |
| 45 | - do_action( 'lsx_child_group_list' ); |
|
| 45 | + do_action('lsx_child_group_list'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | function lsx_projects_list() { |
| 49 | - do_action( 'lsx_projects_list' ); |
|
| 49 | + do_action('lsx_projects_list'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | function lsx_projects_sidebar() { |
| 53 | - do_action( 'lsx_projects_sidebar' ); |
|
| 53 | + do_action('lsx_projects_sidebar'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | function lsx_projects_single_tag() { |
| 57 | - do_action( 'lsx_projects_single_tag' ); |
|
| 57 | + do_action('lsx_projects_single_tag'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -66,19 +66,19 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | function projects_get_options() { |
| 68 | 68 | $options = array(); |
| 69 | - if ( function_exists( 'tour_operator' ) ) { |
|
| 70 | - $options = get_option( '_lsx-to_settings', false ); |
|
| 69 | + if (function_exists('tour_operator')) { |
|
| 70 | + $options = get_option('_lsx-to_settings', false); |
|
| 71 | 71 | } else { |
| 72 | - $options = get_option( '_lsx_settings', false ); |
|
| 72 | + $options = get_option('_lsx_settings', false); |
|
| 73 | 73 | |
| 74 | - if ( false === $options ) { |
|
| 75 | - $options = get_option( '_lsx_lsx-settings', false ); |
|
| 74 | + if (false === $options) { |
|
| 75 | + $options = get_option('_lsx_lsx-settings', false); |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // If there are new CMB2 options available, then use those. |
| 80 | - $new_options = get_option( 'lsx_projects_options', false ); |
|
| 81 | - if ( false !== $new_options ) { |
|
| 80 | + $new_options = get_option('lsx_projects_options', false); |
|
| 81 | + if (false !== $new_options) { |
|
| 82 | 82 | $options['display'] = $new_options; |
| 83 | 83 | } |
| 84 | 84 | return $options; |
@@ -91,27 +91,27 @@ discard block |
||
| 91 | 91 | * @param mixed $default Optional default value |
| 92 | 92 | * @return mixed Option value |
| 93 | 93 | */ |
| 94 | -function projects_get_option( $key = '', $default = false ) { |
|
| 94 | +function projects_get_option($key = '', $default = false) { |
|
| 95 | 95 | $options = array(); |
| 96 | 96 | $value = $default; |
| 97 | - if ( function_exists( 'tour_operator' ) ) { |
|
| 98 | - $options = get_option( '_lsx-to_settings', false ); |
|
| 97 | + if (function_exists('tour_operator')) { |
|
| 98 | + $options = get_option('_lsx-to_settings', false); |
|
| 99 | 99 | } else { |
| 100 | - $options = get_option( '_lsx_settings', false ); |
|
| 100 | + $options = get_option('_lsx_settings', false); |
|
| 101 | 101 | |
| 102 | - if ( false === $options ) { |
|
| 103 | - $options = get_option( '_lsx_lsx-settings', false ); |
|
| 102 | + if (false === $options) { |
|
| 103 | + $options = get_option('_lsx_lsx-settings', false); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // If there are new CMB2 options available, then use those. |
| 108 | - $new_options = get_option( 'lsx_projects_options', false ); |
|
| 109 | - if ( false !== $new_options ) { |
|
| 108 | + $new_options = get_option('lsx_projects_options', false); |
|
| 109 | + if (false !== $new_options) { |
|
| 110 | 110 | $options['display'] = $new_options; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if ( isset( $options['display'] ) && isset( $options['display'][ $key ] ) ) { |
|
| 114 | - $value = $options['display'][ $key ]; |
|
| 113 | + if (isset($options['display']) && isset($options['display'][$key])) { |
|
| 114 | + $value = $options['display'][$key]; |
|
| 115 | 115 | } |
| 116 | 116 | return $value; |
| 117 | 117 | } |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | * @param [type] $title |
| 124 | 124 | * @return void |
| 125 | 125 | */ |
| 126 | -function portfolio_modify_archive_title( $title ) { |
|
| 127 | - if ( ! is_post_type_archive( 'project' ) ) { |
|
| 126 | +function portfolio_modify_archive_title($title) { |
|
| 127 | + if ( ! is_post_type_archive('project')) { |
|
| 128 | 128 | return $title; |
| 129 | 129 | } |
| 130 | - $title = __( 'Portfolio', 'lsx' ); |
|
| 130 | + $title = __('Portfolio', 'lsx'); |
|
| 131 | 131 | return $title; |
| 132 | 132 | } |
| 133 | -add_filter( 'get_the_archive_title', 'portfolio_modify_archive_title', 10, 1 ); |
|
| 133 | +add_filter('get_the_archive_title', 'portfolio_modify_archive_title', 10, 1); |
|