HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: /home/greer489/public_html/wp-content/themes/betheme/muffin-options/fields/ajax/field_ajax.php
<?php
class MFN_Options_ajax extends Mfn_Options_field
{

	/**
	 * Render
	 */

	public function render( $meta = false, $vb = false )
	{
		$action = isset( $this->field['action'] ) ? $this->field['action'] : '';
		$param 	= isset( $this->field['param'] ) ? $this->field['param'] : '';

		$button = isset( $this->field['button'] ) ? $this->field['button'] : __( 'Randomize', 'mfn-opts' );

		echo '<div class="form-group ajax">';
			echo '<div class="form-control">';

				echo '<a class="mfn-btn mfn-btn-blue" href="#" data-nonce="'. wp_create_nonce( 'mfn-builder-nonce' ) .'" data-ajax="'. esc_url( admin_url( 'admin-ajax.php' ) ) .'" data-action="'. esc_attr( $action ) .'" data-param="'. esc_attr( $param ) .'">';
					echo '<span class="btn-wrapper">'. esc_html( $button ) .'</span>';
				echo '</a>';

			echo '</div>';
		echo '</div>';

		if( ! $vb ){
			echo $this->get_description();
		}

		// enqueue

		$this->enqueue();
	}

	/**
	 * Enqueue
	 */

	public function enqueue()
	{
		wp_enqueue_script( 'mfn-opts-field-ajax', MFN_OPTIONS_URI .'fields/ajax/field_ajax.js', array( 'jquery' ), MFN_THEME_VERSION, true );
	}
}