It’s not really a WordPress related question, but it’s a simple one. The tribe_get_event_website_link()
function you are using outputs a full link. You can use SimpleXML to extract the href
part and then use it later. It’s as simple as this:
$website = tribe_get_event_website_link();
$xml = new SimpleXMLElement( $website );
echo '<a href="' . $xml['href']. '">REGISTER</a>';
If you are unable to store the functions value inside a variable (for example, if the function echos it), you can use ob_get_clean()
:
ob_start();
tribe_get_event_website_link();
$website = ob_get_clean();
Now proceed with extracting the href
as mentioned above.
Related Posts:
- Modern Tribe Calendar wp-query with meta query not working at all
- Sorting dynamic select/dropdown for Contact Form 7 of Modern Tribe Events posts
- Only show posts from the last trailing 12 months
- What is the best php version to use with WordPress?
- Custom plugin: Trying to show saved data on frontend
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Where should I install a PHP library into WordPress so that code in a webpage can activate it?
- Does the debug.log do log rotation?
- How to make WordPress plugin check for database changes and then do something?
- ob_get_clean returns empty string, ob_get_flush outputs string
- Edit postmeta when user changes user role?
- Pagenavi pagination via wp-query in functions.php showing same content for each page
- Looping through WP_Post Object
- wp_get_attachment_url filter won’t accept two arguments
- Translating add to cart woocommerce button [closed]
- nowplaying.include.php Will Not Display Results
- Am I not understanding plugins?
- Passing the page ID to a login php script
- Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)
- SetCookie simply not working
- wrong php date()?
- Looking for most performant way to execute several similar WP queries within shortcodes
- Vagrantpress + composer
- Customize Time Stamp
- Combine two filters into a single call
- The text box have space character
- How to output widget
- Recent posts with featured image or fallback image with permalink
- get_avatar won’t show uploaded avatar, only default gravatar
- How can I fix WordPress installation errors?
- Two Different Links for Same Product – WooCommerce [closed]
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Display menu point only if there are published posts in that category
- What query string parameter is available for index.php, that works for both pages and blog articles?
- Sending data from custom inputs in WordPress comment form in the admin notification email
- export a csv file from the database with a cronjob
- How to set a min number of words for a blog post
- How to show all pages in blog navigation?
- Access Child Class of Plugin Main Class Instance
- Modify custom field input data before creating a new post
- Multiple do_shortcode in page template
- Ajax contact form return 0
- Get my site session in wordpress?
- Change order of custom submenu link in WP Admin?
- Register a menu – Error Header
- Update postmeta after theme switch
- Include style.css in the Child Theme with PHP
- Get user custom field value on function.php
- Add New Text Box To WordPress Twenty Seventeen Header
- WordPress homepage setup not working on first load
- Get the id of all images in a post
- Choose either excerpt or the_content
- Removed jQuery script from header.php , any problems?
- Dynamically display font icons in widget
- Setting a default thumbnail url if no thumbnail
- Dynamically Generate Functions and Hooks
- conditional: if is page, and all subpages
- Covert WordPress Blogname into JQuery
- how to add datas in taxonomy to post with wp_insert_post
- Need help for some PHP code
- Remove an action created by a Gravity Forms add-on
- Displaying the Archive Page’s Name on the Page
- Adding HTML Code to Replace Text in PHP
- How to secure my php forms
- Ajax search box displays nothing if taxonomy doesn’t exist
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- Posts missing on author page
- Add a custom link to each image in WordPress gallery
- cURL needing to loop through all “next_page”
- How do I make the following articles collapse within the month?
- Collapsible menu on post sidebar only expands and does not collapse
- How can I get my pagination loop to display the correct number of total pages?
- Notice : Array to string conversion on array_intersect user meta
- Get posts by id using shortcode
- Is it possible to replace ‘attachment’ with another word?
- Hide price excluding tax when price is empty
- Getting a value from a custom field from a page that shares a parent with the current page
- wordpress, Category ID
- PHP get_category() function redeclared
- How to trim content AND retain HTML?
- Adding users to another blog
- Adding a “Word” in php code
- WordPress – registering sidebar and adding a button directly after .textwidget
- Save data of select list after clicking save
- Arrange Category post manually when displayed
- How to change links in the 3 main categories, on widget category, to a javascript function call
- Where can I find the code for the menu page meta boxes?
- WordPress adding in site URL to header links
- Error on Include php:/usr/share/pear
- PHP-Code inside Href-Tag
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Pagination in category.php not functioning
- How to handle parent and child pages?
- Wrapping the_content() in Schema articleBody tag? [closed]
- How to create a container in php then customise it in CSS
- How to add Paragraph Tags in WordPress using Visual Composer?
- PHP – Multiple variables in insert post array
- advanced custom fields: repeater field within conditional statement [closed]
- Search custom post type posts only by meta fields?