updated plugin GP Premium version 1.11.2

This commit is contained in:
2020-08-13 14:53:39 +00:00
committed by Gitium
parent 3f0f8d3ac9
commit 885bbdd113
151 changed files with 11329 additions and 6954 deletions

View File

@ -153,7 +153,7 @@ if ( ! function_exists( 'generate_super_package_addons' ) ) {
</div>
<div class="addon-action addon-addon-action" style="text-align:right;">
<?php wp_nonce_field( $v . '_deactivate_nonce', $v . '_deactivate_nonce' ); ?>
<input type="submit" name="<?php echo $v;?>_deactivate_package" value="<?php _e( 'Deactivate' );?>"/>
<input type="submit" name="<?php echo $v;?>_deactivate_package" value="<?php _e( 'Deactivate', 'gp-premium' );?>"/>
</div>
</div>
<?php } else {
@ -173,7 +173,7 @@ if ( ! function_exists( 'generate_super_package_addons' ) ) {
<?php _e( 'WooCommerce not activated.','gp-premium' ); ?>
<?php } else { ?>
<?php wp_nonce_field( $v . '_activate_nonce', $v . '_activate_nonce' ); ?>
<input type="submit" name="<?php echo $v;?>_activate_package" value="<?php _e( 'Activate' );?>"/>
<input type="submit" name="<?php echo $v;?>_activate_package" value="<?php _e( 'Activate', 'gp-premium' );?>"/>
<?php } ?>
</div>

View File

@ -56,8 +56,6 @@ input#generate-select-all,
.premium-addons .add-on.gp-clear {
padding: 15px !important;
margin: 0 !important;
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
}
@ -89,8 +87,6 @@ input#generate-select-all,
padding: 0;
font-size: inherit;
cursor: pointer;
-moz-box-shadow: 0 0 0 transparent;
-webkit-box-shadow: 0 0 0 transparent;
box-shadow: 0 0 0 transparent;
}
@ -101,8 +97,6 @@ input#generate-select-all,
color: #0f92e5;
padding: 0;
font-size: inherit;
-moz-box-shadow: 0 0 0 transparent;
-webkit-box-shadow: 0 0 0 transparent;
box-shadow: 0 0 0 transparent;
}

View File

@ -365,6 +365,25 @@ if ( ! function_exists( 'generate_slideout_navigation_classes' ) ) {
}
}
if ( ! function_exists( 'generate_menu_plus_init' ) ) {
function generate_menu_plus_init() {
load_plugin_textdomain( 'menu-plus', false, 'gp-premium/langs/menu-plus/' );
}
}
if ( ! function_exists( 'generate_slideout_menu_fallback' ) ) {
/**
* Menu fallback.
*
* @param array $args
* @return string
* @since 1.1.4
*/
function generate_slideout_menu_fallback( $args ) {
}
}
/**
* Page header module.
*/
@ -436,6 +455,12 @@ if ( ! function_exists( 'generate_page_header_single' ) ) {
}
}
if ( ! function_exists( 'generate_page_header_init' ) ) {
function generate_page_header_init() {
load_plugin_textdomain( 'page-header', false, 'gp-premium/langs/page-header/' );
}
}
/**
* Secondary Navigation module.
*/
@ -661,3 +686,19 @@ function generate_menu_plus_make_css() {
function generate_menu_plus_enqueue_dynamic_css() {
// No longer needed.
}
if ( ! function_exists( 'generate_hidden_secondary_navigation' ) && function_exists( 'is_customize_preview' ) ) {
/**
* Adds a hidden navigation if no navigation is set
* This allows us to use postMessage to position the navigation when it doesn't exist
*/
function generate_hidden_secondary_navigation() {
if ( is_customize_preview() && function_exists( 'generate_secondary_navigation_position' ) ) {
?>
<div style="display:none;">
<?php generate_secondary_navigation_position(); ?>
</div>
<?php
}
}
}

View File

@ -1,8 +1,20 @@
<?php
/**
* This file handles general functions in the plugin.
*
* @package GP Premium
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // No direct access, please.
}
/**
* Get the requested media query.
*
* @since 1.9.0
* @param string $name Name of the media query.
*/
function generate_premium_get_media_query( $name ) {
if ( function_exists( 'generate_get_media_query' ) ) {
return generate_get_media_query( $name );
@ -14,12 +26,34 @@ function generate_premium_get_media_query( $name ) {
$mobile = apply_filters( 'generate_mobile_media_query', '(max-width:768px)' );
$mobile_menu = apply_filters( 'generate_mobile_menu_media_query', $mobile );
$queries = apply_filters( 'generate_media_queries', array(
'desktop' => $desktop,
'tablet' => $tablet,
'mobile' => $mobile,
'mobile-menu' => $mobile_menu,
) );
$queries = apply_filters(
'generate_media_queries',
array(
'desktop' => $desktop,
'tablet' => $tablet,
'mobile' => $mobile,
'mobile-menu' => $mobile_menu,
)
);
return $queries[ $name ];
}
}
/**
* Get our CSS print method.
*
* @since 1.11.0
*/
function generate_get_css_print_method() {
$mode = apply_filters( 'generatepress_dynamic_css_print_method', 'inline' );
if ( ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) || is_preview() ) {
return 'inline';
}
if ( ! defined( 'GENERATE_VERSION' ) ) {
return 'inline';
}
return $mode;
}

View File

@ -1,15 +1,25 @@
<?php
defined( 'WPINC' ) or die;
/**
* This file handles resetting of options.
*
* @package GP Premium
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // No direct access, please.
}
add_action( 'generate_admin_right_panel', 'generate_premium_reset_metabox', 25 );
/**
* Add the reset options to the Dashboard.
*/
function generate_premium_reset_metabox() {
?>
<div class="postbox generate-metabox" id="generate-reset">
<h3 class="hndle"><?php _e( 'Reset Settings', 'gp-premium' );?></h3>
<h3 class="hndle"><?php esc_html_e( 'Reset Settings', 'gp-premium' ); ?></h3>
<div class="inside">
<form method="post">
<span class="show-advanced"><?php _e( 'Advanced', 'gp-premium' ); ?></span>
<span class="show-advanced"><?php esc_html_e( 'Advanced', 'gp-premium' ); ?></span>
<div class="reset-choices advanced-choices">
<label><input type="checkbox" name="module_group[]" value="generate_settings" checked /><?php _ex( 'Core', 'Module name', 'gp-premium' ); ?></label>
@ -47,7 +57,7 @@ function generate_premium_reset_metabox() {
<?php if ( generatepress_is_module_active( 'generate_package_copyright', 'GENERATE_COPYRIGHT' ) ) { ?>
<label><input type="checkbox" name="module_group[]" value="copyright" checked /><?php _ex( 'Copyright', 'Module name', 'gp-premium' ); ?></label>
<?php }?>
<?php } ?>
</div>
<p><input type="hidden" name="generate_reset_action" value="reset_settings" /></p>
<p style="margin-bottom:0">
@ -61,7 +71,7 @@ function generate_premium_reset_metabox() {
false,
array(
'onclick' => esc_js( $warning ),
'id' => '' ,
'id' => '',
)
);
?>
@ -73,9 +83,11 @@ function generate_premium_reset_metabox() {
}
add_action( 'admin_init', 'generate_premium_process_reset' );
/**
* Process the reset functions.
*/
function generate_premium_process_reset() {
if ( empty( $_POST['generate_reset_action'] ) || 'reset_settings' != $_POST['generate_reset_action'] ) {
if ( empty( $_POST['generate_reset_action'] ) || 'reset_settings' !== $_POST['generate_reset_action'] ) {
return;
}
@ -133,11 +145,11 @@ function generate_premium_process_reset() {
$data = array(
'mods' => array(),
'options' => array()
'options' => array(),
);
foreach ( $theme_mods as $theme_mod ) {
if ( 'generate_copyright' == $theme_mod ) {
if ( 'generate_copyright' === $theme_mod ) {
if ( in_array( 'copyright', $_POST['module_group'] ) ) {
remove_theme_mod( $theme_mod );
}
@ -154,13 +166,23 @@ function generate_premium_process_reset() {
}
}
// Delete our dynamic CSS option.
delete_option( 'generate_dynamic_css_output' );
delete_option( 'generate_dynamic_css_cached_version' );
// Reset our dynamic CSS file updated time so it regenerates.
$dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() );
if ( isset( $dynamic_css_data['updated_time'] ) ) {
unset( $dynamic_css_data['updated_time'] );
}
update_option( 'generatepress_dynamic_css_data', $dynamic_css_data );
// Delete any GeneratePress Site CSS in Additional CSS.
$additional_css = wp_get_custom_css_post();
if ( ! empty ( $additional_css ) ) {
if ( ! empty( $additional_css ) ) {
$additional_css->post_content = preg_replace( '#(/\\* GeneratePress Site CSS \\*/).*?(/\\* End GeneratePress Site CSS \\*/)#s', '', $additional_css->post_content );
wp_update_custom_css_post( $additional_css->post_content );
}
@ -170,7 +192,9 @@ function generate_premium_process_reset() {
}
add_action( 'admin_head', 'generate_reset_options_css', 100 );
/**
* Add CSS to the dashboard.
*/
function generate_reset_options_css() {
$screen = get_current_screen();
@ -223,7 +247,9 @@ function generate_reset_options_css() {
}
add_action( 'admin_footer', 'generate_reset_options_scripts', 100 );
/**
* Add scripts to the Dashboard.
*/
function generate_reset_options_scripts() {
$screen = get_current_screen();