|
|
Calculate % from two custom Toolset fields
Started by: Jean Rapenne
in: Toolset Professional Support
Quick solution available
Problem:
How to retrieve two custom field items and show the percentage of one with another?
Solution:
Create a custom shortcode and use that shortcode inside your content.
add_shortcode( 'calculate', 'calculate_func' );
function calculate_func( $atts ) {
$goal = do_shortcode("[types field='field1'][/types]");
$raised = do_shortcode("[types field='field2'][/types]");
$result = (100 * $raised) / $goal;
return round($result, 2);
}
Replace field1 and field2 with the slug of your fields.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/adding-custom-code/how-to-create-a-custom-shortcode/
|
|
2 |
10 |
3 years ago
Jean Rapenne
|
|
|
CRED Hooks
Started by: julieP
in: Toolset Professional Support
Quick solution available
Problem:
How can I retrieve taxonomy from customer-entered form content?
Solution:
var_dump the $_POST array to see the proper key values that you have in before_save_data hook.
<pre>
<?php var_dump($_POST); ?>
</pre>
<p>
|
|
2 |
6 |
3 years ago
julieP
|
|
|
Add content to the actual page with frontend post form
Started by: annaA-2
in: Toolset Professional Support
Quick solution available
|
|
2 |
6 |
3 years ago
annaA-2
|
|
|
Slug Problem For Hierarchical Custom Post Types
Started by: fahimS-2
in: Toolset Professional Support
Quick solution available
Problem:
When a custom post type is set as hierarchal it is not possible to upload media with the same slug.
Solution:
That is true for all posts and pages in WordPress.
Please avoid uploading images with the same name as the posts slug.
|
|
2 |
4 |
3 years ago
fahimS-2
|