Skip to main content
deleted 2 characters in body
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Use a plugin for that. Hook into after_setup_theme and check if the current theme is the correct child theme:

add_action( 'after_setup_theme', 'common_child_theme_functions' );

function common_child_theme_functions()
{
    if ( ! 'Twenty Twelve' ===!== wp_get_theme()->parent() )
        return;

    // do your work
}

wp_get_theme() returns a WP_Theme instance, and parent() either the parent theme name or FALSE.

I do not recommend a mu-plugin. Real plugins can be deactivated, and you can enable or disable them for each site separately. Adjust the capabilities for the clients instead; this is a much cleaner approach.

Use a plugin for that. Hook into after_setup_theme and check if the current theme is the correct child theme:

add_action( 'after_setup_theme', 'common_child_theme_functions' );

function common_child_theme_functions()
{
    if ( ! 'Twenty Twelve' === wp_get_theme()->parent() )
        return;

    // do your work
}

wp_get_theme() returns a WP_Theme instance, and parent() either the parent theme name or FALSE.

I do not recommend a mu-plugin. Real plugins can be deactivated, and you can enable or disable them for each site separately. Adjust the capabilities for the clients instead; this is a much cleaner approach.

Use a plugin for that. Hook into after_setup_theme and check if the current theme is the correct child theme:

add_action( 'after_setup_theme', 'common_child_theme_functions' );

function common_child_theme_functions()
{
    if ( 'Twenty Twelve' !== wp_get_theme()->parent() )
        return;

    // do your work
}

wp_get_theme() returns a WP_Theme instance, and parent() either the parent theme name or FALSE.

I do not recommend a mu-plugin. Real plugins can be deactivated, and you can enable or disable them for each site separately. Adjust the capabilities for the clients instead; this is a much cleaner approach.

added 211 characters in body
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Use a plugin for that. Hook into after_setup_theme and check if the current theme is the correct child theme:

add_action( 'after_setup_theme', 'common_child_theme_functions' );

function common_child_theme_functions()
{
    if ( ! 'Twenty Twelve' === wp_get_theme()->parent() )
        return;

    // do your work
}

wp_get_theme() returns a WP_Theme instance, and parent() either the parent theme name or FALSE.

I do not recommend a mu-plugin. Real plugins can be deactivated, and you can enable or disable them for each site separately. Adjust the capabilities for the clients instead; this is a much cleaner approach.

Use a plugin for that. Hook into after_setup_theme and check if the current theme is the correct child theme:

add_action( 'after_setup_theme', 'common_child_theme_functions' );

function common_child_theme_functions()
{
    if ( ! 'Twenty Twelve' === wp_get_theme()->parent() )
        return;

    // do your work
}

wp_get_theme() returns a WP_Theme instance, and parent() either the parent theme name or FALSE.

Use a plugin for that. Hook into after_setup_theme and check if the current theme is the correct child theme:

add_action( 'after_setup_theme', 'common_child_theme_functions' );

function common_child_theme_functions()
{
    if ( ! 'Twenty Twelve' === wp_get_theme()->parent() )
        return;

    // do your work
}

wp_get_theme() returns a WP_Theme instance, and parent() either the parent theme name or FALSE.

I do not recommend a mu-plugin. Real plugins can be deactivated, and you can enable or disable them for each site separately. Adjust the capabilities for the clients instead; this is a much cleaner approach.

Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Use a plugin for that. Hook into after_setup_theme and check if the current theme is the correct child theme:

add_action( 'after_setup_theme', 'common_child_theme_functions' );

function common_child_theme_functions()
{
    if ( ! 'Twenty Twelve' === wp_get_theme()->parent() )
        return;

    // do your work
}

wp_get_theme() returns a WP_Theme instance, and parent() either the parent theme name or FALSE.