Last active
December 16, 2019 15:11
-
-
Save danielstrelec/7981dc1750c74c7ff14d9fd7aee74866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// pevné mezery za spojky | |
function wt_conjunctions( $content ) { | |
$content = str_replace( | |
array( | |
' a ', ' A ', | |
' i ', ' I ', | |
' k ', ' K ', | |
' o ', ' O ', | |
' s ', ' S ', | |
' u ', ' U ', | |
' v ', ' V ', | |
' z ', ' Z ' | |
), | |
array( | |
' a ', ' A ', | |
' i ', ' I ', | |
' k ', ' K ', | |
' o ', ' O ', | |
' s ', ' S ', | |
' u ', ' U ', | |
' v ', ' V ', | |
' z ', ' Z ' | |
), | |
$content ); | |
return $content; | |
} | |
// standarní WordPress pole | |
add_filter( 'the_title', 'wt_conjunctions' ); | |
add_filter( 'the_content', 'wt_conjunctions' ); | |
add_filter( 'the_excerpt', 'wt_conjunctions' ); | |
// ACF pole | |
add_filter( 'acf/format_value/type=text', 'wt_conjunctions', 10, 3 ); | |
add_filter( 'acf/format_value/type=textarea', 'wt_conjunctions', 10, 3 ); | |
add_filter( 'acf/format_value/type=wysiwyg', 'wt_conjunctions', 10, 3 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jednoduchá náhrada za plugin Zalomení pro WordPress. Přidá ke spojkám pevné mezery, aby nebyly na konci řádku.
Seznam lze kdykoliv upravit podle potřeby, ve spodní části lze upravit pro jaké pole se má projevit.