# sellkit/2.3.0/includes/contact-segmentation/conditions/referral-source-internal-post.php

SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster, version 2.3.0. 100 lines.

- Page: https://pluginprobe.com/plugins/sellkit/2.3.0/code/includes/contact-segmentation/conditions/referral-source-internal-post.php
- Raw: https://pluginprobe.com/plugins/sellkit/2.3.0/raw/includes/contact-segmentation/conditions/referral-source-internal-post.php
- Modified: 2024-10-09T07:00:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sellkit/2.3.0/code/includes/contact-segmentation/conditions/referral-source-internal-post.php#L10-L20`.

```php
<?php

namespace Sellkit\Contact_Segmentation\Conditions;

use Sellkit\Contact_Segmentation\Conditions\Condition_Base;

defined( 'ABSPATH' ) || die();

/**
 * Class Referral Source Internal Post.
 *
 * @package Sellkit\Contact_Segmentation\Conditions
 * @since 1.1.0
 */
class Referral_Source_Internal_Post extends Condition_Base {

	/**
	 * Condition name.
	 *
	 * @since 1.1.0
	 */
	public function get_name() {
		return 'referral-source-internal-post';
	}

	/**
	 * Condition title.
	 *
	 * @since 1.1.0
	 */
	public function get_title() {
		return __( 'Referral Source (Internal Page/Post)', 'sellkit' );
	}

	/**
	 * Condition type.
	 *
	 * @since 1.1.0
	 */
	public function get_type() {
		return self::SELLKIT_MULTISELECT_CONDITION_VALUE;
	}

	/**
	 * Get the options
	 *
	 * @since 1.1.0
	 * @return array
	 */
	public function get_options() {
		$input_value = sellkit_htmlspecialchars( INPUT_GET, 'input_value' );

		$posts = [];
		$args  = [
			'post_type' => [ 'post', 'page' ],
			'post_status' => 'any',
			's' => sanitize_text_field( $input_value ),
		];

		$query = new \WP_Query( $args );

		if ( $query->have_posts() ) {
			while ( $query->have_posts() ) {
				$query->the_post();
				$posts[ get_the_ID() ] = htmlspecialchars_decode( get_the_title() );
			}
		}

		return $posts;
	}

	/**
	 * It is pro feature or not.
	 *
	 * @since 1.1.0
	 */
	public function is_pro() {
		return true;
	}

	/**
	 * All the conditions are not searchable by default.
	 *
	 * @return false
	 * @since 1.1.0
	 */
	public function is_searchable() {
		return true;
	}

	/**
	 * Check if the condition is active or not.
	 *
	 * @return bool
	 */
	public function is_active() {
		return false;
	}
}

```
