Convert the items in the shortcode into an array, and return a list:
add_shortcode( 'features_list', 'shortcode_features_list' );
function shortcode_features_list( $atts = array(), $content="" )
{
$content = trim( $content );
if ( '' === $content )
return;
$items = explode( "\n", $content );
$items = array_map( 'trim', $items );
return '<ul class="features"><li>' . join( '</li><li>', $items ) . '</li></ul>';
}
Related Posts:
- PHP Deprecated: Non-static method should not be called statically
- Adding Custom Fields for Img in Posts
- How To Ignore a Filter On Applying Filter the Content In a Function
- Calling function from within functions.php returns unwanted value
- shortcode doesn’t work
- Can’t get custom posts of taxonomy to show
- Shortcode to generate and save password in a file
- get shortcode value
- Storing Options in a Shortcode
- How to remove html code in excel downloads using phpspreadsheet with wordpress plugins shortcode
- How to put JQuery/Ajax inside shortcode?
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- WordPress function not being called from jQuery method
- Nested shortcode functions accessing variable
- Some code in shortcode function being ignored
- How to Create a shortcode to this php function
- Redirect to another page using contact form 7? [closed]
- What is @Action in WordPress?
- Custom shortcode for displaying user based on a role parameter
- Return multiple values in a shortcode attribute
- Is there a way to convert shortcodes to html content?
- Shortcode not working – quotes seems strange
- Get all the URLs of the pages that uses a specific shortcode
- Add the_post_thumbnail_url to a shortcode in function.php
- Echo out element to another page.
- Adding a Tag Parameter / Filter to My Shortcode
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- How to get current cart values using WC_Shortcodes?
- get_post_meta shortcode returns empty field
- How do I use a plugin’s shortcode attribute value in another function?
- Why does my custom plugin only function correctly once per page?
- Hide content for specific users with id
- Why is my shortcode not working?
- Get Shortcode output to database for static post_content
- Query Shortcode from a multisite to appear on a different site?
- Find all strings between an enclosing shortcode
- Posting code inside the post instead of in the template file using shortcode
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Integrate Razorpay quick payments plugin with contact form7 plugin
- cURL External API request displays content above other content on page
- Subtract Using GravityWP Count Plugin
- How to get URL param for pagination in shortcode?
- qTranslate‑X is not translating all shortcodes
- Uncaught Error: Call to undefined function wp_generate_attachment_metadata() @ wp-cron
- Using require_once in a Plugin?
- Stackoverflow type of badge plugin giving warnings in WordPress 3.5
- Plugin.php: PHP Notice: Undefined offset: 0 in
- Add multiple attributes to product from php
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Plugin Development sqlite or WordPress’ database
- How to review WordPress website php version compatibility?
- WooCommerce get_price returning wrong price when used via ajax
- Open Post Thumbnail in New Child Theme File in WordPress
- WordPress on AWS with ELB
- How to access data in wordpress database externally using php
- Problem with PHP wordpress, Undefined index: in C:\xampp\htdocs\wordpress\wp-content\plugins\epoch\classes\core.php on line 190 [closed]
- After upgrade to php 7 plugin/them updates broke [closed]
- How to create a custom shortcode based on the layout?
- WordPress 4.8.1 php getting commented
- Displayed content disappears when adding attributes to shortcode
- How do I pass custom shortcode-extracted variables (taxonomy) into a query function for WordPress RoyalSlider?
- Use $variable from file1.php in file2.php (different file paths)
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- How to include a custom field in the woocommerce email?
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- Wierd site output [closed]
- Create “new pages” within the admin section of plugin
- How to properly replace the_content with the html in a php file?
- How to Add text value in Automatically in this conditions?
- Creating an array from form inputs before it is posted to the options database
- Get a value from a shortcode for another function
- Plugin which unlock free gift when you reach some amount in cart
- Problem with Date translation in WordPress
- How to assign a specific service to a specific provider based on location
- How can I create a secure file download in WordPress?
- 500 Internal server error wp_handle_upload_prefilter
- Can’t access 3rd party API, code works on local server but not on wordpress
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- Nested DIV’s across functions in PHP, do not seem to work
- How to insert image into the Settings Page of a Plugin?
- Paginated Comments “reply” does not work!
- get_option return incorrect values
- I created a custom form in HTML/CSS and now I need it to submit … should I create custom PHP or is there a plugin I can use?
- How to add a handler for a button in plugin?
- private functions in plugins
- Need to change contact email depending where user is from
- WP Customer Reviews call short code on another page [closed]
- Populate Woocommerce order notes with custom field value
- Woocommerce Product Add-ons – Auto-select first option
- Strict Standards: Non-static method in sidebar generator
- how to show selected options drop down menu values in attributes field in after saving post.php
- Can’t use updated variables in handle function
- Shortcode to do math with url variables
- Make plugin admin page visible to other roles
- Buffered output in chunks and shortcode – how do I achieve that?
- Is there any WordPress Plugin that provides video editing from front end side? [closed]
- How Create LastMod and Update Date Only on Taxonomy Category and Tags
- Accessing Correct Database to Create REST API Endpoint
- How do I replace a logo image that’s hard-coded into a plugin’s logo.php file?