WP Residence Help WP Residence Help

  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / 13. WPResidence / WPEstate CRM / WPResidence CRM Field Renderer — Developer Reference

WPResidence CRM Field Renderer — Developer Reference

14 views 0

Developer documentation for the field renderer of the WPResidence real estate CRM. Lives in libs/field-renderer.php and libs/metaboxes.php.

Field Type Registry

Supported types:

  • input — short text
  • textarea — long text
  • picklist — dropdown from a settings key
  • date — formatted via get_option('date_format')
  • number — locale-formatted via number_format_i18n()
  • taxonomy — references a taxonomy term by ID, displays the term name
  • post_type — references another post by ID, displays title + link
  • content — read-only HTML (legacy lead message display)

Field Registries

Each CPT/entity defines its fields as an array:

  • wpestate_return_contact_post_array() — 31+ contact fields.
  • wpestate_leads_post_array() — 6 lead fields.

Field Definition Shape

[
  'type'      => 'input' | 'textarea' | 'picklist' | ...,
  'label'     => 'Human label',
  'db_col'    => 'database_column',
  'section'   => 'personal_info' | 'contact_info' | ...,
  'source'    => 'settings_picklist_key' | taxonomy slug | post type slug,  // optional
  'required'  => true | false,
  'length'    => 'full',  // optional — 100% width on the form grid
  'placeholder' => '...',
  'editable'  => true | false,
]

Contact Form Sections

Section keys: personal_info, contact_info, address, social_profiles, lead_info, buyer_preferences, notes.

The form template loops the registry grouped by section, rendering section headers and fields in order.

Renderers

Function Mode
wpestate_crm_show_details() Editable — renders inputs
wpestate_crm_show_details_readonly() Read-only — renders formatted display HTML

Editable Field Helpers (libs/metaboxes.php)

  • wpestate_crm_return_input_metabox()
  • wpestate_crm_return_textarea_metabox()
  • wpestate_crm_return_picklist_metabox()
  • wpestate_crm_return_post_type_items() — select dropdown populated from a post type query (e.g., estate_agent).
  • wpestate_crm_return_taxonomy_metabox()

Read-Only Formatting

  • Empty values: rendered as the setting crm_empty_value_text (default —).
  • Numbers: number_format_i18n().
  • Dates: date_i18n(get_option('date_format'), $timestamp).
  • Taxonomy: get_term() and display the term name.
  • Post type: get_the_title() + get_permalink() hyperlink.

Picklist Source Resolution

For a field with type=picklist, source='crm_lead_sources', the renderer calls wpestate_crm_get_setting('crm_lead_sources') and splits on comma. Add options by adding values to the settings string — no code change required.

Adding a Brand-New Field

  1. Add the column to the table schema in libs/db-setup.php via dbDelta-compatible SQL (or add it from a child plugin’s own activation routine).
  2. Bump wpestate_crm_db_version so the activation routine re-runs dbDelta.
  3. Add the field definition to the appropriate registry array (wpestate_return_contact_post_array() or equivalent) — ideally fork via a filter hook in a child plugin rather than editing the CRM plugin.
  4. If the field needs a new picklist, add a default seed value in libs/settings.php.

Extending Without Editing the Plugin

The registries are plain function calls, so override is awkward. Pragmatic options:

  • Store extended data as JSON in an existing _meta longtext column rather than adding real columns — avoids schema changes.
  • Render extra fields on the detail page via a theme template override that wraps the CRM template.
  • If you must change the registry, fork the specific function in a wpestate-crm-extensions plugin that loads before the main CRM.

Non-Latin Input

All text-type inputs go through sanitize_text_field() or sanitize_textarea_field(), both UTF-8 safe. Picklist values are also stored as plain text and display any script correctly.

13. WPResidence / WPEstate CRM

Related Articles

  • WPResidence CRM Security Model — Developer Reference
  • CRM Security and Data Privacy
  • WPResidence CRM Installation and Updates — Developer Reference
  • Installing and Updating the WPResidence CRM

WP Residence Documentation

  • 01. Getting Started
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 02. Installation & Setup
  • 03. Installation FAQ
  • 06. Search & Filtering
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 09. Agent, Agency & Developers
  • 08. Property Pages & Layouts
  • 07. Property Lists, Categories & Archive
  • 14. WPResidence Elementor Studio
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List Properties or Articles by ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Icon Content Box Shortcode
  • 12. Widgets
  • 04. Theme Options & Global Settings
    • General Settings
    • User Types Settings
    • Appearance
    • Logos & Favicon
    • Header
    • Footer Style and Colors
    • Price & Currency
    • Property Custom Fields
    • Features & Amenities
    • Listing Labels
    • Theme Slider
    • Permalinks
    • Splash Page
    • Social & Contact
    • Map Settings
    • Pin Management
    • How read from file works
    • General Design Settings
    • Custom Colors Settings
    • Header Design & Colors
    • Mobile Menu Colors
    • User Dashboard Colors
    • Print PDF Design
    • Property, Agent, Blog Lists Design Settings
    • Sidebar Widget Design
    • Font management
    • How to add custom CSS
    • Custom Property Card Unit – Beta version
    • Email Management
    • Import & Export theme options
    • reCaptcha settings
    • YELP API Integration
    • iHomefinder Optima Express IDX
    • MEMBERSHIP & PAYMENT Settings
    • Property Submission Page
    • PayPal Setup
    • Stripe Setup
    • Wire Transfer Payment Method
  • 20. Translations & Languages
  • 26. FAQ
  • 10. Pages
  • 11. Header
  • 12. Footer
  • 05. Maps & Location Settings
  • 18. Payments & Monetization
  • Plugins
    • 19. Included Plugins
    • 22. Third Party Plugins – IDX Compatibility
    • 21. Third-Party Plugins – Multi-Language
    • 23. Third party Plugins – Other
  • Technical
    • 24. Technical how to | Custom Code Required
    • 25. Technical: Child Theme

Join Us On

Powered by WP Estate - All Rights Reserved
  • WpEstate
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API