As indicated in the comments this code has nothing to do with shortcodes in the WordPress sense, but it is easy to see why it will never evaluate more than one pattern.
preg_match
returns true if there is at least one instance of the needle found in the haystack. So, no matter how many “shortcodes” it finds, PHP will only execute the following code once, replacing one string with the other.
Related Posts:
- Showing content from one page on another
- Get URL from shortcode tag
- Create a WordPress shortcode using PHP [duplicate]
- Including Custom fields within the_content
- How to Create custom block for displaying information in content section which act like shortcode
- Shortcode to insert
- Shortcode putting html such as
- How to return a string that has a variable inside in a shortcode?
- Using Echo in ShortCode – Stuck
- Changing the HTML Of the content
- Multiple do_shortcode($content) within one shortcode
- Adding Image Count to Multigallery
- My shortcode is showing up twice
- WordPress Wysiwyg Content not being displayed
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- WordPress menu deletes when trying to add a hook
- How to find the output of contact form 7 shortcode? [closed]
- How do i get (unique) page name?
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Browser title script ignoring is_page /else conditional [closed]
- Nested shortCode functions in the functions.php file
- Output 2 items within the Loop
- get_page_by_title with an apostrophe in variable
- Making Quote Plugin more efficient
- How to limit the content coming from wordpress shortcodes?
- How can I get content inside one shortcode to another shortcode?
- is_page “range” for if statement?
- How can I generate random numbers inside my shortcodes on each implementation?
- Use WP_Query in shortcode
- Create shortcodes within foreach loop (using array)
- Different loop output every x posts in custom post type
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- How can I dynamically update the class in my shortcode?
- Creating own shortcode – echoeing php variable based on JS variable
- How create a Shortcode with hover and complex options
- Remove from shortcode
- How to Reference/Echo Variable from Another PHP Function
- Replace shortcode in substring
- How to debug this search & replace strings snippet?
- Getting content from a referenced post
- Returning data instead of echoing/printing
- displaying content that includes shortcodes within an echo
- List taxonomy term slugs within shortcode (do_shortcode)
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- Display Data in Table from External Database in WP using Shortcodes
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- Capitalize Shortcode Value on Output
- Why is my str_replace not working on short code submitted by front-end?
- Shortcode not staying inside div tag
- Shortcode to pull posts
- PHP code inside Shortcode
- Help Fallback (thumbnail)
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- Shortcode function doesnt work without caption
- Action Hook Inside WordPress Plugin Shortcode
- How can I include the user id inside of a shortcode php output?
- PHP Helper Class to create shortcodes
- WordPress the_content Page Load
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Change Spaces to Dashes?
- Updating Metadata with Shortcode
- using shortcodes inside gravity forms
- Display logged in user name and lastname on page
- Give ID to divs inside the loop
- Replace background image with post thumbnail in shortcode
- couldnt show short code atts in category
- Conditional formatting on data fetched from MYSQL
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Advanced Custom Forms PHP formatting for do_shortcode
- How to use Contact Form 7 shortcode value in a page?
- Replace an array (with identical values) with another array in the_content
- Display current user metadata on WordPress page
- Add Shortcode to ::before class
- Reload page with a different shortcode when a user selects from a dropdown
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Shortcode’s output to use as other shortcode’s parameter
- Show products per shortcode
- Open/closed function [closed]
- Need to Echo A Url path to show on a wordpress page
- Add two or multiple functions in WordPress Post or Page
- Shortcode Works for Logged in Users but Not Working for Guest
- perform mathematical operation on shortcode
- Update same content in multiple posts at once?
- problem multisite with blog id
- How to pass parameter that ends up being part of a class name with wordpress shortcode
- Create dynamic content from one WP page to multiple other pages
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- Do_shortcode on PHP file outside theme ALMOST works
- Overwriting a Shortcode
- Custom Shortcode with Dynamic Button
- Whats wrong with my code? Need To add String to shortcode? [closed]
- A next page function with shortcode?
- Excerpt all post content Content Same Size without word cutting off
- using a shortcode in a hyperlink
- Shortcode for Visual Composer Grid fails turning string to integer
- HTTP 500 Error after Creating Shortcode
- How to edit a widget code?