| 1 |
<?php /** |
| 2 |
* @version 1.0 |
| 3 |
* @description Action for Template Setup pages |
| 4 |
* @category Setup Action |
| 5 |
* @author wpdevelop |
| 6 |
* |
| 7 |
* @web-site http://oplugins.com/ |
| 8 |
* @email info@oplugins.com |
| 9 |
* |
| 10 |
* @modified 2024-10-20 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 14 |
|
| 15 |
|
| 16 |
// ------------------------------------------------------------------------------------------------------------- |
| 17 |
// == Action - Optional Settings == |
| 18 |
// ------------------------------------------------------------------------------------------------------------- |
| 19 |
/** |
| 20 |
* Template - Optional Settings |
| 21 |
* |
| 22 |
* Help Tips: |
| 23 |
* |
| 24 |
* <script type="text/html" id="tmpl-template_name_a"> |
| 25 |
* Escaped: {{data.test_key}} |
| 26 |
* HTML: {{{data.test_key}}} |
| 27 |
* JS: <# if (true) { alert( 1 ); } #> |
| 28 |
* </script> |
| 29 |
* |
| 30 |
* var template__var = wp.template( 'template_name_a' ); |
| 31 |
* |
| 32 |
* jQuery( '.content' ).html( template__var( { 'test_key' => '<strong>Data</strong>' } ) ); |
| 33 |
* |
| 34 |
* @return void |
| 35 |
*/ |
| 36 |
|
| 37 |
|
| 38 |
/** |
| 39 |
* Validate |
| 40 |
* |
| 41 |
* @param $post_data |
| 42 |
* |
| 43 |
* @return array |
| 44 |
*/ |
| 45 |
function wpbc_template__get_started__action_validate_data( $post_data ){ |
| 46 |
|
| 47 |
$escaped_data = array( |
| 48 |
//'booking_form_theme' => get_bk_option( 'booking_form_theme' ) // '' |
| 49 |
); |
| 50 |
// ----------------------------------------------------------------------------------------------------------------- |
| 51 |
// $key = 'booking_form_theme'; |
| 52 |
// if ( ( isset( $post_data[ $key ] ) ) ) { |
| 53 |
// $escaped_data[ $key ] = wpbc_clean_text_value( $post_data[ $key ] ); |
| 54 |
// } |
| 55 |
|
| 56 |
return $escaped_data; |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
/** |
| 62 |
* Update |
| 63 |
* |
| 64 |
* @param $cleaned_data array |
| 65 |
* |
| 66 |
* @return void |
| 67 |
*/ |
| 68 |
function wpbc_setup__update__get_started( $cleaned_data ){ |
| 69 |
|
| 70 |
// if ( isset( $cleaned_data['booking_form_theme'] ) ) { |
| 71 |
// update_bk_option( 'booking_form_theme', $cleaned_data['booking_form_theme'] ); |
| 72 |
// } |
| 73 |
|
| 74 |
} |