updated plugin GP Premium version 2.1.1

This commit is contained in:
2021-12-20 13:41:59 +00:00
committed by Gitium
parent 132b46b78f
commit d5dbb2bde7
86 changed files with 2903 additions and 455 deletions

View File

@ -31,7 +31,9 @@ add_action( 'customize_controls_enqueue_scripts', 'generate_premium_control_inli
* @since 1.4
*/
function generate_premium_control_inline_scripts() {
if ( function_exists( 'generate_typography_default_fonts' ) ) {
$is_using_dynamic_typography = function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography();
if ( function_exists( 'generate_typography_default_fonts' ) && ! $is_using_dynamic_typography ) {
$number_of_fonts = apply_filters( 'generate_number_of_fonts', 200 );
wp_localize_script( 'generatepress-pro-typography-customizer', 'gp_customize', array( 'nonce' => wp_create_nonce( 'gp_customize_nonce' ) ) );
@ -99,6 +101,24 @@ function generate_premium_control_inline_scripts() {
'gpControls',
$controls_a11y
);
wp_enqueue_script(
'generate-pro-customizer-controls',
GP_PREMIUM_DIR_URL . 'dist/customizer.js',
array( 'customize-controls', 'wp-i18n', 'wp-element', 'customize-base' ),
GP_PREMIUM_VERSION,
true
);
wp_localize_script(
'generate-pro-customizer-controls',
'gpCustomizerControls',
array(
'hasSecondaryNav' => generatepress_is_module_active( 'generate_package_secondary_nav', 'GENERATE_SECONDARY_NAV' ),
'hasMenuPlus' => generatepress_is_module_active( 'generate_package_menu_plus', 'GENERATE_MENU_PLUS' ),
'hasWooCommerce' => class_exists( 'WooCommerce' ) && generatepress_is_module_active( 'generate_package_woocommerce', 'GENERATE_WOOCOMMERCE' ),
)
);
}
add_action( 'customize_register', 'generate_premium_customizer_shortcut_controls', 100 );
@ -213,6 +233,34 @@ function generate_premium_customizer_shortcut_controls( $wp_customize ) {
)
)
);
$wp_customize->add_control(
new GeneratePress_Section_Shortcut_Control(
$wp_customize,
'generate_colors_shortcuts',
array(
'section' => 'generate_colors_section',
'element' => __( 'Colors', 'gp-premium' ),
'shortcuts' => array(),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
'priority' => 1,
)
)
);
$wp_customize->add_control(
new GeneratePress_Section_Shortcut_Control(
$wp_customize,
'generate_typography_shortcuts',
array(
'section' => 'generate_typography_section',
'element' => __( 'Typography', 'gp-premium' ),
'shortcuts' => array(),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
'priority' => 1,
)
)
);
}
add_action( 'customize_register', 'generate_premium_layout_block_element_messages', 1000 );