Remember that str_replace
looks for an exact match of the ‘needle’ (what you are searching for; ‘haystack’ is the thing you are searching inside). So your code is not finding an exact match.
If you want to do a ‘replace everything that might be within the span codes in that hunk of text’, then a regex statement might be in order. This is assuming that the ‘haystack’ you are searching is different each time. (Since I don’t read your language, can’t tell for sure.
But, assuming that $download['donload_name']
contains the start and stop span tag, and something in the middle, then try to do two str_replace commands: one for the <span>
and one for </span>
.
And that assumes that there aren’t any parameters to the <span>
. If there are, a regex might be better idea.
Related Posts:
- Add a class to the anchor tag on HTML5 gallery
- How to make modifications only to certain elements of an HTML string on the server-side?
- PHP function for horizontal Woocommerce thumbnails and badges
- Woocommerce Price Text
- Add text below WooCommerce short description if metabox value is true
- How do I change/modify the_post_thumbnail(); html output?
- start_lvl Ignored in Custom walker_nav_menu
- static variable loop not working in WordPress
- Set media upload attachment link to none and hide it in WP v3.5
- How to automatically apply woocommerce product title to all product images alt tags?
- Woocommerce auto cancel On-Hold after X days
- Check if page parent has certain template
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- Change comments form title on a page by page basis
- Remove class that has been added by parent theme
- WooCommerce – Customer Order History Pagination
- The values of custom fields are not available functions.php
- How do I know what variables are passed in a filter/action and what their meaning is?
- Woocommerce filter cart and category specific quantity [closed]
- Use is_product_category() properly
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Placing raw HTML inside a WordPress shortcode
- How to use return in my custom function instead of echo
- Slide in Panel WordPress Post
- Changing Woocommerce flat rate every nth number of items
- Shortcode content output but not in correct place
- Limiting woocommerce line_total decimal length
- Run a filter when a walker runs
- How do I display a user’s previous orders as a select box option on a product?
- Handling Body class based on Template
- Get_avatar filter?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- Two Different Links for Same Product – WooCommerce [closed]
- How do I add custom bulk actions to multiple custom post types?
- Show prices with tax in Woocommerce Mini Cart [closed]
- Use DOMDocument with ob_start breaks my HTML code
- Auto-update products after they were published – Woocommerce
- Display a specific category of products in shop page and disable code for specific actions
- Woocommerce related product text
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- WordPress Gravatar filter is removing my custom attributes
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Validation algorithm in checkout field
- Alter required message using comment form api
- Override a function defined in wp-includes/comment-template.php
- Widget back end radio button issue
- Filtering a function’ output for a new continued function
- How to remove coupon dropdown feature
- Deleting Certain terms from appearing on the front end as links
- Add html link in functions.php files of the theme
- Upload multiple files in randomly generated folder using wp_upload_bits
- Create page template via functions.php?
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- woocommerce specific quantities for product
- How to have different site identity logos on each page on Astra Theme [closed]
- Personalize checkout text
- CSS change in woo commerce Place Order Text [closed]
- WP All Import / Update stock quantity from multiple XML files
- Get the name of menu item with wp_nav_menu
- How to add aria role and schema markup to custom walker container
- Must filter functions receive all arguments passed to them?
- Custom Taxonomy Select Menu: Setting default option value?
- User filter posts by year
- Modify WooCommerce used to get all orders in dashboard
- Output product category link from WP_Query
- Time Delay a URL Redirect for Specific Page
- How to sort WooCommerce products page by latest in-stock items first?
- Variation prices breakdown only for single product page
- Woocommerce My acount page
- Adding HTML Code to Replace Text in PHP
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Hide payment method based on user role AND minimum cart value
- Best way to use variables in multiple functions?
- Use Search Term in html link and redirect
- Discount in the specific product title using keyword ( Woocoommerce )
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- Adding product permalink on admin order page throwing error
- Add Product Permalink in woocommerce admin order page
- How to center all text body in single.php at once?
- How to override WooCommerce Order Item Meta with data from Cart?
- sessionStorage saves input value in browser but it is not loaded in the form field
- How can i style “echo apply_filters”
- How can I get my pagination loop to display the correct number of total pages?
- How to generate customized filtered output for the gallery
- Show post/page into div using function
- Display text of price (minus 20%) on every product page in a sentence.
- Use WP_Query Data In Cookie
- How to add custom checkout field in user details mail template
- AJAX: WordPress filters inside $html do not work as intended
- Setting WooCommerce currency programmatically
- Assign new post author IF another user in custom field on post transition
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- posts_clauses drop ACF get_field function
- How to create a container in php then customise it in CSS
- How to add different menu items on different menus?
- How call WordPress shortcode inside function file
- strict custom php script on specific product category [closed]