I would look into this question here https://stackoverflow.com/questions/36564293/extract-urls-from-a-string-using-php
You could use the above link detection to do something like this in your shortcode:
<?php
function pods_current_user($atts) {
extract(shortcode_atts(array(
'currUser' => get_current_user_id(),
), $atts));
extract(shortcode_atts(array(
'field' => "display_name",
), $atts));
$message = do_shortcode('[pods name="user" where="ID = '.$currUser.'"] {@'.$field.'}[/pods]');
preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $message, $match);
// Do something with your links via the $match array.
return $message;
}
add_shortcode('getShortCode', 'pods_current_user');
Related Posts:
- Get term siblings of current child taxonomy
- Can i use php sql functions instead of $wpdb?
- Why include a composer.json file with my plugin?
- Getting paginate_links() ‘end_size’ to display none
- What is the best practice for escaping data URIs?
- append PHP function to the_content
- Setting up the child theme so as to enable right-to-left WordPress?
- How to track a users progress through pages by inserting data into WordPress Database?
- How do I get content of custom post type through post ID in wordpress
- How to display blog images using wordpress in existing project
- Block PHP Files Nginx
- mysqli_real_connect() – authentication method unknown to the client Warnings
- how to increase custom post value by one most efficiently?
- WordPress File handle – fopen, fwrite not working with $.ajax or $.post Jquery
- Do I need to prepare query before get_results(), get_row() and get_var()?
- Woocommerce product download URL
- Multiple choice in a custom taxonomy
- Calculations in functions.php [closed]
- How does the ternary operator work in the wordpress loop post?
- How to create a linked tag list in my sidebar
- WordPress custom login form using Ajax
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- How to store post ID’s in cookie or session to display the same posts later
- Dynamic content in template
- register_taxonomy() take much queries
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- WooCommerce Tabs [closed]
- Limit checklist by the current user
- Adding Meta Tags to a Post using its Tags, Excerpt and content
- Embedding PHP in shortcode $content
- Conditional statement for dates
- Why does this update_post_meta function not delete the custom field itself?
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Location of core code for database connection and get_header
- Upload non-featured image to image field
- Change product_base programmatically
- Plugin development and composer
- WC_Customer delete function returns error
- Increment paged on WP_Query
- Woocommerce: remove total sum from new order’s email [closed]
- Trying to display text in a block in a plugin page
- Some menu items wont budge
- Removing “Powered by” footer using child theme PHP [closed]
- custom post type with role Vendor
- Store and Change Session variable – PHP SESSION VARIABLE
- Show site content based on user role
- Cannot load media and I get “PHP Warning: Invalid argument supplied for foreach(“
- Adding “redirect” to a button
- PHP Parse error on WP-CLI, not on web server
- Include a file that has a function in it
- Trying to split a query into sections of six
- Execute Jquery when a specific page in my plugin is loading
- making my own “related pages” / “pages you might like” section
- Modifying WP URL handing code?
- Show ranking based on post id
- Validating an email input from form field before submit using JQuery, AJAX, and PHP
- url not using query string no longer working
- How do I reopen the (Popup Maker) after entering the correct password for a password protected page?
- Display div if category has a specific parent
- Display metabox galleries on specific page template in admin editor
- I want it to detect the duplicate comment and give a warning on the same page
- Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]
- How to identify which php file a plugin is using on page load?
- dashboard widget form not submit mails
- How to switch between two primary menus (programatically0
- Why am I getting syntax error, unexpected ‘endwhile’ (T_ENDWHILE) on single.php
- How to show category just on specific pages?
- Used a code to revoke some dashboard menus for my contributors but for some reason it’s revoked me access to the editor [closed]
- If is_page elseif is_page not working like I want it to
- Shortcode just with a php code
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- I want show only data for today
- Make customizer panel or section button
- How can I customize a WordPress theme before it’s downloaded?
- Permalinks and custom PHP application
- Updating meta_value in a custom key
- Where to find the html for WordPress site? [closed]
- rewrite_rule – working fine but broken for pagination
- Custom post type single page return to listing page
- WordPress wp_remote_post() sending informaiton to Redmine REST API
- Missing items on page
- WordPress rewrite question
- Using Nonce for my Form
- Transient Loop Not working as expected
- WordPress blog set up
- How to declare a variable at the bottom of the page and use its value at the top?
- Shortcode working in page.php but not in category.php in wordpress
- Open all external links in new window – need help with the code
- How can a ‘scripts’ directory be hooked into wp_head();?
- HTML in PHP problem [closed]
- WP and Laravel integration (Updated) [closed]
- understanding wp_next_scheduled
- WordPress 6.1.1 UTF8 Slug Limit Increase
- WordPress directories not writable after PHP version upgrade
- How do I unset category from a product in wordpress by code
- php 8 compability admin interface
- How can I make below code to show grouping by country ranks in same div, example if in second loop rank 2nd must be show in same 2nd class div
- add_rewrite_rule image from /images/site2/favicon.ico to /favico.ico
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end