HEX
Server: Apache
System: Linux webd006.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: zwafgyp (177615)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/zwafgyp/lacalita/wp-content/plugins/rey-core/inc/compatibility/wpforms/base.php
<?php
namespace ReyCore\Compatibility\Wpforms;

if ( ! defined( 'ABSPATH' ) ) exit;

class Base extends \ReyCore\Compatibility\CompatibilityBase
{
	public function __construct()
	{
		add_filter('reycore/wpforms/forms', [$this, 'get_forms'], 10);
		add_filter('reycore/wpforms/control_description', [$this, 'get_notice'], 10);
	}

	/**
	 * Get forms.
	 *
	 * Retrieve an array of forms from the CF7 plugin.
	 */
	public function get_forms( $forms ) {

		if( ! function_exists('wpforms') ){
			return $forms;
		}

		$wpforms = wpforms()->form->get();

		if ( ! empty( $wpforms ) ) {
			$forms[ '' ] = esc_html__('- Select -', 'rey-core');
			foreach ( $wpforms as $form ) {
				$forms[ absint( $form->ID ) ] = esc_html( $form->post_title );
			}
		}

		return $forms;
	}

	/**
	 * Get notice.
	 *
	 */
	public function get_notice() {

		if( function_exists('wpforms') ){
			return esc_html__( 'Select the contact form you created in WP Forms.', 'rey-core' );
		}

		return __('<p>It seems <a href="https://wordpress.org/plugins/wpforms-lite/" target="_blank">WPForms</a> is not installed or active. Please activate it to be able to create a contact form to be used with this option.</p>', 'rey-core');
	}

}