nateW
Fils de soutien créés au cours des 30 derniers jours : 0
Sujets de forum favoris
This user has no favorite topics.
Sujets de forum créés
| Status | Topic | Supporter | Voix | Publications | Nouveauté |
|---|---|---|---|---|---|
|
Removing Comma and Text Following
Commencé par : nateW in: Toolset Professional Support |
|
2 | 5 | Il y a 3 years, 11 months | |
|
Number Field Comma – Error when using custom shortcode
Commencé par : nateW in: Toolset Professional Support |
|
2 | 3 | Il y a 3 years, 11 months | |
|
Custom shortcode to remove text after a comma
Commencé par : nateW in: Toolset Professional Support |
|
2 | 3 | Il y a 4 years, 3 months | |
|
Inserting a Dynamic URL into an iframe code
Commencé par : nateW in: Toolset Professional Support |
|
2 | 4 | Il y a 4 years, 4 months | |
|
Blank number field is outputting a 0
Commencé par : nateW
in: Toolset Professional Support
Problem: The code to add commas to the numbers to separate the thousands shows 0 when the result of the custom field is empty. Solution: Change the code to this:
add_shortcode( 'ts_format_number', 'ts_format_number_func');
function ts_format_number_func( $atts, $content ) {
$int = (int) do_shortcode($content);
if ($int == null) {
return "";
} else {
return number_format($int, 0);
}
}
|
|
2 | 3 | Il y a 4 years, 4 months |