| 1 |
<?php |
| 2 |
function wp_insert_form_accordion_tabs_notes( $control, $identifier, $location ) { |
| 3 |
echo '<h3>Notes</h3>'; |
| 4 |
echo '<div>'; |
| 5 |
|
| 6 |
$title = $identifier; |
| 7 |
if ( ! isset( $control->values['title'] ) || ( $control->values['title'] == '' ) ) { |
| 8 |
switch ( $identifier ) { |
| 9 |
case 'above': |
| 10 |
$title = 'Above Post Content'; |
| 11 |
break; |
| 12 |
case 'middle': |
| 13 |
$title = 'Middle of Post Content'; |
| 14 |
break; |
| 15 |
case 'below': |
| 16 |
$title = 'Below Post Content'; |
| 17 |
break; |
| 18 |
case 'left': |
| 19 |
$title = 'To the Left of Post Content'; |
| 20 |
break; |
| 21 |
case 'right': |
| 22 |
$title = 'To the Right of Post Content'; |
| 23 |
break; |
| 24 |
default: |
| 25 |
$title = $identifier; |
| 26 |
break; |
| 27 |
} |
| 28 |
} else { |
| 29 |
$title = $control->values['title']; |
| 30 |
} |
| 31 |
$control->add_control( |
| 32 |
[ |
| 33 |
'type' => 'text', |
| 34 |
'optionName' => 'title', |
| 35 |
'helpText' => 'The title is used to identify your Ad Widget easily in future. A Random Title will be assigned to your Ad widget by default.', |
| 36 |
'value' => $title, |
| 37 |
] |
| 38 |
); |
| 39 |
$control->create_section( 'Title' ); |
| 40 |
wp_insert_echo_html( $control->HTML ); |
| 41 |
$control->clear_controls(); |
| 42 |
|
| 43 |
$control->add_control( |
| 44 |
[ |
| 45 |
'type' => 'textarea', |
| 46 |
'optionName' => 'notes', |
| 47 |
'style' => 'height: 220px;', |
| 48 |
] |
| 49 |
); |
| 50 |
$control->create_section( 'Notes' ); |
| 51 |
wp_insert_echo_html( $control->HTML ); |
| 52 |
$control->clear_controls(); |
| 53 |
echo '</div>'; |
| 54 |
return $control; |
| 55 |
} |
| 56 |
|