Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9198067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:12:10+00:00 2026-06-17T22:12:10+00:00

In WordPress, this is done: add_action( ‘after_setup_theme’, ‘theme_setup’ ); function theme_setup() { … }

  • 0

In WordPress, this is done:

add_action( 'after_setup_theme', 'theme_setup' );
function theme_setup() {
  ...
}

How does WordPress access the function theme_setup() given the string theme_setup?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:12:10+00:00Added an answer on June 17, 2026 at 10:12 pm

    Firstly, the function add_action is called with all the parameters. Code of this function is listed below. This function in not interesting, it is just a wrapper for add_filter function, which is more interesting.

    function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
        return add_filter($tag, $function_to_add, $priority, $accepted_args);
    }
    

    Function add_filter saves the data provided to a function to a global variable. Code is follows:

    function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
        global $wp_filter, $merged_filters;
    
        $idx = _wp_filter_build_unique_id($tag, $function_to_add, $priority);
        $wp_filter[$tag][$priority][$idx] = array('function' => $function_to_add, 'accepted_args' => $accepted_args);
        unset( $merged_filters[ $tag ] );
        return true;
    }
    

    Now you have everything you need saved in global variable and you can start to call function names from function do_action, which is pretty long. But the most interesting part is on it’s end:

    call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));
    

    Function call_user_func_array is the magic. You can read more about it in PHP manual

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this code from the wordpress <head profile=http://gmpg.org/xfn/11> What does this means? what
On WordPress how can I get this done? Limit wp query to list posts
Im working with wordpress and this function im using returns this or something that
I recently made this wordpress blog, where you can sign up a team for
Trying to mess with this wordpress theme and can't figure out why the sidebar
Disclaimer: not sure this is WordPress related or not. I'm following a simple tutorial
I have a table like this (using wordpress) +---------+----------+------------+ | meta_id | meta_key |
http://demo.thethemefoundry.com/traction/#post-183 Which wordpress plugin is this, to have post image on the left side
This deals with WordPress plugin development. Even if a user has not actually signed
I have this .htaccess file in WordPress. It's located at /public_html/ (web root). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.