Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
/**
 * Call To Action utility & helper functions.
 *
 * @author    Code Atlantic LLC
 * @package   PopupMaker
 * @copyright Copyright (c) 2024, Code Atlantic LLC
 */

namespace PopupMaker;

defined( 'ABSPATH' ) || exit;

use function PopupMaker\plugin;

/**
 * Get call to action by ID.
 *
 * @param int $cta_id Call to action ID.
 *
 * @return \PopupMaker\Models\CallToAction|null
 */
function get_cta_by_id( $cta_id = 0 ) {
	return plugin( 'ctas' )->get_by_id( $cta_id );
}

/**
 * Get call to action by UUID.
 *
 * @param string $cta_uuid Call to action UUID.
 *
 * @return \PopupMaker\Models\CallToAction|null
 */
function get_cta_by_uuid( $cta_uuid = '' ) {
	return plugin( 'ctas' )->get_by_uuid( $cta_uuid );
}

/**
 * Generate a unique call to action UUID.
 *
 * @param int $cta_id Call to action ID.
 *
 * @return string
 */
function generate_unique_cta_uuid( $cta_id = 0 ) {
	/**
	 * Filter for generating your own call to action UUID.
	 *
	 * @param string $uuid Call to action UUID.
	 * @param int $cta_id Call to action ID.
	 *
	 * @return string
	 */
	$override = apply_filters( 'popup_maker/generate_cta_uuid', null, $cta_id );

	if ( is_string( $override ) && '' !== $override ) {
		return $override;
	}

	global $wpdb;

	// Try up to 3 times to generate a uniq