Devices & Styles'; echo '
'; $control->add_control( [ 'type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'device_exclude_large_desktop', ] ); $control->HTML .= '

This setting will apply to all devices which are greater than the Device Width set below

'; $control->add_control( [ 'type' => 'number', 'label' => 'Device Width (px)', 'optionName' => 'device_large_desktop_width', 'helpText' => 'The width of the browser screen.', 'value' => ( ( ! isset( $control->values['device_large_desktop_width'] ) || ( $control->values['device_large_desktop_width'] == '' ) ) ? '1200' : $control->values['device_large_desktop_width'] ), ] ); $control->add_control( [ 'type' => 'number', 'label' => 'Ad Width (px)', 'optionName' => 'device_large_desktop_adwidth', 'helpText' => 'The width of the ad block at the given browser screen width. (Leave empty for auto width)', ] ); $control->add_control( [ 'type' => 'textarea', 'label' => 'Styles', 'optionName' => 'device_large_desktop_styles', 'helpText' => 'You can add CSS to customize your ad block for this device type', ] ); $control->create_section( 'Device - Large Desktop' ); $control->set_HTML( '
' . $control->HTML . '
' ); wp_insert_echo_html( $control->HTML ); $control->clear_controls(); $control->add_control( [ 'type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'device_exclude_medium_desktop', ] ); $control->HTML .= '

This setting will apply to all devices which are greater than the Device Width set below but smaller than Device Width set for Large Desktop

'; $control->add_control( [ 'type' => 'number', 'label' => 'Device Width (px)', 'optionName' => 'device_medium_desktop_width', 'helpText' => 'The width of the browser screen.', 'value' => ( ( ! isset( $control->values['device_medium_desktop_width'] ) || ( $control->values['device_medium_desktop_width'] == '' ) ) ? '992' : $control->values['device_medium_desktop_width'] ), ] ); $control->add_control( [ 'type' => 'number', 'label' => 'Ad Width (px)', 'optionName' => 'device_medium_desktop_adwidth', 'helpText' => 'The width of the ad block at the given browser screen width. (Leave empty for auto width)', ] ); $control->add_control( [ 'type' => 'textarea', 'label' => 'Styles', 'optionName' => 'device_medium_desktop_styles', 'helpText' => 'You can add CSS to customize your ad block for this device type', ] ); $control->create_section( 'Devices - Medium Desktop' ); $control->set_HTML( '
' . $control->HTML . '
' ); wp_insert_echo_html( $control->HTML ); $control->clear_controls(); $control->add_control( [ 'type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'device_exclude_tablet', ] ); $control->HTML .= '

This setting will apply to all devices which are greater than the Device Width set below but smaller than Device Width set for Medium Desktop

'; $control->add_control( [ 'type' => 'number', 'label' => 'Device Width (px)', 'optionName' => 'device_tablet_width', 'helpText' => 'The width of the browser screen.', 'value' => ( ( ! isset( $control->values['device_tablet_width'] ) || ( $control->values['device_tablet_width'] == '' ) ) ? '768' : $control->values['device_tablet_width'] ), ] ); $control->add_control( [ 'type' => 'number', 'label' => 'Ad Width (px)', 'optionName' => 'device_tablet_adwidth', 'helpText' => 'The width of the ad block at the given browser screen width. (Leave empty for auto width)', ] ); $control->add_control( [ 'type' => 'textarea', 'label' => 'Styles', 'optionName' => 'device_tablet_styles', 'helpText' => 'You can add CSS to customize your ad block for this device type', ] ); $control->create_section( 'Devices - Tablet' ); $control->set_HTML( '
' . $control->HTML . '
' ); wp_insert_echo_html( $control->HTML ); $control->clear_controls(); $control->add_control( [ 'type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'device_exclude_mobile', ] ); $control->HTML .= '

This setting will apply to all devices which are smaller than the Device Width set for Tablets

'; $control->add_control( [ 'type' => 'number', 'label' => 'Device Width (px)', 'optionName' => 'device_mobile_width', 'helpText' => 'The width of the browser screen.', 'value' => ( ( ! isset( $control->values['device_mobile_width'] ) || ( $control->values['device_mobile_width'] == '' ) ) ? '480' : $control->values['device_mobile_width'] ), ] ); $control->add_control( [ 'type' => 'number', 'label' => 'Ad Width (px)', 'optionName' => 'device_mobile_adwidth', 'helpText' => 'The width of the ad block at the given browser screen width. (Leave empty for auto width)', ] ); $control->add_control( [ 'type' => 'textarea', 'label' => 'Styles', 'optionName' => 'device_mobile_styles', 'helpText' => 'You can add CSS to customize your ad block for this device type', ] ); $control->create_section( 'Devices - Mobile (Normal)' ); $control->set_HTML( '
' . $control->HTML . '
' ); wp_insert_echo_html( $control->HTML ); $control->clear_controls(); $control->add_control( [ 'type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'device_exclude_small_mobile', ] ); $control->HTML .= '

This setting will apply to all devices which are smaller than the Device Width set for Mobile (Normal)

'; $control->add_control( [ 'type' => 'number', 'label' => 'Ad Width (px)', 'optionName' => 'device_small_mobile_adwidth', 'helpText' => 'The width of the ad block at the given browser screen width. (Leave empty for auto width)', ] ); $control->add_control( [ 'type' => 'textarea', 'label' => 'Styles', 'optionName' => 'device_small_mobile_styles', 'helpText' => 'You can add CSS to customize your ad block for this device type', ] ); $control->create_section( 'Devices - Mobile (Small)' ); $control->set_HTML( '
' . $control->HTML . '
' ); wp_insert_echo_html( $control->HTML ); $control->clear_controls(); $control->add_control( [ 'type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'styles', 'helpText' => 'You can add CSS to customize your ad block', ] ); $control->create_section( 'Styles (Common)' ); wp_insert_echo_html( $control->HTML ); $control->clear_controls(); echo '
'; return $control; }