Esempio n. 1
0
 /**
  * Convert a new theme mod value from an old one.
  *
  * @since  1.3.0.
  *
  * @param  mixed    $value    The current value.
  * @return mixed              The modified value.
  */
 function ttfmake_customizer_convert_theme_mods_filter($value)
 {
     $new_mod_name = str_replace('theme_mod_', '', current_filter());
     $conversions = ttfmake_customizer_get_key_conversions();
     $mods = get_theme_mods();
     /**
      * When previewing a page, the logic for this filter needs to change. Because the isset check in the conditional
      * below will always fail if the new mod key is not set (i.e., the value isn't in the db yet), the default value,
      * instead of the preview value will always show. Instead, when previewing, the value needs to be gotten from
      * the `get_theme_mod()` call without this filter applied. This will give the new preview value. If it is not found,
      * then the normal routine will be used.
      */
     if (ttfmake_is_preview()) {
         remove_filter(current_filter(), 'ttfmake_customizer_convert_theme_mods_filter', 11);
         $previewed_value = get_theme_mod($new_mod_name, 'default-value');
         add_filter(current_filter(), 'ttfmake_customizer_convert_theme_mods_filter', 11);
         if ('default-value' !== $previewed_value) {
             return $previewed_value;
         }
     }
     /**
      * We only want to convert the value if the new mod is not in the mods array. This means that the value is not set
      * and an attempt to get the value from an old key is warranted.
      */
     if (!isset($mods[$new_mod_name])) {
         // Verify that this key should be converted
         if (isset($conversions[$new_mod_name])) {
             $old_mod_name = $conversions[$new_mod_name];
             $old_mod_value = get_theme_mod($old_mod_name, 'default-value');
             // The old value is indeed set
             if ('default-value' !== $old_mod_value) {
                 $value = $old_mod_value;
                 // Now that we have the right old value, convert it if needed
                 $value = ttfmake_customizer_convert_theme_mods_values($old_mod_name, $new_mod_name, $value);
             }
         }
     }
     return $value;
 }
Esempio n. 2
0
    esc_html_e('Skip to content', 'make');
    ?>
</a>
			<?php 
    // Search form
    if (1 === $show_search) {
        get_search_form();
    }
    ?>
			<?php 
    // Social links
    ttfmake_maybe_show_social_links('header');
    ?>
			<?php 
    // Header text; shown only if there is no header menu
    if ((!empty($header_text) || ttfmake_is_preview()) && empty($header_bar_menu)) {
        ?>
				<span class="header-text">
				<?php 
        echo ttfmake_sanitize_text($header_text);
        ?>
				</span>
			<?php 
    }
    ?>
			<?php 
    echo $header_bar_menu;
    ?>
		</div>
	</div>
	<?php 
Esempio n. 3
0
/**
 * @package Make
 */
$footer_text = get_theme_mod('footer-text', false);
/**
 * Allow toggling of the footer credit.
 *
 * @since 1.2.3.
 *
 * @param bool    $show    Whether or not to show the footer credit.
 */
$footer_credit = apply_filters('make_show_footer_credit', true);
?>

<?php 
if ($footer_text || ttfmake_is_preview()) {
    ?>
<div class="footer-text">
	<?php 
    echo ttfmake_sanitize_text($footer_text);
    ?>
</div>
<?php 
}
?>

<?php 
if (true === $footer_credit) {
    ?>
<div class="site-info">
	<span class="theme-name">Make: A WordPress template</span>