Created
August 30, 2012 20:12
-
-
Save kotnik/3539733 to your computer and use it in GitHub Desktop.
Skrati naslov
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 | |
// Skrati na ovoliko znakova: | |
$max_duzina = 10; | |
// ukoliko je title duzi od: | |
$max_limit = 20; | |
$label_id = $this->get_field_id('title'); | |
$short_title = esc_attr($title); | |
if (strlen($short_title) >= $max_limit) { | |
$short_title = substr($short_title, 0, $max_duzina) . "..."; | |
} | |
?> | |
<label for="<?php echo $label_id; ?>"> | |
<?php _e( 'Title:', TB_GETTEXT_DOMAIN ); ?> | |
<input class="widefat" | |
id="<?php echo $label_id; ?>" | |
name="<?php echo $label_id; ?>" | |
type="text" | |
value="<?php echo $short_title; ?>" | |
/> | |
</label> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment