*/ function zeitfresser_get_social_defaults() { return array( 'mastodon' => 'https://social.ztfr.eu/@dome', 'github' => 'https://github.com/Domoel', 'matrix' => 'https://look.ztfr.eu/#/@dome:ztfr.eu', ); } } if ( ! function_exists( 'zeitfresser_get_social_link_default' ) ) { /** * Return default social URL for a given service. * * @param string $social_key Social service key. * @return string */ function zeitfresser_get_social_link_default( $social_key ) { $defaults = zeitfresser_get_social_defaults(); return isset( $defaults[ $social_key ] ) ? $defaults[ $social_key ] : ''; } } if ( ! function_exists( 'zeitfresser_get_mod' ) ) { /** * Return a cached theme modification value. * * @param string $key Theme mod key. * @param mixed $default Optional default value. * @return mixed */ function zeitfresser_get_mod( $key, $default = null ) { static $cache = array(); if ( array_key_exists( $key, $cache ) ) { return $cache[ $key ]; } $cache[ $key ] = get_theme_mod( $key, $default ); return $cache[ $key ]; } } if ( ! function_exists( 'zeitfresser_get_social_links_settings' ) ) { /** * Return configured social links with defaults applied. * * @return array */ function zeitfresser_get_social_links_settings() { $settings = array(); foreach ( zeitfresser_get_social_links() as $social_key => $social_label ) { $settings[ $social_key ] = zeitfresser_get_mod( 'social_links_' . $social_key, zeitfresser_get_social_link_default( $social_key ) ); } return $settings; } } if ( ! function_exists( 'zeitfresser_social_icon_svg' ) ) { /** * Return inline SVG markup for social icons. * * @param string $key Social service key. * @return string */ function zeitfresser_social_icon_svg( $key ) { $icons = array( 'facebook' => '', 'instagram' => '', 'youtube' => '', 'linkedin' => '', 'twitter' => '', 'pinterest' => '', 'tiktok' => '', 'mastodon' => '', 'github' => '', 'matrix' => '', ); return isset( $icons[ $key ] ) ? $icons[ $key ] : ''; } } /** * Backward-compatible Freemius helper alias. * * @return object */ function db_fs() { return zeitfresser_fs(); } /** * Backward-compatible social default alias. * * @param string $social_key Social service key. * @return string */ function graphthemes_get_social_link_default( $social_key ) { return zeitfresser_get_social_link_default( $social_key ); }