currencyList = apply_filters( 'adqs_currency_settings', [ [ 'label' => esc_html__( 'Argentine Peso $', 'adirectory' ), 'value' => 'ARS__$__before', ], [ 'label' => esc_html__( 'Australian Dollar $', 'adirectory' ), 'value' => 'AUD__$__before', ], [ 'label' => esc_html__( 'Angolan Kwanza Kz', 'adirectory' ), 'value' => 'AOA__Kz__before', ], [ 'label' => esc_html__( 'Bahraini Dinar BD', 'adirectory' ), 'value' => 'BHD__BD__before', ], [ 'label' => esc_html__( 'Bangladeshi Taka ৳', 'adirectory' ), 'value' => 'BDT__৳__after', ], [ 'label' => esc_html__( 'Botswana Pula P', 'adirectory' ), 'value' => 'BWP__P__before', ], [ 'label' => esc_html__( 'British Pound £', 'adirectory' ), 'value' => 'GBP__£__before', ], [ 'label' => esc_html__( 'Canadian Dollar $', 'adirectory' ), 'value' => 'CAD__$__before', ], [ 'label' => esc_html__( 'Chilean Peso $', 'adirectory' ), 'value' => 'CLP__$__before', ], [ 'label' => esc_html__( 'Chinese Yuan ¥', 'adirectory' ), 'value' => 'CNY__¥__before', ], [ 'label' => esc_html__( 'Colombian Peso $', 'adirectory' ), 'value' => 'COP__$__before', ], [ 'label' => esc_html__( 'Croatian Kuna kn', 'adirectory' ), 'value' => 'HRK__kn__after', ], [ 'label' => esc_html__( 'Czech Koruna Kč', 'adirectory' ), 'value' => 'CZK__Kč__after', ], [ 'label' => esc_html__( 'Danish Krone kr', 'adirectory' ), 'value' => 'DKK__kr__after', ], [ 'label' => esc_html__( 'Euro €', 'adirectory' ), 'value' => 'EUR__€__before', ], [ 'label' => esc_html__( 'Ghanaian Cedi ₵', 'adirectory' ), 'value' => 'GHS__₵__before', ], [ 'label' => esc_html__( 'Hong Kong Dollar HK$', 'adirectory' ), 'value' => 'HKD__$__before', ], [ 'label' => esc_html__( 'Hungarian Forint Ft', 'adirectory' ), 'value' => 'HUF__Ft__after', ], [ 'label' => esc_html__( 'Indian Rupee ₹', 'adirectory' ), 'value' => 'INR__₹__before', ], [ 'label' => esc_html__( 'Indonesian Rupiah Rp', 'adirectory' ), 'value' => 'IDR__Rp__before', ], [ 'label' => esc_html__( 'Israeli New Shekel ₪', 'adirectory' ), 'value' => 'ILS__₪__before', ], [ 'label' => esc_html__( 'Japanese Yen ¥', 'adirectory' ), 'value' => 'JPY__¥__before', ], [ 'label' => esc_html__( 'Malaysian Ringgit RM', 'adirectory' ), 'value' => 'MYR__RM__before', ], [ 'label' => esc_html__( 'Mexican Peso $', 'adirectory' ), 'value' => 'MXN__$__before', ], [ 'label' => esc_html__( 'New Zealand Dollar NZ$', 'adirectory' ), 'value' => 'NZD__$__before', ], [ 'label' => esc_html__( 'Nigerian Naira ₦', 'adirectory' ), 'value' => 'NGN__₦__before', ], [ 'label' => esc_html__( 'Norwegian Krone kr', 'adirectory' ), 'value' => 'NOK__kr__after', ], [ 'label' => esc_html__( 'Pakistani Rupee ₨', 'adirectory' ), 'value' => 'PKR__₨__before', ], [ 'label' => esc_html__( 'Polish Zloty zł', 'adirectory' ), 'value' => 'PLN__zł__after', ], [ 'label' => esc_html__( 'Russian Ruble ₽', 'adirectory' ), 'value' => 'RUB__₽__after', ], [ 'label' => esc_html__( 'Saudi Riyal ر.س', 'adirectory' ), 'value' => 'SAR__ر.س__after', ], [ 'label' => esc_html__( 'Singapore Dollar S$', 'adirectory' ), 'value' => 'SGD__$__before', ], [ 'label' => esc_html__( 'South African Rand R', 'adirectory' ), 'value' => 'ZAR__R__before', ], [ 'label' => esc_html__( 'South Korean Won ₩', 'adirectory' ), 'value' => 'KRW__₩__before', ], [ 'label' => esc_html__( 'Sri Lankan Rupee ₨', 'adirectory' ), 'value' => 'LKR__₨__before', ], [ 'label' => esc_html__( 'Swedish Krona kr', 'adirectory' ), 'value' => 'SEK__kr__after', ], [ 'label' => esc_html__( 'Swiss Franc CHF', 'adirectory' ), 'value' => 'CHF__CHF__before', ], [ 'label' => esc_html__( 'Thai Baht ฿', 'adirectory' ), 'value' => 'THB__฿__before', ], [ 'label' => esc_html__( 'Trinidad and Tobago Dollar TT$', 'adirectory' ), 'value' => 'TTD__$__before', ], [ 'label' => esc_html__( 'Turkish Lira ₺', 'adirectory' ), 'value' => 'TRY__₺__before', ], [ 'label' => esc_html__( 'United States Dollar US$', 'adirectory' ), 'value' => 'USD__$__before', ], [ 'label' => esc_html__( 'Vietnamese Dong ₫', 'adirectory' ), 'value' => 'VND__₫__after', ], ] ); $active_plugins = get_option( 'active_plugins' ); $adqs_extension_plugins = apply_filters( 'adqs_extension_plugin_basenames', [ 'ad-compare-listing/ad-compare-listing.php', 'ad-badges/ad-badges.php', 'ad-pricing-package/ad-pricing-package.php', 'ad-pricing-stripe-payment/ad-pricing-stripe-payment.php', 'ad-business-hour/ad-business-hour.php', 'ad-agent-verification/ad-agent-verification.php', 'ad-pricing-coupon/ad-pricing-coupon.php', 'ad-wc-pricing-package/ad-wc-pricing-package.php', 'ad-social-login/ad-social-login.php', 'ad-mailchimp-integration/ad-mailchimp-integration.php', 'ad-claim-listing/ad-claim-listing.php', 'ad-currency-switcher/ad-currency-switcher.php', 'ad-divi-extension/ad-divi-extension.php', ] ); // Include network-activated plugins in multisite. $network_plugins = []; if ( is_multisite() ) { $network_active = (array) get_site_option( 'active_sitewide_plugins', [] ); $network_plugins = array_keys( $network_active ); } $all_active_plugins = array_unique( array_merge( (array) $active_plugins, $network_plugins ) ); $has_active_extension = count( array_intersect( $adqs_extension_plugins, $all_active_plugins ) ) > 0; $this->settingsNavs = [ [ 'title' => esc_html__( 'General', 'adirectory' ), 'path' => 'general', 'icon' => 'fa-solid fa-cog', 'sub_settings' => [ [ 'title' => esc_html__( 'Listing Management', 'adirectory' ), 'path' => 'listing_management', ], [ 'title' => esc_html__( 'Display Settings', 'adirectory' ), 'path' => 'display_settings', ], [ 'title' => esc_html__( 'User Permissions', 'adirectory' ), 'path' => 'user_permissions', ], [ 'title' => esc_html__( 'Currency & Pricing', 'adirectory' ), 'path' => 'currency_pricing', ], ], ], [ 'title' => esc_html__( 'Pages', 'adirectory' ), 'path' => 'pages', 'sub_setting' => [], 'icon' => 'fa-regular fa-file-lines', ], [ 'title' => esc_html__( 'Advance Search', 'adirectory' ), 'path' => 'filters', 'sub_setting' => [], 'icon' => 'fa-solid fa-sliders', ], [ 'title' => esc_html__( 'Emails', 'adirectory' ), 'path' => 'emails', 'icon' => 'fa-regular fa-envelope', 'sub_settings' => [ [ 'title' => esc_html__( 'Email General', 'adirectory' ), 'path' => 'triggers', ], [ 'title' => esc_html__( ' Email Templates', 'adirectory' ), 'path' => 'templates', ], ], ], [ 'title' => esc_html__( 'Seo Schema', 'adirectory' ), 'path' => 'seo_schema', 'icon' => 'fa-solid fa-search', 'sub_setting' => [], ], [ 'title' => esc_html__( 'Login / Registration', 'adirectory' ), 'path' => 'log_reg', 'icon' => 'fa fa-user-plus', 'sub_setting' => [], ], [ 'title' => esc_html__( 'Import/Export', 'adirectory' ), 'path' => 'import_export', 'icon' => 'fa-solid fa-upload', 'sub_setting' => [], ], [ 'title' => esc_html__( 'Shortcodes', 'adirectory' ), 'path' => 'shortcodes', 'icon' => 'fa-solid fa-code', 'sub_setting' => [], ], ]; // Add Payment settings if ad-pricing-package plugin is active if ( in_array( 'ad-pricing-package/ad-pricing-package.php', $active_plugins ) ) { $this->settingsNavs[] = [ 'title' => esc_html__( 'Payment', 'adirectory' ), 'path' => 'payment', 'icon' => 'fa-regular fa-credit-card', 'sub_settings' => [ [ 'title' => esc_html__( 'Bank Transfer', 'adirectory' ), 'path' => 'bank_transfer', ], [ 'title' => esc_html__( 'Paypal', 'adirectory' ), 'path' => 'paypal', ], ], ]; } // Add Stripe sub-setting if ad-pricing-stripe-payment plugin is active if ( in_array( 'ad-pricing-stripe-payment/ad-pricing-stripe-payment.php', $active_plugins ) ) { foreach ( $this->settingsNavs as &$nav ) { if ( $nav['path'] === 'payment' ) { $nav['sub_settings'][] = [ 'title' => esc_html__( 'Stripe', 'adirectory' ), 'path' => 'stripe', ]; break; } } } // Only show the Extensions tab when at least one extension plugin is active. if ( $has_active_extension ) { $this->settingsNavs[] = [ 'title' => esc_html__( 'Extensions', 'adirectory' ), 'path' => 'extension', 'sub_setting' => [], ]; } $this->settingFields = [ [ 'path' => 'listing_management', 'input' => 'number', 'label' => esc_html__( 'Listing default expire days', 'adirectory' ), 'description' => esc_html__( 'Set the number of days after which listings will automatically expire. Default is 365 days.', 'adirectory' ), 'option_name' => 'listing_expiry_date', 'value' => 365, ], [ 'path' => 'import_export', 'input' => 'urlredirect', 'label' => esc_html__( 'Import Listings', 'adirectory' ), 'description' => esc_html__( 'Import listings from CSV files. Click to access the import tool where you can upload and process listing data.', 'adirectory' ), 'value' => 'Importer', ], [ 'path' => 'import_export', 'input' => 'export', 'label' => esc_html__( 'Export Listings', 'adirectory' ), 'description' => esc_html__( 'Export your listings to a CSV file. Select a directory type and click export to download all listings data.', 'adirectory' ), 'value' => 'Export ', 'cb' => "const formdata = new FormData(); formdata.append('action', 'adqs_export_listings'); formdata.append('security', window.qsdObj.adqs_admin_nonce); formdata.append('termid', Number(exportTerm)); const spinner = buttonRefs.current[index].querySelector('.asyn-btn-spinner'); const fieldlabel = buttonRefs.current[index].querySelector('.field-async-label'); spinner.style.display = 'block'; try { const request = await fetch(window.ajaxurl, { method: 'POST', body: formdata, }); if (!request.ok) { throw new Error('Network response was not ok'); } const blob = await request.blob(); const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; link.download = 'exported_data.csv'; document.body.appendChild(link); link.click(); document.body.removeChild(link); window.URL.revokeObjectURL(url); if (buttonRefs.current[index]) { fieldlabel.innerHTML = 'Listings Exported'; spinner.style.display = 'none'; } } catch (error) { alert('Failed to export CSV.'); spinner.style.display = 'none'; }", ], [ 'path' => 'listing_management', 'input' => 'dropdown', 'label' => esc_html__( 'Listing expire duration', 'adirectory' ), 'description' => esc_html__( 'Control how listings expire for all users. Choose between using default expiry or counting from post date.', 'adirectory' ), 'option_name' => '_expiry_duration_type', 'options' => [ [ 'label' => esc_html__( 'Use Default Expire Days', 'adirectory' ), 'value' => '', ], [ 'label' => esc_html__( 'From Post Date', 'adirectory' ), 'value' => 'by_post_date', ], ], ], [ 'path' => 'listing_management', 'input' => 'number', 'label' => esc_html__( 'When Expiry notification', 'adirectory' ), 'description' => esc_html__( 'Number of days before listing expiry to send notification to all listing submission users. Set to 0 to disable notifications.', 'adirectory' ), 'option_name' => '_expiry_notification', 'value' => 7, ], [ 'path' => 'listing_management', 'input' => 'number', 'label' => esc_html__( 'Permanently Delete After (days) of Expiration', 'adirectory' ), 'description' => esc_html__( 'Number of days after listing expiration to permanently delete the listing. Set to 0 to disable permanent deletion.', 'adirectory' ), 'option_name' => '_permanent_delete_days', 'value' => 15, ], [ 'path' => 'listing_management', 'input' => 'number', 'label' => esc_html__( 'Maximum Slider Images Per Listing', 'adirectory' ), 'description' => esc_html__( 'Set the maximum number of slider/gallery images users can upload per listing. Default is 5 images.', 'adirectory' ), 'option_name' => 'max_slider_images', 'value' => 5, ], [ 'path' => 'listing_management', 'input' => 'number', 'label' => esc_html__( 'Maximum Total Image Size (MB)', 'adirectory' ), 'description' => esc_html__( 'Set the maximum total file size for all slider images combined (in megabytes). Default is 3 MB.', 'adirectory' ), 'option_name' => 'max_total_image_size', 'value' => 3, ], [ 'path' => 'listing_management', 'input' => 'number', 'label' => esc_html__( 'Maximum Individual Image Size (MB)', 'adirectory' ), 'description' => esc_html__( 'Set the maximum file size for a single image (in megabytes). Default is 2 MB. Set to 0 for no limit.', 'adirectory' ), 'option_name' => 'max_individual_image_size', 'value' => 2, ], [ 'path' => 'display_settings', 'input' => 'number', 'label' => esc_html__( 'Listing per page', 'adirectory' ), 'description' => esc_html__( 'Number of listings to display per page in listing grids and search results.', 'adirectory' ), 'option_name' => 'listing_per_page', 'value' => 6, ], [ 'path' => 'listing_management', 'input' => 'dropdown', 'label' => esc_html__( 'Custom Page Redirect', 'adirectory' ), 'description' => esc_html__( 'Select a custom page to redirect users after certain actions.', 'adirectory' ), 'option_name' => 'custom_page_redirect', 'options' => $this->get_all_pages_options(), ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Enable Listing Review', 'adirectory' ), 'description' => esc_html__( 'Users cannot submit review or view reviews when disabled.', 'adirectory' ), 'option_name' => 'enable_review', 'value' => '1', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Review only logged in user', 'adirectory' ), 'description' => esc_html__( 'Restrict review submission to logged-in users only. Guests will not be able to submit reviews.', 'adirectory' ), 'option_name' => 'enable_review_comment_only_logged_in', 'value' => '0', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Review Reply', 'adirectory' ), 'description' => esc_html__( 'Allow users to reply to reviews. This enables threaded conversations in reviews.', 'adirectory' ), 'option_name' => 'enable_review_comment_reply', 'value' => '1', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Review Reply only logged in user', 'adirectory' ), 'description' => esc_html__( 'Restrict review replies to logged-in users only. Guests cannot reply to reviews.', 'adirectory' ), 'option_name' => 'enable_review_comment_reply_only_logged_in', 'value' => '0', ], [ 'path' => 'display_settings', 'input' => 'number', 'label' => esc_html__( 'Related Listing per page', 'adirectory' ), 'description' => esc_html__( 'Number of related listings to show on single listing pages.', 'adirectory' ), 'option_name' => 'related_listing_per_page', 'value' => 6, ], [ 'path' => 'display_settings', 'input' => 'toggle', 'label' => esc_html__( 'Related Listing Carousel', 'adirectory' ), 'description' => esc_html__( 'Enable carousel/slider view for related listings instead of static grid.', 'adirectory' ), 'option_name' => 'enable_related_listing_carousel', 'value' => '0', ], [ 'path' => 'display_settings', 'input' => 'dropdown', 'label' => esc_html__( 'Related Listing View Type', 'adirectory' ), 'description' => esc_html__( 'Choose between grid or list layout for displaying related listings.', 'adirectory' ), 'option_name' => 'related_listing_view_type', 'options' => [ [ 'label' => esc_html__( 'Grid', 'adirectory' ), 'value' => 'grid', ], [ 'label' => esc_html__( 'List', 'adirectory' ), 'value' => 'list', ], ], ], [ 'path' => 'display_settings', 'input' => 'media', 'label' => esc_html__( 'Default Preview Image', 'adirectory' ), 'description' => esc_html__( 'Default image to display when a listing has no featured image.', 'adirectory' ), 'option_name' => 'default_preview_image', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Hide author from listing', 'adirectory' ), 'description' => esc_html__( 'Hide the listing author information from public listing pages.', 'adirectory' ), 'option_name' => 'hide_author_listing', 'value' => '0', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Hide email agent page', 'adirectory' ), 'description' => esc_html__( 'Hide the agent/author email address from listing pages.', 'adirectory' ), 'option_name' => 'hide_author_email', 'value' => '0', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Enable logged-in user listing', 'adirectory' ), 'description' => esc_html__( 'Allow logged-in users to submit listings from the frontend. If the Pricing Packages addon is enabled, this applies only to users who have purchased a plan.', 'adirectory' ), 'option_name' => 'enable_logged_in_user_listing', 'value' => is_pricing_available() ? '1' : '0', 'disabled' => is_pricing_available(), ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Enable guest listing', 'adirectory' ), 'description' => esc_html__( 'Allow guests (non-logged-in users) to submit listings without creating an account.', 'adirectory' ), 'option_name' => 'enable_guest_listing', 'value' => '0', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Guest Listing Post Approval', 'adirectory' ), 'description' => esc_html__( 'Require admin approval for guest-submitted listings before they go live.', 'adirectory' ), 'option_name' => 'enable_guest_listing_post_approv', 'value' => '1', ], [ 'path' => 'user_permissions', 'input' => 'toggle', 'label' => esc_html__( 'Logged-in User Listing Approval', 'adirectory' ), 'description' => esc_html__( 'Require admin approval for listings submitted by logged-in users before they go live.', 'adirectory' ), 'option_name' => 'enable_logged_in_user_listing_approval', 'value' => '0', ], [ 'path' => 'currency_pricing', 'input' => 'dropdown', 'label' => esc_html__( 'Select Currency', 'adirectory' ), 'description' => esc_html__( 'Choose the default currency for your directory listings and pricing.', 'adirectory' ), 'option_name' => 'select_currency', 'value' => 'USD__$__before', 'options' => $this->currencyList, ], [ 'path' => 'filters', 'input' => 'toggle', 'label' => esc_html__( 'Ajax Filters', 'adirectory' ), 'description' => esc_html__( 'Enable AJAX-powered filters for instant search results without page reload.', 'adirectory' ), 'option_name' => 'ajax_filters', ], [ 'path' => 'filters', 'input' => 'dropdown', 'label' => esc_html__( 'Filter Layout Position', 'adirectory' ), 'description' => esc_html__( 'Choose where to display the search filters - at the top of listings or in a sidebar.', 'adirectory' ), 'option_name' => 'filterLayoutPosition', 'options' => [ [ 'label' => esc_html__( 'Top Position', 'adirectory' ), 'value' => 'top', ], [ 'label' => esc_html__( 'Sidebar Position', 'adirectory' ), 'value' => 'sidebar', ], ], ], [ 'path' => 'filters', 'input' => 'toggle', 'label' => esc_html__( 'Exclude Search Filters', 'adirectory' ), 'description' => esc_html__( 'Hide the main search input field from the filter section.', 'adirectory' ), 'option_name' => 'excludeSearch', ], [ 'path' => 'filters', 'input' => 'toggle', 'label' => esc_html__( 'Exclude Expandable Filter', 'adirectory' ), 'description' => esc_html__( 'Hide the expandable/collapsible filter section.', 'adirectory' ), 'option_name' => 'excludeExpandSearch', ], [ 'path' => 'filters', 'input' => 'toggle', 'label' => esc_html__( 'Exclude Directory Type Filter', 'adirectory' ), 'description' => esc_html__( 'Hide the directory type filter from the search options.', 'adirectory' ), 'option_name' => 'excludeDirectoryFilter', ], [ 'path' => 'filters', 'input' => 'toggle', 'label' => esc_html__( 'Exclude Sort By', 'adirectory' ), 'description' => esc_html__( 'Hide the sort by dropdown from the filter section.', 'adirectory' ), 'option_name' => 'excludeSortBy', ], [ 'path' => 'filters', 'input' => 'text', 'label' => esc_html__( 'Search Heading Text', 'adirectory' ), 'description' => esc_html__( 'Customize the heading text displayed above the search filters.', 'adirectory' ), 'option_name' => 'searchHeadingText', ], [ 'path' => 'filters', 'input' => 'text', 'label' => esc_html__( 'Filter Button Text', 'adirectory' ), 'description' => esc_html__( 'Customize the text for the filter button.', 'adirectory' ), 'option_name' => 'filterBtnText', ], [ 'path' => 'filters', 'input' => 'text', 'label' => esc_html__( 'Find Listing Button Text', 'adirectory' ), 'description' => esc_html__( 'Customize the text for the main search button.', 'adirectory' ), 'option_name' => 'findListingBtnText', ], [ 'path' => 'filters', 'input' => 'checkbox', 'label' => esc_html__( 'Exclude Filter Fields', 'adirectory' ), 'description' => esc_html__( 'Select which filter fields to hide from the search interface.', 'adirectory' ), 'option_name' => 'excludedFilterFields', 'value' => [ 'search', 'categories', 'locations', 'min_max_price', 'range_price', 'rating', 'tags', 'display_featured', ], 'options' => [ [ 'label' => esc_html__( 'Search', 'adirectory' ), 'value' => 'search', ], [ 'label' => esc_html__( 'Category', 'adirectory' ), 'value' => 'category', ], [ 'label' => esc_html__( 'Location', 'adirectory' ), 'value' => 'location', ], [ 'label' => esc_html__( 'Min and Max Price', 'adirectory' ), 'value' => 'min_max_price', ], [ 'label' => esc_html__( 'Range Price', 'adirectory' ), 'value' => 'range_price', ], [ 'label' => esc_html__( 'Rating', 'adirectory' ), 'value' => 'rating', ], [ 'label' => esc_html__( 'Tags', 'adirectory' ), 'value' => 'tags', ], [ 'label' => esc_html__( 'Featured', 'adirectory' ), 'value' => 'display_featured', ], ], ], [ 'path' => 'filters', 'input' => 'checkbox', 'label' => esc_html__( 'Exclude Sort By Items', 'adirectory' ), 'description' => esc_html__( 'Select which sorting options to hide from the sort dropdown.', 'adirectory' ), 'option_name' => 'excludedSortByItem', 'value' => [ 'date-desc', 'date-asc', 'views-desc', 'rating-desc', 'review-count', 'title-asc', 'title-desc', 'price-asc', 'price-desc', 'rand', ], 'options' => [ [ 'label' => esc_html__( 'Latest listings', 'adirectory' ), 'value' => 'date-desc', ], [ 'label' => esc_html__( 'Oldest listings', 'adirectory' ), 'value' => 'date-asc', ], [ 'label' => esc_html__( 'Popular listings', 'adirectory' ), 'value' => 'views-desc', ], [ 'label' => esc_html__( '5 to 1 (star rating)', 'adirectory' ), 'value' => 'rating-desc', ], [ 'label' => esc_html__( 'Review Count', 'adirectory' ), 'value' => 'review-count', ], [ 'label' => esc_html__( 'A to Z (title)', 'adirectory' ), 'value' => 'title-asc', ], [ 'label' => esc_html__( 'Z to A (title)', 'adirectory' ), 'value' => 'title-desc', ], [ 'label' => esc_html__( 'Price (low to high)', 'adirectory' ), 'value' => 'price-asc', ], [ 'label' => esc_html__( 'Price (high to low)', 'adirectory' ), 'value' => 'price-desc', ], [ 'label' => esc_html__( 'Random listings', 'adirectory' ), 'value' => 'rand', ], ], ], // login registration [ 'path' => 'log_reg', 'input' => 'toggle', 'label' => esc_html__( 'Enable Registration reCAPTCHA', 'adirectory' ), 'description' => esc_html__( 'Add reCAPTCHA verification to the user registration form to prevent spam.', 'adirectory' ), 'option_name' => 'reg_reCAPTCHA_enable', ], [ 'path' => 'log_reg', 'input' => 'toggle', 'label' => esc_html__( 'Enable Login reCAPTCHA', 'adirectory' ), 'description' => esc_html__( 'Add reCAPTCHA verification to the login form for additional security.', 'adirectory' ), 'option_name' => 'log_reCAPTCHA_enable', ], [ 'path' => 'log_reg', 'input' => 'text', 'label' => esc_html__( 'reCAPTCHA Site Key', 'adirectory' ), 'description' => esc_html__( 'Enter your reCAPTCHA site key from Google reCAPTCHA console.', 'adirectory' ), 'option_name' => 'reCAPTCHA_site_key', ], [ 'path' => 'log_reg', 'input' => 'text', 'label' => esc_html__( 'reCAPTCHA Secret Key', 'adirectory' ), 'description' => esc_html__( 'Enter your reCAPTCHA secret key from Google reCAPTCHA console.', 'adirectory' ), 'option_name' => 'reCAPTCHA_secret_key', ], [ 'path' => 'log_reg', 'input' => 'editor', 'label' => 'Terms & Condition Text', 'description' => esc_html__( 'Customize the terms and conditions text displayed during registration.', 'adirectory' ), 'option_name' => 'terms_condition_text', 'value' => 'By clicking the "Sign Up" button you are agreeing to the Terms and Conditions.', ], [ 'path' => 'paypal', 'input' => 'textarea', 'label' => esc_html__( 'Client ID', 'adirectory' ), 'description' => esc_html__( 'Enter your PayPal Client ID from the PayPal Developer Dashboard. This is required for PayPal payment processing.', 'adirectory' ), 'option_name' => 'paypal_client_id', ], [ 'path' => 'stripe', 'input' => 'toggle', 'label' => esc_html__( 'Card With Ajax', 'adirectory' ), 'description' => esc_html__( 'Enable AJAX-powered card processing for Stripe payments. This provides a smoother checkout experience without page reloads.', 'adirectory' ), 'option_name' => 'stripe_card_ajax', 'value' => '1', ], [ 'path' => 'stripe', 'input' => 'textarea', 'label' => esc_html__( 'Publishable Key', 'adirectory' ), 'description' => esc_html__( 'Enter your Stripe Publishable Key from the Stripe Dashboard. This key is safe to use in client-side code.', 'adirectory' ), 'option_name' => 'stripe_key', ], [ 'path' => 'stripe', 'input' => 'textarea', 'label' => esc_html__( 'Secret Key', 'adirectory' ), 'description' => esc_html__( 'Enter your Stripe Secret Key from the Stripe Dashboard. Keep this key secure and never share it publicly.', 'adirectory' ), 'option_name' => 'stripe_secret', ], [ 'path' => 'payment', 'input' => 'checkbox', 'label' => esc_html__( 'Payment Methods', 'adirectory' ), 'description' => esc_html__( 'Select which payment methods to enable for your directory. Users will be able to choose from the enabled options during checkout.', 'adirectory' ), 'option_name' => 'payment_methods', 'value' => [ 'paypal', 'stripe', 'paddle', ], 'options' => [ [ 'label' => esc_html__( 'Paypal', 'adirectory' ), 'value' => 'paypal', ], [ 'label' => esc_html__( 'Stripe', 'adirectory' ), 'value' => 'stripe', ], [ 'label' => esc_html__( 'Paddle', 'adirectory' ), 'value' => 'paddle', ], ], ], [ 'path' => 'bank_transfer', 'input' => 'toggle', 'label' => esc_html__( 'Enable/Disable', 'adirectory' ), 'description' => esc_html__( 'Enable or disable bank transfer as a payment method. When enabled, users can pay via direct bank transfer.', 'adirectory' ), 'option_name' => 'enable_bank_transfer', 'value' => '1', ], [ 'path' => 'bank_transfer', 'input' => 'editor', 'label' => esc_html__( 'Bank Account Details', 'adirectory' ), 'description' => esc_html__( 'Enter your bank account details that will be displayed to users for bank transfer payments. Include bank name, account number, routing number, etc.', 'adirectory' ), 'option_name' => 'bank_ac_details', 'value' => 'Bank Name: Your bank name.
Account Number: Your bank account number.
Routing Number: Bank routing number.
Branch: Your bank branch name.', ], [ 'path' => 'pages', 'input' => 'asynccb', 'label' => esc_html__( 'Regenerate Pages', 'adirectory' ), 'description' => esc_html__( 'Regenerate all directory pages (add listing, dashboard, etc.) with current settings.', 'adirectory' ), 'cb' => "const formdata = new FormData(); formdata.append('action', 'adqs_gen_common_asset'); formdata.append('security', window.qsdObj.adqs_admin_nonce); const spinner = buttonRefs.current[index].querySelector('.asyn-btn-spinner'); const fieldlabel = buttonRefs.current[index].querySelector('.field-async-label'); spinner.style.display = 'block'; try { const request = await fetch(window.ajaxurl, { method: 'POST', body: formdata, }); const response = await request.json(); if(response){ if (buttonRefs.current[index]) { fieldlabel.innerHTML = 'Pages Regenerated'; spinner.style.display = 'none'; } } } catch (error) { alert('failed'); }", ], [ 'path' => 'pages', 'input' => 'media', 'label' => esc_html__( 'Content Not Found Image', 'adirectory' ), 'description' => esc_html__( 'Image to display when no listings are found or content is missing.', 'adirectory' ), 'option_name' => 'content_not_found_image', ], [ 'path' => 'pages', 'input' => 'editor', 'label' => esc_html__( 'Content Not Found Text', 'adirectory' ), 'description' => esc_html__( 'Text message to display when no listings are found or content is missing.', 'adirectory' ), 'option_name' => 'content_not_found', ], [ 'path' => 'shortcodes', 'input' => 'shortcode', 'label' => esc_html__( 'All Listing Shortcode', 'adirectory' ), 'description' => esc_html__( 'Display all listings in a grid or list format. Use this shortcode on any page to show your directory listings.', 'adirectory' ), 'help_desc' => '', 'value' => '[adqs_listings]', ], [ 'path' => 'shortcodes', 'input' => 'shortcode', 'label' => esc_html__( 'All Location Shortcode', 'adirectory' ), 'description' => esc_html__( 'Display all locations in a list or grid format. Perfect for location-based navigation.', 'adirectory' ), 'help_desc' => '', 'value' => "[adqs_taxonomies tax_type='locations']", ], [ 'path' => 'shortcodes', 'input' => 'shortcode', 'label' => esc_html__( 'All Categories Shortcode', 'adirectory' ), 'description' => esc_html__( 'Display all categories in a list or grid format. Great for category-based navigation.', 'adirectory' ), 'help_desc' => '', 'value' => '[adqs_taxonomies]', ], [ 'path' => 'shortcodes', 'input' => 'shortcode', 'label' => esc_html__( 'Add Listing Shortcode', 'adirectory' ), 'description' => esc_html__( 'Display the add listing form. Users can submit new listings using this shortcode.', 'adirectory' ), 'help_desc' => '', 'value' => '[adqs_add_listing]', ], [ 'path' => 'shortcodes', 'input' => 'shortcode', 'label' => esc_html__( 'User Dashboard Shortcode', 'adirectory' ), 'description' => esc_html__( 'Display the user dashboard where logged-in users can manage their listings and account.', 'adirectory' ), 'help_desc' => '', 'value' => '[adqs_dashboard]', ], [ 'path' => 'shortcodes', 'input' => 'shortcode', 'label' => esc_html__( 'Login/Registration Shortcode', 'adirectory' ), 'description' => esc_html__( 'Display the login and registration forms. Users can sign in or create new accounts.', 'adirectory' ), 'help_desc' => '', 'value' => '[adqs_user_log_regi]', ], [ 'path' => 'shortcodes', 'input' => 'shortcode', 'label' => esc_html__( 'All Agents Shortcode', 'adirectory' ), 'description' => esc_html__( 'Display all agents/listing authors in a grid or list format. Perfect for agent directories.', 'adirectory' ), 'help_desc' => '', 'value' => '[adqs_agents]', ], [ 'path' => 'triggers', 'input' => 'text', 'label' => esc_html__( 'From email name', 'adirectory' ), 'description' => esc_html__( 'Name that will appear as the sender of system emails.', 'adirectory' ), 'option_name' => 'from_email_name', 'value' => '', ], [ 'path' => 'triggers', 'input' => 'text', 'label' => esc_html__( 'From email address', 'adirectory' ), 'description' => esc_html__( 'Email address that will be used as the sender for system emails.', 'adirectory' ), 'option_name' => 'from_email_address', 'value' => '', ], [ 'path' => 'triggers', 'input' => 'checkbox', 'label' => esc_html__( 'Notify admin via email when', 'adirectory' ), 'description' => esc_html__( 'Select which events should trigger email notifications to administrators.', 'adirectory' ), 'option_name' => 'adqs_admin_emails_triggers', 'value' => [ esc_html__( 'new_user_reg', 'adirectory' ), esc_html__( 'new_listing_sub', 'adirectory' ), esc_html__( 'new_listing_up', 'adirectory' ), esc_html__( 'order_created', 'adirectory' ), esc_html__( 'order_completed', 'adirectory' ), esc_html__( 'document_submitted', 'adirectory' ), esc_html__( 'new_review_submitted', 'adirectory' ), esc_html__( 'new_reply_submitted', 'adirectory' ), ], 'options' => [ [ 'label' => esc_html__( 'New user register', 'adirectory' ), 'value' => esc_html__( 'new_user_reg', 'adirectory' ), ], [ 'label' => esc_html__( 'New listing submitted', 'adirectory' ), 'value' => esc_html__( 'new_listing_sub', 'adirectory' ), ], [ 'label' => esc_html__( 'Listing updated', 'adirectory' ), 'value' => esc_html__( 'new_listing_up', 'adirectory' ), ], [ 'label' => esc_html__( 'Order created', 'adirectory' ), 'value' => esc_html__( 'order_created', 'adirectory' ), ], [ 'label' => esc_html__( 'Order complete', 'adirectory' ), 'value' => esc_html__( 'order_completed', 'adirectory' ), ], [ 'label' => esc_html__( 'Document submitted', 'adirectory' ), 'value' => esc_html__( 'document_submitted', 'adirectory' ), ], [ 'label' => esc_html__( 'New review submitted', 'adirectory' ), 'value' => esc_html__( 'new_review_submitted', 'adirectory' ), ], [ 'label' => esc_html__( 'New reply to review', 'adirectory' ), 'value' => esc_html__( 'new_reply_submitted', 'adirectory' ), ], ], ], [ 'path' => 'triggers', 'input' => 'checkbox', 'label' => esc_html__( 'Notify user via email when', 'adirectory' ), 'description' => esc_html__( 'Select which events should trigger email notifications to users.', 'adirectory' ), 'option_name' => 'adqs_user_emails_triggers', 'value' => [ esc_html__( 'new_user_reg', 'adirectory' ), esc_html__( 'new_listing_sub', 'adirectory' ), esc_html__( 'listing_is_approved', 'adirectory' ), esc_html__( 'listing_about_expire', 'adirectory' ), esc_html__( 'listing_expired', 'adirectory' ), esc_html__( 'order_pending', 'adirectory' ), esc_html__( 'order_created', 'adirectory' ), esc_html__( 'order_completed', 'adirectory' ), esc_html__( 'document_verified', 'adirectory' ), esc_html__( 'document_rejected', 'adirectory' ), esc_html__( 'new_review_submitted', 'adirectory' ), esc_html__( 'new_reply_submitted', 'adirectory' ), ], 'options' => [ [ 'label' => esc_html__( 'New user register', 'adirectory' ), 'value' => esc_html__( 'new_user_reg', 'adirectory' ), ], [ 'label' => esc_html__( 'New listing submitted', 'adirectory' ), 'value' => esc_html__( 'new_listing_sub', 'adirectory' ), ], [ 'label' => esc_html__( 'Listing approved', 'adirectory' ), 'value' => esc_html__( 'listing_is_approved', 'adirectory' ), ], [ 'label' => esc_html__( 'Listing about to expire', 'adirectory' ), 'value' => esc_html__( 'listing_about_expire', 'adirectory' ), ], [ 'label' => esc_html__( 'Listing expired', 'adirectory' ), 'value' => esc_html__( 'listing_expired', 'adirectory' ), ], [ 'label' => esc_html__( 'Order cancelled', 'adirectory' ), 'value' => esc_html__( 'order_cancelled', 'adirectory' ), ], [ 'label' => esc_html__( 'Order failed', 'adirectory' ), 'value' => esc_html__( 'order_failed', 'adirectory' ), ], [ 'label' => esc_html__( 'Order pending', 'adirectory' ), 'value' => esc_html__( 'order_pending', 'adirectory' ), ], [ 'label' => esc_html__( 'Order created', 'adirectory' ), 'value' => esc_html__( 'order_created', 'adirectory' ), ], [ 'label' => esc_html__( 'Order complete', 'adirectory' ), 'value' => esc_html__( 'order_completed', 'adirectory' ), ], [ 'label' => esc_html__( 'Document verified', 'adirectory' ), 'value' => esc_html__( 'document_verified', 'adirectory' ), ], [ 'label' => esc_html__( 'Document rejected', 'adirectory' ), 'value' => esc_html__( 'document_rejected', 'adirectory' ), ], [ 'label' => esc_html__( 'New review submitted', 'adirectory' ), 'value' => esc_html__( 'new_review_submitted', 'adirectory' ), ], [ 'label' => esc_html__( 'New reply to review', 'adirectory' ), 'value' => esc_html__( 'new_reply_submitted', 'adirectory' ), ], ], ], [ 'path' => 'templates', 'input' => 'component', 'label' => esc_html__( 'Email Templates', 'adirectory' ), 'description' => esc_html__( 'Customize email templates for different notifications sent to users and administrators.', 'adirectory' ), 'help_desc' => 'Customize email templates for different notifications', 'option_name' => 'adqs_admin_templates', 'value' => '', ], [ 'path' => 'seo_schema', 'input' => 'checkbox', 'label' => esc_html__( 'Enable Schema Options', 'adirectory' ), 'description' => esc_html__( 'Select which schema markup elements to include for better SEO and search engine visibility.', 'adirectory' ), 'option_name' => 'schema_options', 'value' => [ esc_html__( 'headline', 'adirectory' ), esc_html__( 'tagline', 'adirectory' ), esc_html__( 'description', 'adirectory' ), esc_html__( 'image', 'adirectory' ), esc_html__( 'address', 'adirectory' ), esc_html__( 'geo', 'adirectory' ), esc_html__( 'telephone', 'adirectory' ), esc_html__( 'fax', 'adirectory' ), esc_html__( 'email', 'adirectory' ), esc_html__( 'website', 'adirectory' ), esc_html__( 'author', 'adirectory' ), esc_html__( 'rating', 'adirectory' ), esc_html__( 'date', 'adirectory' ), ], 'options' => [ [ 'label' => esc_html__( 'Headline', 'adirectory' ), 'value' => esc_html__( 'headline', 'adirectory' ), ], [ 'label' => esc_html__( 'Tagline', 'adirectory' ), 'value' => esc_html__( 'tagline', 'adirectory' ), ], [ 'label' => esc_html__( 'Description', 'adirectory' ), 'value' => esc_html__( 'description', 'adirectory' ), ], [ 'label' => esc_html__( 'Image', 'adirectory' ), 'value' => esc_html__( 'image', 'adirectory' ), ], [ 'label' => esc_html__( 'Address', 'adirectory' ), 'value' => esc_html__( 'address', 'adirectory' ), ], [ 'label' => esc_html__( 'Geo Location', 'adirectory' ), 'value' => esc_html__( 'geo', 'adirectory' ), ], [ 'label' => esc_html__( 'Telephone', 'adirectory' ), 'value' => esc_html__( 'telephone', 'adirectory' ), ], [ 'label' => esc_html__( 'Fax', 'adirectory' ), 'value' => esc_html__( 'fax', 'adirectory' ), ], [ 'label' => esc_html__( 'Email', 'adirectory' ), 'value' => esc_html__( 'email', 'adirectory' ), ], [ 'label' => esc_html__( 'Website', 'adirectory' ), 'value' => esc_html__( 'website', 'adirectory' ), ], [ 'label' => esc_html__( 'Author', 'adirectory' ), 'value' => esc_html__( 'author', 'adirectory' ), ], [ 'label' => esc_html__( 'Rating', 'adirectory' ), 'value' => esc_html__( 'rating', 'adirectory' ), ], [ 'label' => esc_html__( 'Date', 'adirectory' ), 'value' => esc_html__( 'date', 'adirectory' ), ], ], ], ]; } public static function get_settings_nav() { $self = new self(); return apply_filters( 'adqs_settings_nav', $self->settingsNavs ); } public static function get_settings_fields() { $self = new self(); return apply_filters( 'adqs_settings_fields', $self->settingFields ); } public static function get_single_setting( $option_name, $default = '' ) { $options = get_option( 'adqs_admin_settings', [] ); return $options[ $option_name ] ?? $default; } /** * Get all published pages as options array for dropdown */ private function get_all_pages_options() { $pages = get_pages( [ 'status' => 'publish', 'sort_column' => 'post_title', 'sort_order' => 'ASC', ] ); $options = [ [ 'label' => esc_html__( 'Select a page...', 'adirectory' ), 'value' => '', ], ]; if ( ! empty( $pages ) ) { foreach ( $pages as $page ) { $options[] = [ 'label' => esc_html( $page->post_title ), 'value' => $page->ID, ]; } } return $options; } }