I recommend switching to a code editor with PHP syntax highlighting, such as PHPStorm/Sublime/Atom/etc, which would reveal the problem on this line of code, as shown in the highlighting on your question once the code block is formatted:
$url="https://myurl.com/user/‘.$username;
The closing quote, is actually an apostrophe ‘
not "
. As a result the closing quote is actually just before template_redirect
Related Posts:
- What is wrong with my rewrite rule for a page URL with query parameters and short codes?
- WordPress plugin shortcode not working
- How do I create a Shortcode that returns text if domain is .com, not .co.uk
- Remove specific shortcode from get_the_content()
- How to Output HTML tags in do_shortcode?
- Nested Shortcode Detection
- How to display html in a shortcode
- Custom form, shortcode, and submit handler
- Automatically add this attribute to the gallery shortcode
- Videos via the video shortcode are always 640px wide?
- Custom Shortcode and Button not Working after 3.9 update
- Hide Default Video Shortcode Controls on PageLoad
- shortcode not working [closed]
- Do not show child pages of child pages
- How to: How do I make my own shortcodes without plugins?
- Adding span tags within wp_list_pages list items
- Change font-size within a shortcode
- How can I show the Jetpack Subscriptions form in a page? [closed]
- How to make shortcode output display where I choose
- Add Shortcode to a Div or Header [closed]
- change wordpress gallery shortcode to slider
- How to change the page break numbering?
- Allow shortcode in the author bio textarea
- WordPress display image link in shortcode
- How do I combine my shortcodes?
- Bulk converting shortcodes to blocks with embeds
- How to add source code into wordpress post really?
- shortcode_atts – one URL variable not working
- stop shortcode stripping in category and archive pages
- Make shortcode’s Bootstrap CSS override the theme’s CSS, how?
- Enumeration Contact form using database table’s numbe of rows [closed]
- Change the default video shortcode
- How to use shortcode in js url
- How to add AJAX in a custom PHP function using Google sheets API
- Shortcode to show current post category with link
- How to register a user via modal after clicking a link in the shortcode?
- WordPress TinyMCE : Get value of popup button
- Freeze a shortcode in place?
- wp_editor in thickbox
- Complex Slider Shortcode Help
- Using _e() on text inside video tags prints that text, instead of only showing when html5 element is not supported
- Youtube shortcode
- WordPress messes up with data attributes in shortcode output
- Shortcode will not pass attribute through to my function [duplicate]
- WordPress post pagination continuous [duplicate]
- custom field value as shortcode parameter
- How to edit blog page in wordpress? there is no place to put shortcode
- How to transform WordPress user role code to WP shortcode?
- Slow page Loads When Using Dynamic Coding
- Can I use shortcodes in mail body
- Does short-code slow down my WordPress site?
- Query to list all galleries under a parent post?
- Beginner’s question about shortcodes
- How can I insert a shortcode in the title tag of another?
- How to execute a shortcode outside the post content/entry in a theme?
- Metabox Keeps Stripping Parts of Shortcode
- Shortcode from admin textarea to page
- Form processing: How to process form before output and access data from shortcode
- How to Retrieve data of Gallery Shortcode and display it above a post
- Checking post content for a shortcode, but content is being returned as empty
- Wrap php in shortcode
- Adding my own custom woocommerce shortcode to child theme, how?
- contact form 7 :create shortcode usable in email message [closed]
- Better way to display multiple plugin output on the same page?
- get_queried_object_id / short code returning blank
- Shortcode won’t take into account custom post ID put in parameter
- Colon is Missing In My Website Url in WordPress Shortcode
- How to utilise multiple values from a single shortcode attribute?
- JavaScript missing from shortcode content
- Multiple shortcodes with embedded JavaScript code in same page, how?
- Add a url parameter to the current post and read it in a shortcode
- wp_link_pages shortcode for ‘nextpagelink’
- WordPress keeps automatically inserts
- Function in a wordpress shortcode
- nested shortcodes from different plugins. too complex? [duplicate]
- Use Shortcode on Custom Page
- WordPress Database Error using $wpdb->get_results()
- How to make shortcode enabled in JSON Feeds?
- How to add a shortcode to an HTML image tag
- Shortcode or Template Page
- Ajax callback and shortcode functionality
- Why can’t I type [ ] opening and closing brackets on the Visual tab?
- Shortcode for External HTML
- How to implement theme shortcodes in text outside of pages?
- Shortcode with multiple variables
- Shortcode Attribute
- Can’t get default values to work with custom shortcode
- Question about do_shortcode
- How create a shortcode with html
- Adding shortcode [closed]
- do_shortcode autommatic content generation
- Enclosing shortcodes create line breaks
- Add the results of a custom query into a do_shortcode
- Using $variable in shortcode
- Hook into existing shortcodes to manipulate the attributes?
- How can I hide the ACF shortcode when empty
- How to pass text input data to shortcode
- Using variable as shortcode parameter
- How to handle Ajax Calls, when using same shortcodes (with different parameters, e.g. ‘post-type’)?
- conditional shortcodes