This file contains hidden or 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
| add_filter ('wpforms_frontend_confirmation_message', 'restrict_form_formula', 10, 2); | |
| function restrict_form_formula($confirmation_message, $form_data) { | |
| if ($form_data['id'] == 642) { /* This number is form id - so that we only process the results for this form */ | |
| $monthly_recurring = $_POST['wpforms']['fields'][1]; /* The id for the field you want to use in calculation */ | |
| $ad_spent_month = $_POST['wpforms']['fields'][2]; /* The id for the field you want to use in calculation */ | |
| $total_budget = $_POST['wpforms']['fields'][3]; /* The id for the field you want to use in calculation */ | |
| $calculation = ($monthly_recurring * $ad_spent_month) / $total_budget; | |
| return $calculation; | |
| } | |
| else { |
This file contains hidden or 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
| add_filter('excerpt_length','custom_excerpt_length', 999); | |
| function custom_excerpt_length( $length ) | |
| { | |
| if (get_post_type() == "my-custompost-type1") | |
| return 100; | |
| } |
This file contains hidden or 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
| $id = $_GET['product_id']; //Get the product that we need to show from the URL query string | |
| $WooProduct = new WC_Product_Factory(); //Create a new instance of the Woo product object | |
| $product = $WooProduct->get_product($id); // Get the product details for the product in which we are interested | |
| echo '<h1 class="popup-heading"><a href="'.get_permalink($id).'">'.get_the_title($id).'</a></h1><br />'; //Get the name of the product and link to the actual product | |
| echo $product->post->post_excerpt; // Get the product description (or any other field for that product that you may want - even the images for that product |
This file contains hidden or 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
| [restrict allow_user="2,3,11,5" allow_role="administrator, subscriber"]stuff that is hidden here[/restrict] |
This file contains hidden or 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
| [simple-faq style="accordion" category="faq-category-1"] |
This file contains hidden or 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
| add_action('user_register', 'my_new_member'); | |
| function my_new_member($user_id) { | |
| global $wpdb; | |
| //Example of how to get the fields submitted via the form | |
| if (isset($_POST['first_name'])) { | |
| $firstname = $_POST['first_name']; | |
| } | |
| else { | |
| $firstname = ''; |