Skip to content

Function

Enqueue admin scripts.

tml_admin_enqueue_style_and_scripts( )

Source

function tml_admin_enqueue_style_and_scripts() {
    $suffix = SCRIPT_DEBUG ? '' : '.min';

    wp_enqueue_style( 'theme-my-login-admin', THEME_MY_LOGIN_URL . "admin/assets/styles/theme-my-login-admin$suffix.css", array(), THEME_MY_LOGIN_VERSION );

    wp_enqueue_script( 'theme-my-login-admin', THEME_MY_LOGIN_URL . "admin/assets/scripts/theme-my-login-admin$suffix.js", array( 'jquery', 'postbox' ), THEME_MY_LOGIN_VERSION, true );
    wp_localize_script(
        'theme-my-login-admin',
        'tmlAdmin',
        array(
            'ajaxUrl'         => admin_url( 'admin-ajax.php' ),
            'interimLoginUrl' => site_url(
                add_query_arg(
                    array(
                        'interim-login' => 1,
                        'wp_lang'       => get_user_locale(),
                    ),
                    'wp-login.php'
                ),
                'login'
            ),
        )
    );
}

Uses

Changelog

VersionDescription
7.0 Introduced.