HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/internal-links/core/options/custom-fields-option.php
<?php
namespace ILJ\Core\Options;

use ILJ\Helper\Regex_Custom_Field;

/**
 * Abstract class for the classes using custom fields
 *
 * @package ILJ\Core\Options
 */
abstract class Custom_Fields_Option extends AbstractOption {


	/**
	 * The custom fields posts with support for regex meta keys needs to be rendered on frontend upon saving.
	 *
	 * @param array $value
	 *
	 * @return void
	 */
	protected function render_saved_regex_options($value) {
		if (!is_array($value)) {
			return;
		}
		foreach ($value as $item) {
			if (is_string($item) && Regex_Custom_Field::is_valid_rule($item)) {
				$field = Regex_Custom_Field::from($item);
				?>
				<option value="<?php echo esc_attr($item);?>" selected><?php echo esc_html($field->get_label()); ?></option>
				<?php
			}
		}
	}
}