Scenario: You have to get the field values from the record/form in a custom function in the client script. Getting the value directly from the scriptContext is not possible in a custom function. In these cases, we use currrentRecord module. Solution: function customFunction() { let currentRec= currentRecord.get(); let fieldValue= currentRec.getValue({ fieldId: ‘custpage_field’ }); } Here… Continue reading How to get the field values in custom function in client script
Tag: custom function
How to create a Custom class to a WP page (Creating from Dashboard)
You can use the body_class function in your theme’s functions.php file to add custom classes to the body tag of your pages. function custom_body_classes($classes) { // Add your custom class $classes[] = ‘my-custom-class’; return $classes; } add_filter(‘body_class’, ‘custom_body_classes’); After adding this code, every page will have the class ‘my-custom-class’… Continue reading How to create a Custom class to a WP page (Creating from Dashboard)