Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Forms::get_core_forms( string $return = 'posts', $use_cache = true )
Retrieves only core forms.
Description Description
When there are multiple forms for a location, the core form is identified as the one with the lowest ID.
Parameters Parameters
- $return
-
(string) (Optional) What to return: 'posts', for an array of WP_Post; 'ids' for an array of WP_Post ids.
Default value: 'posts'
Return Return
(WP_Post[]|int[])
Source Source
File: includes/forms/class-llms-forms.php
FROM $wpdb->posts
INNER JOIN {$wpdb->postmeta} AS locations ON {$wpdb->posts}.ID = locations.post_id AND locations.meta_key='_llms_form_location'
INNER JOIN {$wpdb->postmeta} AS is_cores ON {$wpdb->posts}.ID = is_cores.post_id AND is_cores.meta_key='_llms_form_is_core'
WHERE {$wpdb->posts}.post_type = %s
AND locations.meta_value IN ({$locations_placeholders})
AND is_cores.meta_value = 'yes'
GROUP BY locations.meta_value";
$form_ids = $wpdb->get_col(
$wpdb->prepare(
$query, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- It is prepared.
$prepare_values
)
);
$form_ids = array_map( 'absint', $form_ids );
$forms = 'post' === $return ? array_map( 'get_post', $form_ids ) : $form_ids;
wp_cache_set( $forms_cache_key, $forms );
return $forms;
}
/**
* Retrieve additional fields added to the form programmatically.
*
* @since 5.0.0
*
* @param string $location Form location, one of: "checkout", "registration", or "account".
* @param array $args Additional arguments passed to the short-circuit filter.
* @return array[]
*/
private function get_additional_fields( $location, $args = array() ) {
/**
* Filter to add custom fields to a form programmatically.
*
* @since 3.0.0
* @since 5.0.0 Moved from deprecated function `LLMS_Person_Handler::get_available_fields()`.
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |