'', 'theme' => 'auto', ), is_array( $atts ) ? $atts : array(), 'formlyx-forms' ); $id = isset( $atts['id'] ) ? (string) $atts['id'] : ''; $theme = isset( $atts['theme'] ) ? (string) $atts['theme'] : 'auto'; return self::markup( $id, $theme ); } /** * Build one embed container and enqueue the hosted script. * * A missing or rejected id produces no markup and no script. * * @since 1.0.0 * * @param string $id Form id. * @param string $theme Theme attribute. * @return string */ public static function markup( string $id, string $theme ): string { if ( ! self::is_form_id( $id ) ) { return ''; } $theme = self::theme( $theme ); Embed::enqueue( $theme ); return sprintf( '
', esc_attr( $id ), esc_attr( $theme ) ); } }