felixarntz/theme-boilerplate

View on GitHub
assets/src/js/customize/get-customize-action.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * File get-customize-action.js.
 *
 * Function to get the Customize action for a given panel.
 */

export default ( panel ) => {
    const { __, sprintf } = window.wp.i18n;
    const panelInstance   = panel && panel.length ? window.wp.customize.panel.instance( panel ) : undefined;

    if ( panelInstance ) {
        return sprintf( __( 'Customizing ▸ %s', 'super-awesome-theme' ), panelInstance.params.title );
    }

    return __( 'Customizing', 'super-awesome-theme' );
};