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
- How to manually fix the WordPress gallery code using PHP in functions.php?
- Return HTML Template Page with PHP Function
- Encode text string being appended as query to URL [closed]
- How can i remove all html tags from get_the_content()?
- How do I use Shortcodes inside of HTML tags?
- Is there a way to parse shortcodes in PHP?
- Shortcode to insert
- Shortcode putting html such as
- Display sorting options dropdown when using WooCommerce product category shortcode
- Retrieve multiple values passed to a single attribute in a shortcode
- WordPress Shortcode and Dynamic CSS
- ob_get_clean returns empty string, ob_get_flush outputs string
- Display a text message if the shortcode is not found?
- Export User Info to CSV from Front End
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Shortcode created to check language not works
- How to return a string that has a variable inside in a shortcode?
- Run shortcode at certain resolution
- Using Echo in ShortCode – Stuck
- Passing a shortcode attribute to a sub-function
- Changing the HTML Of the content
- How to create shortcodes that pull custom field data from general settings
- post meta value as shortcode parameter
- append PHP function to the_content
- How to protect own PHP code from WordPress updates
- Add/echo div with Analytics-Code to function in functions.php
- Creating a WordPress shortcode
- Multiple do_shortcode($content) within one shortcode
- Adding Image Count to Multigallery
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- Get list of shortcodes from content
- Audio tags around Mp3 URL in content
- How do I hardcode a WordPress shortcode into my theme?
- Loading page template into shortcode
- My shortcode is showing up twice
- How to add Shortcode (font awesome) in widget title?
- has_shortcode() – how to detect nested shortcode
- WordPress Wysiwyg Content not being displayed
- How to return multiples lines in a shortcode?
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How can I default to all WordPress roles when parameter is not included in shortcode?
- WordPress menu deletes when trying to add a hook
- PHP contact form returns warning in text widget [closed]
- How to find the output of contact form 7 shortcode? [closed]
- Extremely slow pageload for long post when using the_content?
- Wrap each shortcode in array to div
- How do i get (unique) page name?
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Recent post display using shortcode
- Browser title script ignoring is_page /else conditional [closed]
- How do I turn a shortcode into PHP code?
- Nested shortCode functions in the functions.php file
- Placing the_content inside shortcode not working
- Put php variable in shortcode
- Output 2 items within the Loop
- get_page_by_title with an apostrophe in variable
- Wrap First Character after in a tag
- Need to turn this php into WP shortcode
- Making Quote Plugin more efficient
- Autogenerate shortcodes from an array of strings
- How to limit the content coming from wordpress shortcodes?
- How to return a foreach inside a shortcode
- Placing raw HTML inside a WordPress shortcode
- How do I add text in a shortcode?
- How to Insert Shortcodes into Theme?
- How can I get content inside one shortcode to another shortcode?
- Template part inside shortcode, unexpected reult
- Shortcode Inside Class Not Working
- custom shortcode will not display the wrapped content
- Shortcode content output but not in correct place
- How to call function at the bottom of post using plugin?
- is_page “range” for if statement?
- How can I generate random numbers inside my shortcodes on each implementation?
- PHP code inside shortcodes
- Use WP_Query in shortcode
- Shortcode API: How to get name that matched shortcode RegEx?
- Shortcode content filter?
- Create shortcodes within foreach loop (using array)
- Custom Theme, Custom shortcode not working
- Trigger popup in a php if/else statement
- Append HTML Using Shortcode
- Why is file_get_contents returning page source?
- Plugin CSS not enqueing
- Output Buffering – Everything between wp_head and wp_print_footer_scripts?
- How do I Add HTML to the_excerpt() & the_content() Output?
- Different loop output every x posts in custom post type
- How to output a PHP file values by shortcode?
- Showing a different gallery in a seperate post
- How to display posts by current user in a drop down
- Create own WordPress shortcode gallery
- Get value from shortcode to do something
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode