after_setup_theme
should not execute after the shortcodes process. Shortcodes process when the post body renders. after_setup_theme
runs well before that. Your analysis of the problem is incorrect.
This looks like a variable scope problem to me. None of the variables inside your custom_login
function are going to be accessible outside that function. Their “scope” is inside the function.
To solve this you need to declare your variables global
or wrap the whole thing in a class so that you can get to the variable using class syntax. Proof of concept:
class test_class {
static $test="hi";
public function change_var() {
static::$test="hello";
}
}
add_action('after_setup_theme','test_class::change_var');
There are other ways to do it.
Related Posts:
- Login form from shortcode doesn’t redirect after successful login
- Use another action instead of the shortcode API to display the last time a user logged in
- Modifying the wordpress login page and then referencing it with a shortcode problem
- How to create a custom shortcode for custom login form?
- Set redirect for need login
- i want to show a modal when user lands on home page very first time
- Redirect per shortcode if user is logged in
- Custom Login in Shortcode got error
- Custom shortcode being executed when saving page in wp-admin
- Change appearance of shortcode text inside editor
- Combining shortcode and get_template_part
- Escaping quotes from shortcode attributes
- Shortcode output always showing at top of page
- How to detect if a Shortcode is being called on a page?
- How to get current page title inside a page itself in a shortcode and in page content
- shortcode inside another shortcode
- Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [closed]
- Custom Shortcode AJAX 400 Bad Request
- WordPress gallery ‘post_gallery’ filter doesn’t work with feeds?
- shortcode to create dynamic dropdown box form shortcode attributes
- conditional shortcode not working
- Ajax not returning anything on form submit
- How do I add my own custom shortcodes?
- Can’t seem to get [shortcode]s to work
- Wraping $content into link with shortcodes
- nested Shortcode doesn’t work
- Slow page loading when using a simple shortcode on the same page multiple times
- TinyMCE get selected text and underlying HTML
- Remove and restore one shortcode
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- other shortcodes in Contact form 7 MAILS [closed]
- Remove empty p-Tags in Shortcode content before non p-Tags
- Using do_shortcode with variables?
- Using ACF field in do_shortcode()
- Display content from another site page using a shortcode
- Remove hyperlink on gallery shortcode
- Wrap shortcode inside custom block
- Combining similar shortcode functions?
- Creating a shortcode based on users preferences
- Get a post’s thumbnail url or display default image in shortcode
- basic shortcode – Why 1st paragraph not wrapped in p tag, but 2nd is
- unwanted P tags in shortcode, delay wpautop not working
- Convert HTML Script to Shortcode [closed]
- What is the Correct way to pass parameters in function
- Shortcode – Getting Categories appears on top of website
- How to Modify WordPress Default Image Gallery Shortcode
- Passing html tags as shortcode parameters
- Registration Form Shortcode
- Include tags in the body of a post
- Remove shortcodes that are different (but same pattern) in each post
- Place a URL parameter value inside a WordPress short code
- Print shortcode in defined area
- WordPress shortcodes are not working
- Conditionally Loading JavaScript/CSS for Shortcodes
- How to use/enable Pagination?
- Placing tags on wordpress visual editor using shortcodes
- Shortcode called twice
- Add JS in footer via shortcode?
- how can i pass this attribute in this shortcode?
- How to add a same div on every page
- WordPress Shortcode / Only works in classic editor, gutenberg error / invalid json response
- Display a form partially with a shortcode
- Do shortcode in template file
- Pass instance number to shortcode child
- Render shortcodes with get_post_custom
- Add shortcode within the_content()
- Shortcode strips formatting and returns at content top
- do_shortcode within a shortcode
- tiny_mce_before_init preventing custom shortcode icon appearing
- Custom Fields – Boolean Display of True/False to Yes/No
- Twitter bootstrap tabs
- Build Clickable Link Using Multiple Attributes
- Using Shorcodes in Sharing Preview and Notifications Title from Post Title
- Echo Extra Shortcode HTML to wp_foot
- Is the WP audio shortcode still relevant?
- If statement shortcode
- Shortcode not working when I output data from wpdb html table row
- update_metadata() appends shortcode data for every page refresh
- Gallery shortcode is empty but magically creates a gallery
- Display tags cloud from a specific category ID with a shortcode
- How to avoid one code multiple times instead do that through some function? Shortcode, but I think shortcode is not used in main theme’s core files?
- Shortcode appeared twice on page, one time before content, one time where it’s really called
- Add a shortcode in woo-function.php
- Get current category and place it in shortcode
- Woocommerce products shortcode specific order
- Modify Blog Module layout in Child theme
- Inserting a variable into a shortcode inside php
- Output html source tags inside shortcode
- How can I define the output of shortcode attribute value?
- Using shortcodes that wrap around code
- Shortcode for Admin Theme Option?
- Clarify: Enqueueing scripts within shortcode only loads in footer?
- What is the best way to include a template file within a shortcode?
- What makes a placeholder resizable in Tinymce?
- Shortcode templates
- Does anyone recognize shortcode ig_special_heading?
- How to scroll to a shortcode-generated anchor
- add post type pram to wp shortcode
- I have the query code but not the shortcode
- wordpress how to sort posts on custom data with plug-in “Search & Filter”