$value) { if ('tag' === $value) { unset($classes[$key]); } } return $classes; } } // Filter custom logo with correct classes. add_filter('get_custom_logo', 'c9_change_logo_class'); if (!function_exists('c9_change_logo_class')) { /** * Replaces logo CSS class. * * @param string $html Markup. * * @return mixed */ function c9_change_logo_class($html) { $html = str_replace('class="custom-logo"', 'class="img-fluid navbar-brand c9-custom-logo"', $html); $html = str_replace('class="custom-logo-link"', 'class="navbar-brand custom-logo-link c9-custom-logo"', $html); $html = str_replace('alt=""', 'title="' . esc_attr__('Home', 'c9-togo') . '" alt="' . esc_attr__('logo', 'c9-togo') . '"', $html); $html = wp_kses_post($html); return $html; } } if (!function_exists('c9_post_nav')) { /** * Display navigation to next/previous post when applicable. */ function c9_post_nav() { // Don't print empty markup if there's nowhere to navigate. $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); $next = get_adjacent_post(false, '', false); if (!$next && !$previous) { return; } ?> $value) { $new_sizes[$value] = $value; } // This preserves the labels in $sizes, and merges the two arrays $new_sizes = array_merge($new_sizes, $sizes); return $new_sizes; } } add_filter('image_size_names_choose', 'c9_display_image_size_names_muploader', 11, 1); /** * Sanitize checkbox inputs from Customizer */ function c9_sanitize_checkbox($input) { return ($input === true) ? true : false; } /** * Sanitize Select inputs from Customizer */ function c9_sanitize_select($input, $setting) { // Ensure input is a slug. $input = sanitize_text_field($input); // Get list of choices from the control associated with the setting. $choices = $setting->manager->get_control($setting->id)->choices; // If the input is a valid key, return it; otherwise, return the default. return (array_key_exists($input, $choices) ? $input : $setting->default); } /** * Sanitize checkbox inputs from post meta */ function c9_sanitize_post_header_size($input) { // Ensure input is a slug. $input = sanitize_html_class($input); // Get list of choices from the setting $choices = array('large' => 0, 'small' => 1, 'hidden' => 2); // If the input is a valid key, return it; otherwise, return the default. return (is_string($input) && array_key_exists($input, $choices) ? $input : 'small'); } /** * add a full screen search icon to navigation */ add_filter('wp_nav_menu_items', 'c9_add_search_form', 10, 2); if (!function_exists('c9_add_search_form')) { function c9_add_search_form($items, $args) { if ('primary' == $args->theme_location) { $items .= ''; } return $items; } }