4 replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
source | link

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme and also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

Examples:

add_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Update:

Actually I just found this questionthis question, which is very similar.

Also, here's a similar question I asked herequestion I asked here which I was able to figure out using add_theme_support in a plugin... however, it doesn't work 100% of the time.

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme and also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

Examples:

add_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Update:

Actually I just found this question, which is very similar.

Also, here's a similar question I asked here which I was able to figure out using add_theme_support in a plugin... however, it doesn't work 100% of the time.

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme and also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

Examples:

add_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Update:

Actually I just found this question, which is very similar.

Also, here's a similar question I asked here which I was able to figure out using add_theme_support in a plugin... however, it doesn't work 100% of the time.

3 added 212 characters in body
source | link

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme and also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

Examples:

add_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Update:

Actually I just found this question, which is very similar.

Also, here's a similar question I asked here which I was able to figure out using add_theme_support in a plugin... however, it doesn't work 100% of the time.

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme and also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

Examples:

add_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Update:

Actually I just found this question, which is very similar.

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme and also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

Examples:

add_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Update:

Actually I just found this question, which is very similar.

Also, here's a similar question I asked here which I was able to figure out using add_theme_support in a plugin... however, it doesn't work 100% of the time.

2 added 397 characters in body
source | link

How to add theme support features ... current_theme_supports?

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme orand also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

I'm guessing Examples:

after_setup_themeadd_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');:

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Is that right?Update:

Actually I just found this question, which is very similar.

How to add theme support features ... current_theme_supports?

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme or plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature run?

I'm guessing after_setup_theme:

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Is that right?

How to add theme support?

I figured this would have been a question already, but I haven't come across it.

I'm wondering what the correct hook for checking theme support is in a theme and also a plugin.

function my_theme_or_plugin_add_theme_support_feature()
    if (current_theme_supports( $feature )) {
        add_action( $hook, $function_to_add, $priority, $accepted_args );            
        add_filter( $tag, $function_to_add, $priority, $accepted_args );
    }
}
add_action( $hook, 'my_theme_or_plugin_add_theme_support_feature');

So in the above example when/where should the my_theme_or_plugin_add_theme_support_feature check, run in themes and plugins and is it necessary? Is it the same for both?

Examples:

add_action( 'wp_loaded', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'init', 'my_theme_or_plugin_add_theme_support_feature');

add_action( 'after_setup_theme', 'my_theme_or_plugin_add_theme_support_feature');

Update:

Actually I just found this question, which is very similar.

1
source | link