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
- My Own layout in WooCommerce pages [closed]
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Placing raw HTML inside a WordPress shortcode
- Woocommerce – remove product from category
- 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
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Run a filter when a walker runs
- Removing unneccessary p-tags (Not every p)
- How do I display a user’s previous orders as a select box option on a product?
- How do you add customer capability after Woocommerce purchase?
- WooCommerce – Reset quantity input field when variation changes
- get current product name in functions.php
- Handling Body class based on Template
- Get_avatar filter?
- WooCommerce Related Products by Attribute
- Image as Sales Badge
- Automatically remove a canceled order in Woocommerce
- add_action shortcut?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Converting HTML Template to WordPress Theme
- 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 to store data from multiple forms using ajax and php
- How to control WordPress image metadata (using Imagick)?
- How do I add custom bulk actions to multiple custom post types?
- Add data attribute to each li in menu
- Show prices with tax in Woocommerce Mini Cart [closed]
- How can I apply_filters from inside a function?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- 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
- Removing “wpautop” (auto tags) only on certain pages?
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Print last modified date only on posts
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- WordPress Gravatar filter is removing my custom attributes
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- How can I get the values of my WordPress $wpdb query in Jquery?
- Unique icons next to each WordPress menu item
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Validation algorithm in checkout field
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- My new button is in the wrong place
- Add .htm extention to a custom taxonomy
- Redirect to another page using contact form 7? [closed]
- Alter required message using comment form api
- Noscript not working as it should in wordpress site
- Add item to top of menu using a filter in functions.php
- Override a function defined in wp-includes/comment-template.php
- Function returns text instead of html [closed]
- Widget back end radio button issue
- Filtering a function’ output for a new continued function
- How to remove coupon dropdown feature
- Custom woocommerce payment gateway – Form
- Discount in the specific product title using keyword ( Woocoommerce )
- Including user data in “new user notification email”
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- How to bind each “the_content” elements to a custom variables
- Adding product permalink on admin order page throwing error
- Add Product Permalink in woocommerce admin order page
- Reload page with a different shortcode when a user selects from a dropdown
- 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
- WordPress Ajax filter: Create two loops for different output styles?
- Woocommerce textarea format ignored
- How to auto-generate random numbers in username?
- Remove generated category and tag class names from woocommerce product & blog listings markup
- WP_Query To Display Product Of Brand On Taxonomy Page
- Woocommerce Add custom “Add to cart button” in single page with tags
- How can i style “echo apply_filters”
- How can I get my pagination loop to display the correct number of total pages?
- Get Billing Email from WooCommece Checkout and Pass to Fullstory JS
- Woocommerce custom attributes list help
- Custom Bulk Actions handler not firing
- WooCommerce multiple custom fields code
- How to generate customized filtered output for the gallery
- Add missing alt tag to featured images for “storefront” theme
- How to remove title tag with this filter
- Can’t get_users info by using json_encode
- Show post/page into div using function
- Display text of price (minus 20%) on every product page in a sentence.
- str_replace not preserving whitespace
- Can’t make product images clickable
- WooCommerce – Print Processing orders [closed]
- Use WP_Query Data In Cookie