default_settings = include BLOCKFOLD_THEME_CONFIG . 'default-values.php'; // customizer $this->theme_info = wp_get_theme(); $this->theme_assets = include BLOCKFOLD_THEME_CONFIG . 'assets.php'; $this->sidebars = include BLOCKFOLD_THEME_CONFIG . 'sidebars.php'; $this->project_variables = include BLOCKFOLD_THEME_CONFIG . 'project-variables.php'; $this->patterns_categories = include BLOCKFOLD_THEME_CONFIG . 'patterns-categories.php'; $this->block_styles = include BLOCKFOLD_THEME_CONFIG . 'block-modyficators.php'; $this->kadence_settings = include BLOCKFOLD_THEME_CONFIG . 'kadence-settings.php'; $this->kadence_palette = include BLOCKFOLD_THEME_CONFIG . 'kadence-palette.php'; } public function get_theme_mod( $key ) { if ( isset( self::$theme_mods[ $key ] ) ) { return self::$theme_mods[ $key ]; } return FALSE; } public function default_settings( $key = '' ) { if ( strlen( $key ) > 0 && isset( $this->default_settings[ $key ] ) ) { return $this->default_settings[ $key ]; } return $this->default_settings; } /** * Get default logo attributes * @return array */ public function get_logo_attributes() { return isset( $this->default_settings['logo_settings'] ) ? $this->default_settings['logo_settings'] : array(); } /** * Returns default image sizes * @return array */ public function get_image_sizes() { return isset( $this->default_settings['images_sizes'] ) ? $this->default_settings['images_sizes'] : array(); } /** * Returns Images Size to Display In the Editor * @return array|mixed */ public function get_image_sizes_to_display() { return isset( $this->default_settings['images_sizes_to_display'] ) ? $this->default_settings['images_sizes_to_display'] : array(); } /** * Returns menus locations * @return array */ public function get_menus_locations() { return isset( $this->default_settings['menus'] ) ? $this->default_settings['menus'] : array(); } /** * Returns social icons mapped on fontawesome class * * @param string $icon_name * * @return array */ public function get_social_icons( $icon_name = '' ) { $social_icons = $this->default_settings['social_icons']; if ( ! empty( $icon_name ) ) { return isset( $social_icons[ $icon_name ] ) ? $social_icons[ $icon_name ] : array(); } else { return $social_icons; } } /** * Return styles assets * @return bool */ public function get_css_assets() { if ( isset( $this->theme_assets['styles'] ) ) { return $this->theme_assets['styles']; } else { return FALSE; } } /** * Return styles assets * @return bool */ public function get_js_assets() { if ( isset( $this->theme_assets['scripts'] ) ) { return $this->theme_assets['scripts']; } else { return FALSE; } } /** * Returns theme version * @return mixed */ public function version() { return $this->theme_info->Version; } public function get_sidebars() { return $this->sidebars; } public function get_project_variables( $key = FALSE ) { if ( $key !== FALSE ) { if ( isset( $this->project_variables[ $key ] ) ) { return $this->project_variables[ $key ]; } } else { return $this->project_variables; } } public function get_project_fonts( $key = FALSE ) { $project_fonts = array(); foreach ( $this->project_variables as $key => $variable ) { if ( strpos( $key, '--font' ) !== 0 && strpos( $key, '--font' ) !== FALSE ) { preg_match( '"([^\\"]+)"', $variable, $result ); $project_fonts[] = $result[0]; } } var_dump( $project_fonts ); } /** * Returns array of categories * @return mixed */ public function get_block_patterns_categories() { return $this->patterns_categories; } /** * return array of blocks patterns * * @param $categories * * @return array */ public function get_block_patterns( $categories ) { $patterns = array(); foreach ( $categories as $name => $data ) { if ( file_exists( BLOCKFOLD_THEME_CONFIG . 'patterns/' . $name . '.php' ) ) { $patterns[] = include BLOCKFOLD_THEME_CONFIG . 'patterns/' . $name . '.php'; } } return $patterns; } /** * Return spacing options like padding or margin from serialized option * @param $index * @param string $device * * @return false|string */ public function get_kadence_serialized_spacing_option($index, $device='desktop') { $kadence_option = get_theme_mod($index); $value = false; if (isset($kadence_option['size'][$device])) { $value = implode("px ", $kadence_option['size'][$device]) .'px'; } return $value; } /** * Return Block styles */ public function get_block_styles() { return $this->block_styles; } /** * Returns Kadence settings array * @return mixed */ public function get_kadence_settings() { return $this->kadence_settings; } /** * Returns Kadence palette json * @return mixed */ public function get_kadence_palette() { return $this->kadence_palette; } } }