configuration_data();
$fields = $all_fields[$section] ?? [];
if (sizeof($fields) > 0) {
foreach ($fields as $option) {
$name = $option['name'] ?? '';
if (!empty($name) && $name == $section_key) {
$option_value = $option['default'] ?? '';
}
}
}
}
return $option_value;
}
public function configuration_section(): array {
$label = ABPRF_Function::label();
$brand_icon = ABPRF_Function::icon();
$configuration = array(
array('id' => 'abprf_configuration', 'icon' => $brand_icon, 'menu' => $label),
array('id' => 'abprf_on_off', 'icon' => 'fa-solid fa-toggle-on', 'menu' => __('ON/OFF', 'abp-rentalforge')),
array('id' => 'abprf_dates', 'svg' => 'date_1', 'menu' => __('Dates', 'abp-rentalforge')),
);
if (ABPRF_Function::on_off('additional_info')) {
$configuration[] = array('id' => 'abprf_additional', 'icon' => '💰', 'menu' => __('Additional services', 'abp-rentalforge'));
}
if (ABPRF_Function::on_off('client_info')) {
$configuration[] = array('id' => 'abprf_client_form', 'icon' => '📋', 'menu' => __('Client Form', 'abp-rentalforge'));
}
if (ABPRF_Function::on_off('tc') || ABPRF_Function::on_off('faq')) {
$configuration[] = array('id' => 'abprf_resource', 'icon' => '📚', 'menu' => __('Resources', 'abp-rentalforge'));
}
if (ABPRF_Function::on_off('category')) {
$configuration[] = array('id' => 'abprf_category', 'icon' => '🏘️', 'menu' => ABPRF_Function::category_label());
}
if (ABPRF_Function::on_off('location')) {
$configuration[] = array('id' => 'abprf_location', 'icon' => '📍', 'menu' => ABPRF_Function::location_label());
}
if (ABPRF_Function::on_off('brand')) {
$configuration[] = array('id' => 'abprf_brand', 'icon' => '🏷️', 'menu' => ABPRF_Function::brand_label());
}
$configuration[] = array('id' => 'abprf_feature', 'icon' => '🔗', 'menu' => __('Feature', 'abp-rentalforge'));
$configuration = apply_filters('abprf_configuration_after', $configuration);
$contact = apply_filters('abprf_contact_after', array(
array('id' => 'abprf_slider', 'icon' => 'fas fa-photo-video', 'menu' => __('Slider', 'abp-rentalforge')),
array('id' => 'abprf_contact', 'icon' => 'fas fa-id-card-alt', 'menu' => __('Contact Information', 'abp-rentalforge')),
array('id' => 'abprf_css_var', 'icon' => 'fas fa-drafting-compass', 'menu' => __('CSS Property', 'abp-rentalforge')),
));
return array_merge($configuration, $contact);
}
public function configuration_data() {
return apply_filters('abprf_configuration_data_filter', array(
'abprf_configuration' => apply_filters('abprf_configuration_filter', array(
array(
'name' => 'booked_status',
'label' => __('Booked Status', 'abp-rentalforge'),
'desc' => __('Select the specific order statuses that will automatically trigger inventory deduction or reserve a seat.', 'abp-rentalforge'),
'class' => 'full_width',
'type' => 'multi_check',
'default' => 'wc-processing,wc-completed',
'options' => in_array('woocommerce/woocommerce.php', get_option('active_plugins')) ? wc_get_order_statuses() : []
),
array(
'name' => 'label',
'label' => __('Label', 'abp-rentalforge'),
'desc' => __('Customize the display label for the plugin menu item in the admin dashboard side navigation.', 'abp-rentalforge'),
'type' => 'text',
'default' => __('RentalForge', 'abp-rentalforge'),
),
array(
'name' => 'slug',
'label' => __('Slug', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %s: Permalinks settings page link layout */
__('Define the primary URL slug for rentals. Important: After changing this, you must flush your permalinks by visiting %s and clicking Save Changes.', 'abp-rentalforge'),
'' . __('Settings → Permalinks', 'abp-rentalforge') . ''
),
'type' => 'text',
'default' => 'rental-forge'
),
array(
'name' => 'icon',
'label' => __('Dashboard Menu Icon', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %s: Dashicons library link */
__('Choose a custom admin menu icon. Please browse the %s, copy the desired icon class name, and paste it here.', 'abp-rentalforge'),
'' . __('WordPress Dashicons Library', 'abp-rentalforge') . ''
),
'type' => 'text',
'default' => 'dashicons-hammer'
),
array(
'name' => 'brand_icon',
'label' => __('RentalForge Icon', 'abp-rentalforge'),
'desc' => __('Select a global FontAwesome vector icon to act as the primary visual brand identity throughout the plugin panels.', 'abp-rentalforge'),
'type' => 'fontawesome',
'default' => 'fas fa-hammer'
),
array(
'name' => 'category_label',
'label' => __('Category Label', 'abp-rentalforge'),
'desc' => __('Provide a custom singular or plural naming convention for your equipment and rental categories.', 'abp-rentalforge'),
'type' => 'text',
'default' => __('Category', 'abp-rentalforge')
),
array(
'name' => 'cat_slug',
'label' => __('Category Slug', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %s: Permalinks settings page link layout */
__('Define the custom URL structure for category archives. Remember to update your rewrite rules under %s after any modifications.', 'abp-rentalforge'),
'' . __('Settings → Permalinks', 'abp-rentalforge') . ''
),
'type' => 'text',
'default' => 'rf-category'
),
array(
'name' => 'brand_label',
'label' => __('Brand Label', 'abp-rentalforge'),
'desc' => __('Provide a custom singular or plural naming convention for your equipment and rental brands.', 'abp-rentalforge'),
'type' => 'text',
'default' => __('Brand', 'abp-rentalforge')
),
array(
'name' => 'brand_slug',
'label' => __('Brand Slug', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %s: Permalinks settings page link layout */
__('Define the custom URL structure for brand archives. Remember to update your rewrite rules under %s after any modifications.', 'abp-rentalforge'),
'' . __('Settings → Permalinks', 'abp-rentalforge') . ''
),
'type' => 'text',
'default' => 'rf-brand'
),
array(
'name' => 'location_label',
'label' => __('Location Label', 'abp-rentalforge'),
'desc' => __('Provide a custom singular or plural naming convention for your equipment and rental locations.', 'abp-rentalforge'),
'type' => 'text',
'default' => __('Location', 'abp-rentalforge')
),
array(
'name' => 'location_slug',
'label' => __('Location Slug', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %s: Permalinks settings page link layout */
__('Define the custom URL structure for location archives. Remember to update your rewrite rules under %s after any modifications.', 'abp-rentalforge'),
'' . __('Settings → Permalinks', 'abp-rentalforge') . ''
),
'type' => 'text',
'default' => 'location'
),
)),
'abprf_on_off' => apply_filters('abprf_on_off_filter', array(
array(
'name' => 'rent_rule',
'label' => __('Rent Date Time Rule', 'abp-rentalforge'),
'desc' => __('Rent Date Time Rules allow you to control rental booking availability based on specific date and time conditions. Select one or more rules to apply custom restrictions. If no rule is selected, all available rules will remain active by default.', 'abp-rentalforge'),
'class' => 'full_width',
'type' => 'multi_check',
'default' => ABPRF_Layout::rent_rules_string(),
'options' => ABPRF_Layout::rent_rules()
),
array(
'name' => 'auto_delivery',
'label' => __('Auto Delivery', 'abp-rentalforge'),
'desc' => __('When ON, a booking automatically moves to "In Rent" as soon as its rent start time arrives. When OFF, the admin must press the "Mark Delivered" button manually.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'auto_return',
'label' => __('Auto Return', 'abp-rentalforge'),
'desc' => __('When ON, an in-rent booking automatically moves to "Completed" once its rent end time passes. When OFF, the admin must press the "Mark Received" button manually.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'sku',
'label' => __('Post SKU', 'abp-rentalforge'),
'desc' => __('If you do not want to use the Post SKU ID feature, simply turn this switch OFF. Once disabled, the Post SKU field and related SKU options will be completely removed from the site, and no SKU ID will be required or generated for posts.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'sub_title',
'label' => __('Post Sub Title', 'abp-rentalforge'),
'desc' => __('If you do not want to use the Post Sub Title , simply turn this switch OFF. Once disabled, the Post Sub Title field and related options will be completely removed from the site.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'post_icon',
'label' => __('Post Icon', 'abp-rentalforge'),
'desc' => __('If you do not want to use Post Icon simply turn this switch OFF. This will completely disable the Post Icon across the entire website, including all related , settings, and functionality. You can re-enable it at any time by turning the switch back ON.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'post_des',
'label' => __('Post Description', 'abp-rentalforge'),
'desc' => __('If you do not want to use Post Description simply turn this switch OFF. This will completely disable the Post Description across the entire website, including all related , settings, and functionality. You can re-enable it at any time by turning the switch back ON.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'related',
'label' => __('Related Post', 'abp-rentalforge'),
'desc' => __('Turn this switch OFF to completely disable the Related Posts feature. Once disabled, Related Post items will no longer be displayed on any details page throughout the website. Turn it back ON at any time to show related content again.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'brand',
'label' => ABPRF_Function::brand_label(),
'desc' => __('If you do not want to use the Brand Feature, simply turn this switch OFF. Once disabled, the Brand Feature field and related Brand Feature options will be completely removed from the site.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'property_des',
'label' => __('Property Description', 'abp-rentalforge'),
'desc' => __('If you do not want to use Property Description simply turn this switch OFF. This will completely disable the Property Description across the entire website, including all related , settings, and functionality. You can re-enable it at any time by turning the switch back ON.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'deposit',
'label' => __('Deposit', 'abp-rentalforge'),
'desc' => __('If you do not want to use Deposit Feature simply turn this switch OFF. This will completely disable the Deposit feature across the entire website, including all related , settings, and functionality. You can re-enable it at any time by turning the switch back ON.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'feature',
'label' => __('Features', 'abp-rentalforge'),
'desc' => __('If you do not want to use Features, simply turn this switch OFF. This will completely disable the Features across the entire website, including all related , settings, and functionality. You can re-enable it at any time by turning the switch back ON.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'additional_info',
'label' => __('Additional services', 'abp-rentalforge'),
'desc' => __('If you do not want to use Additional services, simply turn this switch OFF. This will completely disable the Additional services feature across the entire website, including all related , settings, and functionality. You can re-enable it at any time by turning the switch back ON.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'tc',
'label' => __('Term & Conditions', 'abp-rentalforge'),
'desc' => __('If you do not want to use the Term & Conditions Feature, simply turn this switch OFF. Once disabled, the Term & Conditions Feature field and related Term & Conditions Feature options will be completely removed from the site.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'faq',
'label' => __('FAQ', 'abp-rentalforge'),
'desc' => __('If you do not want to use the FAQs Feature, simply turn this switch OFF. Once disabled, the FAQ Feature field and related FAQ Feature options will be completely removed from the site.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'category',
'label' => ABPRF_Function::category_label(),
'desc' => __('If you do not want to use Category , simply turn this switch OFF. Once disabled, Category Title field and related Category options will be completely removed from the site.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
array(
'name' => 'location',
'label' => ABPRF_Function::location_label(),
'desc' => __('Turn this option off to disable all location-based functionality across your website. If location management is not required, you can safely disable it. When enabled, the system will automatically use the Default Location settings.', 'abp-rentalforge'),
'type' => 'button_switch',
'default' => 'on',
),
)),
'abprf_contact' => array(
array(
'name' => 'name',
'label' => __('Company Name', 'abp-rentalforge'),
'desc' => __('Enter the official commercial or business name used for invoice branding.', 'abp-rentalforge'),
'type' => 'text',
'default' => '',
'placeholder' => __('e.g., Rental Forge Ltd.', 'abp-rentalforge'),
),
array(
'name' => 'address',
'label' => __('Address', 'abp-rentalforge'),
'desc' => __('Provide the full corporate physical location or street address to appear on booking logs.', 'abp-rentalforge'),
'type' => 'textarea',
'placeholder' => __('e.g., 450 Greene St, New York, NY 10003, USA', 'abp-rentalforge'),
),
array(
'name' => 'phone',
'label' => __('Contact Number', 'abp-rentalforge'),
'desc' => __('Specify the primary telephone or corporate helpline number for client inquiries.', 'abp-rentalforge'),
'type' => 'text',
'default' => '',
'placeholder' => __('e.g., +1 (234) 567-8901', 'abp-rentalforge'),
),
array(
'name' => 'email',
'label' => __('E-Mail', 'abp-rentalforge'),
'desc' => __('Input the standard commercial email address reserved for direct customer support correspondence.', 'abp-rentalforge'),
'type' => 'text',
'default' => '',
'placeholder' => __('support@example.com', 'abp-rentalforge'),
),
),
'abprf_slider' => array(
array(
'name' => 'slider_style',
'label' => __('Slider Theme', 'abp-rentalforge'),
'desc' => __('Select the preferred frontend presentation layout style for display item multimedia asset sheets.', 'abp-rentalforge'),
'collapse' => 'yes',
'type' => 'radio',
'default' => 'slider',
'options' => array(
'slider' => __('Carousel Slider', 'abp-rentalforge'),
'gallery' => __('Gallery / Masonry', 'abp-rentalforge'),
),
),
array(
'name' => 'image_column',
'label' => __('Images Per Row', 'abp-rentalforge'),
'desc' => __('Specify the total number of gallery thumbnails to render in a single horizontal grid line row layout.', 'abp-rentalforge'),
'type' => 'number',
'default' => '3',
'min' => '1',
'max' => '10',
'validation' => 'validation_number',
'collapse_radio' => array('option' => 'abprf_slider', 'key' => 'slider_style', 'value' => 'gallery'),
),
array(
'name' => 'indicator_visible',
'label' => __('Image Indicator?', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %1$s: HTML markup for OFF layout switch, %2$s: HTML markup for ON layout switch, %3$s: Default status indicator layout */
__('Manage pagination dot indicators on the slide viewport canvas. Toggle %1$s to hide or %2$s to display. (Default: %3$s)', 'abp-rentalforge'),
ABPRF_Layout::off(),
ABPRF_Layout::on(),
ABPRF_Layout::on()
),
'type' => 'button_switch',
'default' => 'on',
'collapse_radio' => array('option' => 'abprf_slider', 'key' => 'slider_style', 'value' => 'slider'),
),
array(
'name' => 'indication_position',
'label' => __('Indicator Position', 'abp-rentalforge'),
'desc' => __('Choose the geometric layout alignment position anchor for the slide tracking dot interface elements.', 'abp-rentalforge'),
'type' => 'radio',
'default' => 'bottom',
'options' => array(
'top' => __('Top', 'abp-rentalforge'),
'right' => __('Right', 'abp-rentalforge'),
'bottom' => __('Bottom', 'abp-rentalforge'),
'left' => __('Left', 'abp-rentalforge')
),
'class' => 'full_width',
'collapse_radio' => array('option' => 'abprf_slider', 'key' => 'slider_style', 'value' => 'slider'),
'collapse_data' => array('option' => 'abprf_slider', 'key' => 'indicator_visible'),
),
array(
'name' => 'visible_popup',
'label' => __('Visible Popup?', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %1$s: HTML markup for OFF layout switch, %2$s: HTML markup for ON layout switch, %3$s: Default status Visible Popup layout */
__('Decide whether clicking on layout thumbnails triggers a full-screen image lightbox popup. Toggle %1$s to disable or %2$s to enable. (Default: %3$s)', 'abp-rentalforge'),
ABPRF_Layout::off(),
ABPRF_Layout::on(),
ABPRF_Layout::on(),
),
'type' => 'button_switch',
'default' => 'on'
),
array(
'name' => 'popup_image_indicator',
'label' => __('Popup Image Indicator', 'abp-rentalforge'),
'desc' => sprintf(
/* translators: %1$s: HTML markup for OFF Popup Image Indicator switch, %2$s: HTML markup for ON layout switch, %3$s: Default status Popup Image Indicator layout */
__('Control navigation pagination tracking assets inside the lightbox modal container view. Toggle %1$s to hide or %2$s to reveal. (Default: %3$s)', 'abp-rentalforge'),
ABPRF_Layout::off(),
ABPRF_Layout::on(),
ABPRF_Layout::on(),
),
'type' => 'button_switch',
'default' => 'on',
'collapse_data' => array('option' => 'abprf_slider', 'key' => 'visible_popup'),
),
),
'abprf_css_var' => array(
array(
'name' => 'color_theme',
'label' => __('Base Color', 'abp-rentalforge'),
'desc' => __('Pick the primary corporate core signature theme color for accents, links, and buttons.', 'abp-rentalforge'),
'type' => 'color',
'default' => '#95951c'
),
array(
'name' => 'color_theme_alternate',
'label' => __('Alternate Color', 'abp-rentalforge'),
'desc' => __('Define a secondary tone reserved mainly for high-contrast foreground text typography layers sitting over a Base Color background layout block.', 'abp-rentalforge'),
'type' => 'color',
'default' => '#fff'
),
array(
'name' => 'color_default',
'label' => __('Default Color', 'abp-rentalforge'),
'desc' => __('Establish the primary body text typography canvas hexadecimal hex color code.', 'abp-rentalforge'),
'type' => 'color',
'default' => '#303030'
),
array(
'name' => 'br_default',
'label' => __('Default Border Radius', 'abp-rentalforge'),
'desc' => __('Specify a global UI layout component corner sharpness curve boundary rounding threshold value in raw pixel units.', 'abp-rentalforge'),
'type' => 'number',
'default' => '5',
'validation' => 'validation_number'
),
array(
'name' => 'fs_default',
'label' => __('Default Font Size', 'abp-rentalforge'),
'desc' => __('Set the default baseline layout font scale size applied to normal paragraph blocks across UI views.', 'abp-rentalforge'),
'type' => 'number',
'default' => '12',
'validation' => 'validation_number'
),
array(
'name' => 'fs_label',
'label' => __('Label Font Size', 'abp-rentalforge'),
'desc' => __('Configure the responsive text scale sizing applied strictly to forms, field labels, and identifier descriptions.', 'abp-rentalforge'),
'type' => 'number',
'default' => '14',
'validation' => 'validation_number'
),
array(
'name' => 'fs_h1',
'label' => __('Font Size H1', 'abp-rentalforge'),
'desc' => __('Enter the typographical scale size target for the primary page-level H1 header assets.', 'abp-rentalforge'),
'type' => 'number',
'default' => '35',
'validation' => 'validation_number'
),
array(
'name' => 'fs_h2',
'label' => __('Font Size H2', 'abp-rentalforge'),
'desc' => __('Enter the typographical scale size target for subsection level H2 header assets.', 'abp-rentalforge'),
'type' => 'number',
'default' => '30',
'validation' => 'validation_number'
),
array(
'name' => 'fs_h3',
'label' => __('Font Size H3', 'abp-rentalforge'),
'desc' => __('Enter the typographical scale size target for inner panel modular level H3 header assets.', 'abp-rentalforge'),
'type' => 'number',
'default' => '25',
'validation' => 'validation_number'
),
array(
'name' => 'fs_h4',
'label' => __('Font Size H4', 'abp-rentalforge'),
'desc' => __('Enter the typographical scale size target for contextual metadata tracking level H4 header assets.', 'abp-rentalforge'),
'type' => 'number',
'default' => '20',
'validation' => 'validation_number'
),
array(
'name' => 'fs_h5',
'label' => __('Font Size H5', 'abp-rentalforge'),
'desc' => __('Enter the typographical scale size target for inner card grid elements level H5 header assets.', 'abp-rentalforge'),
'type' => 'number',
'default' => '17',
'validation' => 'validation_number'
),
array(
'name' => 'fs_h6',
'label' => __('Font Size H6', 'abp-rentalforge'),
'desc' => __('Enter the lowest micro-metadata element typographical scale sizing target for nested H6 headers.', 'abp-rentalforge'),
'type' => 'number',
'default' => '15',
'validation' => 'validation_number'
),
array(
'name' => 'fs_button',
'label' => __('Button Font Size', 'abp-rentalforge'),
'desc' => __('Specify the responsive scaling text size applied directly to interactive call-to-action control items.', 'abp-rentalforge'),
'type' => 'number',
'default' => '13',
'validation' => 'validation_number'
),
array(
'name' => 'color_button',
'label' => __('Button Text Color', 'abp-rentalforge'),
'desc' => __('Pick a default foreground color shade for interactive typography labels inside button boundaries.', 'abp-rentalforge'),
'type' => 'color',
'default' => '#FFF'
),
array(
'name' => 'bg_button',
'label' => __('Button Background Color', 'abp-rentalforge'),
'desc' => __('Set the default fill backdrop hexadecimal color value for transactional action trigger containers.', 'abp-rentalforge'),
'type' => 'color',
'default' => '#222'
),
array(
'name' => 'color_warning',
'label' => __('Warning Color', 'abp-rentalforge'),
'desc' => __('Define the system default color block layout rule reserved for error outputs, alerts, or pending notices.', 'abp-rentalforge'),
'type' => 'color',
'default' => '#E67C30'
),
array(
'name' => 'bg_section',
'label' => __('Section Background Color', 'abp-rentalforge'),
'desc' => __('Determine the fallback structural base background color applied to global layout wrapper segment panels.', 'abp-rentalforge'),
'type' => 'color',
'default' => '#FAFCFE'
),
)
));
}
public static function description($option): void {
$desc = $option['desc'] ?? '';
if ($desc) { ?>
data-collapse="#" >
text($option);
}
public function number($option): void {
$section_target = $option['collapse_target'] ?? [];
?>