__( 'Integrations', 'ti-woocommerce-wishlist' ),
'page_title' => __( 'Wishlist Integrations with 3rd party plugins and themes', 'ti-woocommerce-wishlist' ),
'method' => [ $this, '_print_' ],
'slug' => 'integrations-settings',
'capability' => 'tinvwl_integrations_settings',
];
}
/**
* Create sections for this settings
*
* @return array
*/
public function constructor_data(): array {
global $tinvwl_integrations;
$fields = [];
if ( is_array( $tinvwl_integrations ) ) {
foreach ( $tinvwl_integrations as $slug => $settings ) {
$disabled = ( $settings['available'] ) ? [] : [ 'disabled' => 'disabled' ];
$fields[] = [
'type' => 'checkboxonoff',
'name' => $slug,
'text' => $settings['name'],
'std' => true,
'extra' => $disabled,
];
}
}
$settings = [
[
'id' => 'integrations',
'title' => __( 'Available Integrations', 'ti-woocommerce-wishlist' ),
'show_names' => true,
'fields' => $fields,
'desc' => __( 'You can disable built-in integrations with 3rd party plugins and themes.', 'ti-woocommerce-wishlist' ),
],
[
'id' => 'save_buttons',
'class' => 'only-button',
'noform' => true,
'fields' => [
[
'type' => 'button_submit',
'name' => 'setting_save',
'std' => '' . __( 'Save Settings', 'ti-woocommerce-wishlist' ),
'extra' => [ 'class' => 'tinvwl-btn split status-btn-ok' ],
],
[
'type' => 'button_submit_quick',
'name' => 'setting_save_quick',
'std' => '' . __( 'Save', 'ti-woocommerce-wishlist' ),
],
],
],
];
return $settings;
}
}