If you give a look at the documentation, of str_replace you will find your needs. https://www.php.net/manual/en/function.str-replace.php
There is 3 choices for you there :
function replace_text_wps($text){
$replace = array(
'https://www.facebook.com/something">' => 'https://www.instagram.com/something">',
);
$text = str_replace(array_keys($replace), array_values($replace), $text);
// OR
$text = str_replace(array(
'https://www.facebook.com/something">'
), array(
'https://www.instagram.com/something">'
), $text);
// OR
$text = str_replace('https://www.facebook.com/something">', 'https://www.instagram.com/something">', $text);
return $text;
}
add_filter('the_content', 'replace_text_wps',99, 1);
Related Posts:
- Why have on every line
- WordPress and event-driven programming – what is it about?
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Display a selected custom product option in WooCommerce cart
- Custom post type column which compares dates?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Walker class: Problems with understanding how walk() method can be called without error
- Limit the Excerpt field in WP-Admin in words
- How to create different menu’s for not logged in visitors and for logged in members?
- Setting up the child theme so as to enable right-to-left WordPress?
- Custom Loop Pagination on WordPress
- delete an array element when its date expires
- Type hinting and void return question
- How to break down importing of feeds
- Wrap First Character after in a tag
- How do I implement a .diff changeset from core.trac.wordpress.org locally?
- Multiple choice in a custom taxonomy
- Random Default Avatar Function
- Customizer: Output default value in Customizer CSS
- How to add just one specific page to widget without plugin?
- Taxonomy linked to pages
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- WP dynamic featured image – Can’t get second featured image url
- Converting HTML Template to WordPress Theme
- Can I install/embed WordPress on a ‘single page’?
- How to check if a meta value has already been assigned to any user?
- How to hide products that do not have an image from a slider carousel for an ecommerce webpage?
- Send an email to specific adress when button is clicked?
- WordPress admin pointers tour bug?
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Custom posts in different columns style
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Advanced Custom Fields not displaying
- What exactly do this function declared into functions.php file of a WP theme?
- Exclude posts with specific metadata from search?
- Add data-id attribute to child page links
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- customize wordpress database error page
- Display Youtube Time Automate from Key
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- Where is the PHP code generating an element?
- Basic wpdb update question
- How to include custom PHP file both in header and footer files
- Check class_exists before class definition / Doxygen problem
- Extract links from content
- Integrating Yii2 and WordPress
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- Custom Registration username_exists / email_exists
- After disabling WPML multi currency, the currency is still handled by the WPML
- How do i wrap woocomerce attribute in list?
- PHP Helper Class to create shortcodes
- Reusable code that I can store in the function.php and apply to other templates as need. Dry Code
- Is it possible to add a custom page to a free WordPress site? [closed]
- Is there a hack for using is_page() within the function.php file?
- save metabox with new values _wp_page_template
- How to Fix an Archive.php That Displays All Posts?
- pagination broken – clicking next displays “page not found”
- Site DOES NOT LOAD after 3.1 update
- Create condition for Author bio Social Links
- Customizer control save then return to default
- WP-Bakery – Add custom colors to buttons with template colors
- Woocommerce template file outputting tags
- Trying to update Woocommerce meta values
- retrieve “Link Color” value
- If Statement is Ignored?
- Delete post meta by serialized meta value
- Dynamic Banner Text based on Subdomain
- Create “blank” admin page without having admin-bar/admin-menu for faster load
- Create Schema in WordPress with PHP
- Create form which redirects to site in network?
- Remove specific javascript when viewing page in Customizer?
- Search only for posts with specific metadata?
- How to associate dynamic PHP page for chosen WordPress tag?
- Only display notification on single post
- Is there a way to have chunks of a page’s content expire?
- Where can I find the declaration of `$_wp_theme_features`?
- Static home page ignored
- How do I routinely extract the thumbnail of the most recent post?
- Showing the project type in HREF
- Display tab title as ‘blog tagline | blog title’
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Showing custom field contents without listing description
- How to use PHP code with wordpress page
- Check if values exists DB
- if is_bbPress register jquery
- Auto create description in post
- Pagination on Custom Loop
- Widget header unique classes
- why is this content-template not showing any of my blog-entries?
- How to get the count for each taxonomy term
- error with WP custom form
- How can I clear the theme mod settings?
- MySQL Engine vs. Charset
- Save Option on Database
- Date when the custom field was added
- Select area and checkbox data is not saving?
- In reading settings posts are set to “blog” and I have page-blog.php but no posts
- WP Custom tables query
- Capture the Selected Radio Button Value between two files in wordpress theme
- Partial refresh in WordPress live preview