Call a function with href

You can echo the return value of a function: <a href=”https://wordpress.stackexchange.com/questions/102196/<?php echo plugin_function(); ?>”> But without seeing the actual function, there is no way to give a more specific answer.

Using add action for class with construct

above code does not works for me, is not correct or any mistake from my side? And it didn’t work for me either. Because it throws this fatal error: PHP Fatal error: No code may exist outside of namespace {} in … And that’s because the PHP manual says: No PHP code may exist outside … Read more

admin_post hook not working

You’re missing a ‘ in your code and your function name is different. function my_maybe_add_redirect( $entry, $form ) { wp_redirect( ‘https://www.google.com/’, 301 ); exit(); } add_action( ‘admin_post_submit_images’, ‘my_maybe_add_redirect’, 10, 2 );

Where can I find the “add_action()” inside a theme?

There can be a case that theme implements hooks via do_action(“action_name”) but it’s not forced to bind actual actions to it, as theme’s developers might just did it to make theme more extensible, and in fact never use it inside theme. So you can just bind your own code via add_action(“colormag_before”, “your_function_name”) in a child … Read more

What is the first action or filter executed by wordpress?

Here is nicely described what and when is loading and why. I recommend also this awesome plugin Query Monitor that helped me also to fix performance issues. in short: muplugins_loaded registered_taxonomy registered_post_type plugins_loaded sanitize_comment_cookies setup_theme unload_textdomain load_textdomain after_setup_theme auth_cookie_malformed auth_cookie_valid set_current_user init widgets_init register_sidebar wp_register_sidebar_widget wp_loaded parse_request send_headers parse_tax_query parse_query pre_get_posts posts_selection wp template_redirect wp_default_scripts … Read more