name = 'fea_plans'; $this->label = __( 'Plans', 'frontend-admin' ); $this->category = 'relational'; $this->public = false; $this->defaults = array( 'allow_null' => 0, 'multiple' => 0, 'return_format' => 'object', 'ui' => 1, 'add_plan' => 0, 'edit_plans' => 0, ); } /* * render_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function render_field( $field ) { // convert $field['value'] = acf_get_array( $field['value'] ); $plans = fea_instance()->plans_handler->get_plans(); $choices = []; ?>
render_single_plan( $plan, $field ); } $this->render_single_plan( 'clone', $field ); ?>
'', 'value' => '', 'name' => $field['name'], 'disabled' => 'disabled' ]; }else{ $choice = [ 'label' => $plan['title'] . ' - ' . $plan['pricing'] . ' ' . $plan['currency'], 'value' => $plan['id'], 'name' => $field['name'] ]; if( in_array( intval( $plan['id'] ), $field['value'], true ) ){ $choice['checked'] = true; } } ?>
' . acf_esc_html( $label ) . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped by acf_esc_attr(). if( $field['edit_plans'] ?? false ) $this->render_plan_actions( $plan['id'] ?? '' ); ?>