@@ -6,8 +6,7 @@ |
||
| 6 | 6 | use GeminiLabs\Castor\Container; |
| 7 | 7 | use GeminiLabs\Castor\Facade; |
| 8 | 8 | |
| 9 | -final class Application extends Container |
|
| 10 | -{ |
|
| 9 | +final class Application extends Container { |
|
| 11 | 10 | public $assets; |
| 12 | 11 | public $cssDir; |
| 13 | 12 | public $imgDir; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function copyright() |
| 42 | 42 | { |
| 43 | - return __( 'Copyright', 'castor' ) . ' © ' . date( 'Y' ) . ', ' . get_bloginfo( 'name' ); |
|
| 43 | + return __( 'Copyright', 'castor' ).' © '.date( 'Y' ).', '.get_bloginfo( 'name' ); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | foreach( ['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool ) { |
| 85 | 85 | if( !$bool() )continue; |
| 86 | - $method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool ))); |
|
| 86 | + $method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool ) ) ); |
|
| 87 | 87 | return $this->$method(); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | 'uri.template' => get_template_directory_uri(), |
| 106 | 106 | ]; |
| 107 | 107 | |
| 108 | - if( is_null( $path )) { |
|
| 108 | + if( is_null( $path ) ) { |
|
| 109 | 109 | return $paths; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function svg( $path = null ) |
| 123 | 123 | { |
| 124 | - if( file_exists( $this->imagePath( $path ))) { |
|
| 125 | - return file_get_contents( $this->imagePath( $path )); |
|
| 124 | + if( file_exists( $this->imagePath( $path ) ) ) { |
|
| 125 | + return file_get_contents( $this->imagePath( $path ) ); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -133,12 +133,12 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | protected function getArchiveTitle() |
| 135 | 135 | { |
| 136 | - return $this->archiveMeta->get( 'title', get_the_archive_title(), get_query_var( 'post_type' )); |
|
| 136 | + return $this->archiveMeta->get( 'title', get_the_archive_title(), get_query_var( 'post_type' ) ); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | protected function getHomeTitle() |
| 140 | 140 | { |
| 141 | - return ( $home = (string) get_option( 'page_for_posts' )) |
|
| 141 | + return ( $home = (string) get_option( 'page_for_posts' ) ) |
|
| 142 | 142 | ? get_the_title( $home ) |
| 143 | 143 | : __( 'Latest Posts', 'castor' ); |
| 144 | 144 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | { |
| 148 | 148 | return $this->postMeta->get( 'title', [ |
| 149 | 149 | 'fallback' => get_the_title(), |
| 150 | - ]); |
|
| 150 | + ] ); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | protected function getSearchTitle() |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function afterSetupTheme() |
| 18 | 18 | { |
| 19 | - castor_app()->cssDir = trailingslashit( (string) apply_filters( 'castor/assets/styles/dir', 'css' )); |
|
| 20 | - castor_app()->imgDir = trailingslashit( (string) apply_filters( 'castor/assets/images/dir', 'img' )); |
|
| 21 | - castor_app()->jsDir = trailingslashit( (string) apply_filters( 'castor/assets/scripts/dir', 'js' )); |
|
| 19 | + castor_app()->cssDir = trailingslashit( (string) apply_filters( 'castor/assets/styles/dir', 'css' ) ); |
|
| 20 | + castor_app()->imgDir = trailingslashit( (string) apply_filters( 'castor/assets/images/dir', 'img' ) ); |
|
| 21 | + castor_app()->jsDir = trailingslashit( (string) apply_filters( 'castor/assets/scripts/dir', 'js' ) ); |
|
| 22 | 22 | |
| 23 | - add_editor_style( Theme::assetUri( castor_app()->cssDir.'editor.css' )); |
|
| 23 | + add_editor_style( Theme::assetUri( castor_app()->cssDir.'editor.css' ) ); |
|
| 24 | 24 | add_theme_support( 'customize-selective-refresh-widgets' ); |
| 25 | 25 | add_theme_support( 'html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form'] ); |
| 26 | 26 | add_theme_support( 'post-thumbnails' ); |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | add_theme_support( 'soil-nice-search' ); |
| 31 | 31 | add_theme_support( 'soil-relative-urls' ); |
| 32 | 32 | add_theme_support( 'title-tag' ); |
| 33 | - load_theme_textdomain( 'castor', Theme::paths( 'dir.template' ) . '/languages' ); |
|
| 33 | + load_theme_textdomain( 'castor', Theme::paths( 'dir.template' ).'/languages' ); |
|
| 34 | 34 | |
| 35 | 35 | $menus = apply_filters( 'castor/register/nav_menus', [ |
| 36 | 36 | 'main_menu' => __( 'Main Menu', 'castor' ), |
| 37 | - ]); |
|
| 37 | + ] ); |
|
| 38 | 38 | |
| 39 | 39 | foreach( $menus as $location => $description ) { |
| 40 | 40 | register_nav_menu( $location, $description ); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | if( Theme::displaySidebar() ) { |
| 51 | 51 | $classes[] = 'has-sidebar'; |
| 52 | 52 | } |
| 53 | - return array_keys( array_flip( $classes )); |
|
| 53 | + return array_keys( array_flip( $classes ) ); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function filterTemplate( $template ) |
| 79 | 79 | { |
| 80 | - if( is_string( $template )) { |
|
| 80 | + if( is_string( $template ) ) { |
|
| 81 | 81 | $template = Template::setLayout( $template ); |
| 82 | 82 | Development::storeTemplatePath( $template ); |
| 83 | 83 | } |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function loadAdminFavicon() |
| 104 | 104 | { |
| 105 | - if( file_exists( Theme::assetPath( 'favicon/favicon-admin.ico' ))) { |
|
| 106 | - printf( '<link rel="shortcut icon" href="%s">', Theme::assetUri( 'favicon/favicon-admin.ico' )); |
|
| 105 | + if( file_exists( Theme::assetPath( 'favicon/favicon-admin.ico' ) ) ) { |
|
| 106 | + printf( '<link rel="shortcut icon" href="%s">', Theme::assetUri( 'favicon/favicon-admin.ico' ) ); |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function login() |
| 115 | 115 | { |
| 116 | - if( file_exists( Theme::assetPath( castor_app()->cssDir.'login.css' ))) { |
|
| 117 | - printf( '<link rel="stylesheet" href="%s">', Theme::assetUri( castor_app()->cssDir.'login.css' )); |
|
| 116 | + if( file_exists( Theme::assetPath( castor_app()->cssDir.'login.css' ) ) ) { |
|
| 117 | + printf( '<link rel="stylesheet" href="%s">', Theme::assetUri( castor_app()->cssDir.'login.css' ) ); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function registerAdminAssets() |
| 126 | 126 | { |
| 127 | - if( file_exists( Theme::assetPath( castor_app()->cssDir.'admin.css' ))) { |
|
| 127 | + if( file_exists( Theme::assetPath( castor_app()->cssDir.'admin.css' ) ) ) { |
|
| 128 | 128 | wp_enqueue_style( 'castor/admin.css', |
| 129 | 129 | Theme::assetUri( castor_app()->cssDir.'admin.css' ), |
| 130 | 130 | apply_filters( 'castor/enqueue/admin/css/deps', [] ), |
| 131 | 131 | null |
| 132 | 132 | ); |
| 133 | 133 | } |
| 134 | - if( file_exists( Theme::assetPath( castor_app()->jsDir.'admin.js' ))) { |
|
| 134 | + if( file_exists( Theme::assetPath( castor_app()->jsDir.'admin.js' ) ) ) { |
|
| 135 | 135 | wp_enqueue_script( 'castor/admin.js', |
| 136 | 136 | Theme::assetUri( castor_app()->jsDir.'admin.js' ), |
| 137 | 137 | apply_filters( 'castor/enqueue/admin/js/deps', [] ), |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | wp_localize_script( 'castor/main.js', apply_filters( 'castor/enqueue/js/localize/variable', 'globals' ), |
| 162 | 162 | apply_filters( 'castor/enqueue/js/localize/variables', [ |
| 163 | 163 | 'ajax' => admin_url( 'admin-ajax.php' ), |
| 164 | - ]) |
|
| 164 | + ] ) |
|
| 165 | 165 | ); |
| 166 | 166 | do_action( 'castor/register/assets' ); |
| 167 | 167 | wp_enqueue_style( 'castor/main.css' ); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | 'render_callback' => function() { |
| 181 | 181 | bloginfo( 'name' ); |
| 182 | 182 | }, |
| 183 | - ]); |
|
| 183 | + ] ); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -203,15 +203,15 @@ discard block |
||
| 203 | 203 | 'after_widget' => '</div>', |
| 204 | 204 | 'before_title' => '<h4>', |
| 205 | 205 | 'after_title' => '</h4>', |
| 206 | - ]); |
|
| 206 | + ] ); |
|
| 207 | 207 | |
| 208 | 208 | $sidebars = apply_filters( 'castor/register/sidebars', [ |
| 209 | 209 | 'sidebar-primary' => __( 'Primary Sidebar', 'castor' ), |
| 210 | 210 | 'sidebar-footer' => __( 'Footer Widgets', 'castor' ), |
| 211 | - ]); |
|
| 211 | + ] ); |
|
| 212 | 212 | |
| 213 | 213 | foreach( $sidebars as $id => $name ) { |
| 214 | - register_sidebar([ |
|
| 214 | + register_sidebar( [ |
|
| 215 | 215 | 'id' => $id, |
| 216 | 216 | 'name' => $name, |
| 217 | 217 | ] + $defaults ); |
@@ -2,19 +2,19 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | global $wp_version; |
| 4 | 4 | |
| 5 | -if( !is_admin() && version_compare( '7.0', phpversion(), '>' )) { |
|
| 5 | +if( !is_admin() && version_compare( '7.0', phpversion(), '>' ) ) { |
|
| 6 | 6 | wp_die( |
| 7 | 7 | __( 'You must be using PHP 7.0.0 or greater.', 'castor' ), |
| 8 | 8 | __( 'Unsupported PHP version', 'castor' ) |
| 9 | 9 | ); |
| 10 | 10 | } |
| 11 | -if( !is_admin() && version_compare( '4.7', $wp_version, '>' )) { |
|
| 11 | +if( !is_admin() && version_compare( '4.7', $wp_version, '>' ) ) { |
|
| 12 | 12 | wp_die( |
| 13 | 13 | __( 'You must be using WordPress 4.7.0 or greater.', 'castor' ), |
| 14 | 14 | __( 'Unsupported WordPress version', 'castor' ) |
| 15 | 15 | ); |
| 16 | 16 | } |
| 17 | -if( is_customize_preview() && filter_input( INPUT_GET, 'theme' )) { |
|
| 17 | +if( is_customize_preview() && filter_input( INPUT_GET, 'theme' ) ) { |
|
| 18 | 18 | wp_die( |
| 19 | 19 | __( 'Theme must be activated prior to using the customizer.', 'castor' ) |
| 20 | 20 | ); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | require_once( ABSPATH.'/'.WPINC.'/class-oembed.php' ); |
| 24 | 24 | |
| 25 | -if( !function_exists( 'castor_app' )) { |
|
| 25 | +if( !function_exists( 'castor_app' ) ) { |
|
| 26 | 26 | function castor_app() { |
| 27 | 27 | return \GeminiLabs\Castor\Application::getInstance(); |
| 28 | 28 | } |
@@ -23,7 +23,8 @@ |
||
| 23 | 23 | require_once( ABSPATH.'/'.WPINC.'/class-oembed.php' ); |
| 24 | 24 | |
| 25 | 25 | if( !function_exists( 'castor_app' )) { |
| 26 | - function castor_app() { |
|
| 26 | + function castor_app() |
|
| 27 | + { |
|
| 27 | 28 | return \GeminiLabs\Castor\Application::getInstance(); |
| 28 | 29 | } |
| 29 | 30 | } |