Render HTML through shortcode

Formidable Forms
February 23, 2024 04:27:54
nati
Topics: 1
Messages: 2
Hello, I have this code and I want to render an ul element which i wish to style with display: flex etc. The code:
function combine_and_format_values() {
// Add the default values
$default_values = array('אח.ות', 'דוד.ה', 'סבא. סבתא');

// Get the dynamic value from the form field
$dynamic_value = FrmProEntriesController::get_field_value_shortcode(array('field_id' => 1942, 'user_id' => 'current'));

// Split the dynamic value into an array
$dynamic_values_array = explode(',', $dynamic_value);

// Combine the default and dynamic values
$combined_values = array_merge($default_values, $dynamic_values_array);

// Format the values into an HTML unordered list
$html_output = '<ul>';
foreach ($combined_values as $value) {
$html_output .= '<li>' . $value . '</li>';
}
$html_output .= '</ul>';

return $html_output;
}

add_shortcode('combined_values', 'combine_and_format_values');

I have default and dynamic values, when i insert this to either html or textarea it converts to spans.
In the attached file is the look i wish to achieve by styling this.
February 23, 2024 05:40:08
E2Pdf
Topics: 7
Messages: 3617
Support
Hello,

Unfortunately, E2Pdf doesn't support "flex" css. As an option, you can try to generate designed output via "table":

https://codefile.io/f/8ywWjLy8pP

We would really appreciate your feedback at WordPress.org!
February 23, 2024 05:47:45
nati
Topics: 1
Messages: 2
Ty, that worked perfectly. I literally just started using the table before your answer :)
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.