__( 'is', 'adpresso' ), 'is_not' => __( 'is not', 'adpresso' ), ]; } /** * Configures the value selection field in the Admin UI. */ public function get_value_config( array $stored_node_data = [] ): array { return [ 'type' => 'select', 'options' => [ 'mobile' => __( 'Mobile (including Tablets)', 'adpresso' ), 'desktop' => __( 'Desktop', 'adpresso' ), ], 'default' => 'mobile', 'description' => __( 'Show ads based on selected device types.', 'adpresso' ), 'link' => 'https://wpadpresso.com/docs/conditions/device/?utm_source=plugin-backend&utm_medium=manual-link&utm_campaign=cond-device&utm_content=modal', ]; } /** * Formats the saved value for display. */ public function format_value( mixed $raw ): string { if ( $raw === 'mobile' ) { return __( 'Mobile', 'adpresso' ); } if ( $raw === 'desktop' ) { return __( 'Desktop', 'adpresso' ); } return (string) $raw; } /** * The PHP evaluate method. * Always returns true because the actual logic happens in JavaScript. */ public function evaluate( string $operator, mixed $value, Entity $entity ): bool { return true; } }