diff --git a/wp-content/plugins/gp-premium/backgrounds/functions/css.php b/wp-content/plugins/gp-premium/backgrounds/functions/css.php
index 5c7a474..e46eec6 100644
--- a/wp-content/plugins/gp-premium/backgrounds/functions/css.php
+++ b/wp-content/plugins/gp-premium/backgrounds/functions/css.php
@@ -1,18 +1,64 @@
_selector !== '' ) {
+ // Render the css in the output string everytime the selector changes.
+ if ( '' !== $this->_selector ) {
$this->add_selector_rules_to_output();
}
@@ -21,20 +67,39 @@ if ( ! class_exists( 'GeneratePress_Backgrounds_CSS' ) ) {
return $this;
}
+ /**
+ * Adds a css property with value to the css output
+ *
+ * @access public
+ * @since 1.0
+ *
+ * @param string $property - the css property.
+ * @param string $value - the value to be placed with the property.
+ * @param string $url Whether we need to generate URL in the string.
+ * @return $this
+ */
public function add_property( $property, $value, $url = '' ) {
- // If we don't have a value or our value is the same as our og default, bail
+ // If we don't have a value or our value is the same as our og default, bail.
if ( empty( $value ) ) {
return false;
}
- // Set up our background image URL param if needed
- $url_start = ( '' !== $url ) ? "url('" : "";
- $url_end = ( '' !== $url ) ? "')" : "";
+ // Set up our background image URL param if needed.
+ $url_start = ( '' !== $url ) ? "url('" : ""; // phpcs:ignore -- need double quotes.
+ $url_end = ( '' !== $url ) ? "')" : ""; // phpcs:ignore -- need double quotes.
$this->_css .= $property . ':' . $url_start . $value . $url_end . ';';
return $this;
}
+ /**
+ * Adds the current selector rules to the output variable
+ *
+ * @access private
+ * @since 1.0
+ *
+ * @return $this
+ */
private function add_selector_rules_to_output() {
if ( ! empty( $this->_css ) ) {
$this->_selector_output = $this->_selector;
@@ -42,18 +107,26 @@ if ( ! class_exists( 'GeneratePress_Backgrounds_CSS' ) ) {
$this->_output .= $selector_output;
- // Reset the css
+ // Reset the css.
$this->_css = '';
}
return $this;
}
+ /**
+ * Returns the minified css in the $_output variable
+ *
+ * @access public
+ * @since 1.0
+ *
+ * @return string
+ */
public function css_output() {
- // Add current selector's rules to output
+ // Add current selector's rules to output.
$this->add_selector_rules_to_output();
- // Output minified css
+ // Output minified css.
return $this->_output;
}
diff --git a/wp-content/plugins/gp-premium/backgrounds/functions/functions.php b/wp-content/plugins/gp-premium/backgrounds/functions/functions.php
index 909468f..30974c8 100644
--- a/wp-content/plugins/gp-premium/backgrounds/functions/functions.php
+++ b/wp-content/plugins/gp-premium/backgrounds/functions/functions.php
@@ -1,8 +1,14 @@
register_control_type( 'GeneratePress_Background_Images_Customize_Control' );
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
}
- // Add our panel
if ( class_exists( 'WP_Customize_Panel' ) ) {
if ( ! $wp_customize->get_panel( 'generate_backgrounds_panel' ) ) {
- $wp_customize->add_panel( 'generate_backgrounds_panel', array(
- 'capability' => 'edit_theme_options',
- 'theme_supports' => '',
- 'title' => __( 'Background Images', 'gp-premium' ),
- 'priority' => 55
- ) );
+ $wp_customize->add_panel(
+ 'generate_backgrounds_panel',
+ array(
+ 'capability' => 'edit_theme_options',
+ 'theme_supports' => '',
+ 'title' => __( 'Background Images', 'gp-premium' ),
+ 'priority' => 55,
+ )
+ );
}
}
@@ -143,7 +150,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Body background
*/
$wp_customize->add_setting(
- 'generate_background_settings[body_image]', array(
+ 'generate_background_settings[body_image]',
+ array(
'default' => $defaults['body_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -191,7 +199,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[body_position]', array(
+ 'generate_background_settings[body_position]',
+ array(
'default' => $defaults['body_position'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -230,7 +239,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[top_bar_image]', array(
+ 'generate_background_settings[top_bar_image]',
+ array(
'default' => $defaults['top_bar_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -278,7 +288,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[top_bar_position]', array(
+ 'generate_background_settings[top_bar_position]',
+ array(
'default' => $defaults['top_bar_position'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -334,7 +345,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[header_image]', array(
+ 'generate_background_settings[header_image]',
+ array(
'default' => $defaults['header_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -382,7 +394,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[header_position]', array(
+ 'generate_background_settings[header_position]',
+ array(
'default' => $defaults['header_position'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -438,7 +451,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Navigation background
*/
$wp_customize->add_setting(
- 'generate_background_settings[nav_image]', array(
+ 'generate_background_settings[nav_image]',
+ array(
'default' => $defaults['nav_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -488,7 +502,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Navigation item background
*/
$wp_customize->add_setting(
- 'generate_background_settings[nav_item_image]', array(
+ 'generate_background_settings[nav_item_image]',
+ array(
'default' => $defaults['nav_item_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -538,7 +553,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Navigation item hover background
*/
$wp_customize->add_setting(
- 'generate_background_settings[nav_item_hover_image]', array(
+ 'generate_background_settings[nav_item_hover_image]',
+ array(
'default' => $defaults['nav_item_hover_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -588,7 +604,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Navigation item current background
*/
$wp_customize->add_setting(
- 'generate_background_settings[nav_item_current_image]', array(
+ 'generate_background_settings[nav_item_current_image]',
+ array(
'default' => $defaults['nav_item_current_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -648,7 +665,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Sub-Navigation item background
*/
$wp_customize->add_setting(
- 'generate_background_settings[sub_nav_item_image]', array(
+ 'generate_background_settings[sub_nav_item_image]',
+ array(
'default' => $defaults['sub_nav_item_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -698,7 +716,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Sub-Navigation item hover background
*/
$wp_customize->add_setting(
- 'generate_background_settings[sub_nav_item_hover_image]', array(
+ 'generate_background_settings[sub_nav_item_hover_image]',
+ array(
'default' => $defaults['sub_nav_item_hover_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -748,7 +767,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Sub-Navigation item current background
*/
$wp_customize->add_setting(
- 'generate_background_settings[sub_nav_item_current_image]', array(
+ 'generate_background_settings[sub_nav_item_current_image]',
+ array(
'default' => $defaults['sub_nav_item_current_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -790,7 +810,7 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
'no-repeat' => __( 'No Repeat', 'gp-premium' ),
),
'settings' => 'generate_background_settings[sub_nav_item_current_repeat]',
- 'priority' => 2400
+ 'priority' => 2400,
)
);
@@ -825,7 +845,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
* Content background
*/
$wp_customize->add_setting(
- 'generate_background_settings[content_image]', array(
+ 'generate_background_settings[content_image]',
+ array(
'default' => $defaults['content_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -873,7 +894,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[content_position]', array(
+ 'generate_background_settings[content_position]',
+ array(
'default' => $defaults['content_position'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -897,7 +919,6 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
)
);
- // Sidebars
$wp_customize->add_section(
'generate_backgrounds_sidebars',
array(
@@ -927,7 +948,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[sidebar_widget_image]', array(
+ 'generate_background_settings[sidebar_widget_image]',
+ array(
'default' => $defaults['sidebar_widget_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -975,7 +997,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[sidebar_widget_position]', array(
+ 'generate_background_settings[sidebar_widget_position]',
+ array(
'default' => $defaults['sidebar_widget_position'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -999,7 +1022,6 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
)
);
- // Footer widgets
$wp_customize->add_section(
'generate_backgrounds_footer',
array(
@@ -1078,7 +1100,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[footer_widget_position]', array(
+ 'generate_background_settings[footer_widget_position]',
+ array(
'default' => $defaults['footer_widget_position'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -1102,7 +1125,6 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
)
);
- // Footer
$wp_customize->add_setting(
'generate_background_settings[footer_image]',
array(
@@ -1153,7 +1175,8 @@ if ( ! function_exists( 'generate_backgrounds_customize' ) ) {
);
$wp_customize->add_setting(
- 'generate_background_settings[footer_position]', array(
+ 'generate_background_settings[footer_position]',
+ array(
'default' => $defaults['footer_position'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -1191,113 +1214,97 @@ if ( ! function_exists( 'generate_backgrounds_css' ) ) {
generate_get_background_defaults()
);
- // Fix size values
- // Spaces and % are stripped by sanitize_key
- $generate_settings[ 'body_size' ] = ( '100' == $generate_settings[ 'body_size' ] ) ? '100% auto' : esc_attr( $generate_settings[ 'body_size' ] );
- $generate_settings[ 'top_bar_size' ] = ( '100' == $generate_settings[ 'top_bar_size' ] ) ? '100% auto' : esc_attr( $generate_settings[ 'top_bar_size' ] );
- $generate_settings[ 'header_size' ] = ( '100' == $generate_settings[ 'header_size' ] ) ? '100% auto' : esc_attr( $generate_settings[ 'header_size' ] );
- $generate_settings[ 'content_size' ] = ( '100' == $generate_settings[ 'content_size' ] ) ? '100% auto' : esc_attr( $generate_settings[ 'content_size' ] );
- $generate_settings[ 'sidebar_widget_size' ] = ( '100' == $generate_settings[ 'sidebar_widget_size' ] ) ? '100% auto' : esc_attr( $generate_settings[ 'sidebar_widget_size' ] );
- $generate_settings[ 'footer_widget_size' ] = ( '100' == $generate_settings[ 'footer_widget_size' ] ) ? '100% auto' : esc_attr( $generate_settings[ 'footer_widget_size' ] );
- $generate_settings[ 'footer_size' ] = ( '100' == $generate_settings[ 'footer_size' ] ) ? '100% auto' : esc_attr( $generate_settings[ 'footer_size' ] );
+ // Fix size values.
+ // Spaces and % are stripped by sanitize_key.
+ $generate_settings['body_size'] = ( '100' == $generate_settings['body_size'] ) ? '100% auto' : esc_attr( $generate_settings['body_size'] ); // phpcs:ignore -- Non-strict comparison ok.
+ $generate_settings['top_bar_size'] = ( '100' == $generate_settings['top_bar_size'] ) ? '100% auto' : esc_attr( $generate_settings['top_bar_size'] ); // phpcs:ignore -- Non-strict comparison ok.
+ $generate_settings['header_size'] = ( '100' == $generate_settings['header_size'] ) ? '100% auto' : esc_attr( $generate_settings['header_size'] ); // phpcs:ignore -- Non-strict comparison ok.
+ $generate_settings['content_size'] = ( '100' == $generate_settings['content_size'] ) ? '100% auto' : esc_attr( $generate_settings['content_size'] ); // phpcs:ignore -- Non-strict comparison ok.
+ $generate_settings['sidebar_widget_size'] = ( '100' == $generate_settings['sidebar_widget_size'] ) ? '100% auto' : esc_attr( $generate_settings['sidebar_widget_size'] ); // phpcs:ignore -- Non-strict comparison ok.
+ $generate_settings['footer_widget_size'] = ( '100' == $generate_settings['footer_widget_size'] ) ? '100% auto' : esc_attr( $generate_settings['footer_widget_size'] ); // phpcs:ignore -- Non-strict comparison ok.
+ $generate_settings['footer_size'] = ( '100' == $generate_settings['footer_size'] ) ? '100% auto' : esc_attr( $generate_settings['footer_size'] ); // phpcs:ignore -- Non-strict comparison ok.
- // Initiate our CSS class
- $css = new GeneratePress_Backgrounds_CSS;
+ $css = new GeneratePress_Backgrounds_CSS();
- // Body
$css->set_selector( 'body' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'body_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'body_repeat' ] ) );
- $css->add_property( 'background-size', esc_attr( $generate_settings[ 'body_size' ] ) );
- $css->add_property( 'background-attachment', esc_attr( $generate_settings[ 'body_attachment' ] ) );
- $css->add_property( 'background-position', esc_attr( $generate_settings[ 'body_position' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['body_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['body_repeat'] ) );
+ $css->add_property( 'background-size', esc_attr( $generate_settings['body_size'] ) );
+ $css->add_property( 'background-attachment', esc_attr( $generate_settings['body_attachment'] ) );
+ $css->add_property( 'background-position', esc_attr( $generate_settings['body_position'] ) );
- // Top bar
if ( is_active_sidebar( 'top-bar' ) ) {
$css->set_selector( '.top-bar' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'top_bar_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'top_bar_repeat' ] ) );
- $css->add_property( 'background-size', esc_attr( $generate_settings[ 'top_bar_size' ] ) );
- $css->add_property( 'background-attachment', esc_attr( $generate_settings[ 'top_bar_attachment' ] ) );
- $css->add_property( 'background-position', esc_attr( $generate_settings[ 'top_bar_position' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['top_bar_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['top_bar_repeat'] ) );
+ $css->add_property( 'background-size', esc_attr( $generate_settings['top_bar_size'] ) );
+ $css->add_property( 'background-attachment', esc_attr( $generate_settings['top_bar_attachment'] ) );
+ $css->add_property( 'background-position', esc_attr( $generate_settings['top_bar_position'] ) );
}
- // Header
$css->set_selector( '.site-header' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'header_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'header_repeat' ] ) );
- $css->add_property( 'background-size', esc_attr( $generate_settings[ 'header_size' ] ) );
- $css->add_property( 'background-attachment', esc_attr( $generate_settings[ 'header_attachment' ] ) );
- $css->add_property( 'background-position', esc_attr( $generate_settings[ 'header_position' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['header_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['header_repeat'] ) );
+ $css->add_property( 'background-size', esc_attr( $generate_settings['header_size'] ) );
+ $css->add_property( 'background-attachment', esc_attr( $generate_settings['header_attachment'] ) );
+ $css->add_property( 'background-position', esc_attr( $generate_settings['header_position'] ) );
- // Navigation background
$css->set_selector( '.main-navigation,.menu-toggle' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'nav_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'nav_repeat' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['nav_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_repeat'] ) );
- // Navigation item background
$css->set_selector( '.main-navigation .main-nav > ul > li > a' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'nav_item_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'nav_item_repeat' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['nav_item_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_repeat'] ) );
- // Navigation background/text on hover
$css->set_selector( '.main-navigation .main-nav > ul > li > a:hover,.main-navigation .main-nav > ul > li.sfHover > a' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'nav_item_hover_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'nav_item_hover_repeat' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['nav_item_hover_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_hover_repeat'] ) );
- // Navigation background/text current
$css->set_selector( '.main-navigation .main-nav > ul > li[class*="current-menu-"] > a,.main-navigation .main-nav > ul > li[class*="current-menu-"] > a:hover,.main-navigation .main-nav > ul > li[class*="current-menu-"].sfHover > a' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'nav_item_current_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'nav_item_current_repeat' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['nav_item_current_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['nav_item_current_repeat'] ) );
- // Sub-Navigation text
$css->set_selector( '.main-navigation ul ul li a' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'sub_nav_item_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'sub_nav_item_repeat' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['sub_nav_item_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_repeat'] ) );
- // Sub-Navigation background/text on hover
$css->set_selector( '.main-navigation ul ul li > a:hover,.main-navigation ul ul li.sfHover > a' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'sub_nav_item_hover_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'sub_nav_item_hover_repeat' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['sub_nav_item_hover_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_hover_repeat'] ) );
- // Sub-Navigation background / text current
$css->set_selector( '.main-navigation ul ul li[class*="current-menu-"] > a,.main-navigation ul ul li[class*="current-menu-"] > a:hover,.main-navigation ul ul li[class*="current-menu-"].sfHover > a' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'sub_nav_item_current_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'sub_nav_item_current_repeat' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['sub_nav_item_current_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['sub_nav_item_current_repeat'] ) );
- // Content
$css->set_selector( '.separate-containers .inside-article,.separate-containers .comments-area,.separate-containers .page-header,.one-container .container,.separate-containers .paging-navigation,.separate-containers .inside-page-header' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'content_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'content_repeat' ] ) );
- $css->add_property( 'background-size', esc_attr( $generate_settings[ 'content_size' ] ) );
- $css->add_property( 'background-attachment', esc_attr( $generate_settings[ 'content_attachment' ] ) );
- $css->add_property( 'background-position', esc_attr( $generate_settings[ 'content_position' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['content_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['content_repeat'] ) );
+ $css->add_property( 'background-size', esc_attr( $generate_settings['content_size'] ) );
+ $css->add_property( 'background-attachment', esc_attr( $generate_settings['content_attachment'] ) );
+ $css->add_property( 'background-position', esc_attr( $generate_settings['content_position'] ) );
- // Sidebar widget
$css->set_selector( '.sidebar .widget' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'sidebar_widget_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'sidebar_widget_repeat' ] ) );
- $css->add_property( 'background-size', esc_attr( $generate_settings[ 'sidebar_widget_size' ] ) );
- $css->add_property( 'background-attachment', esc_attr( $generate_settings[ 'sidebar_widget_attachment' ] ) );
- $css->add_property( 'background-position', esc_attr( $generate_settings[ 'sidebar_widget_position' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['sidebar_widget_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['sidebar_widget_repeat'] ) );
+ $css->add_property( 'background-size', esc_attr( $generate_settings['sidebar_widget_size'] ) );
+ $css->add_property( 'background-attachment', esc_attr( $generate_settings['sidebar_widget_attachment'] ) );
+ $css->add_property( 'background-position', esc_attr( $generate_settings['sidebar_widget_position'] ) );
- // Footer widget
$css->set_selector( '.footer-widgets' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'footer_widget_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'footer_widget_repeat' ] ) );
- $css->add_property( 'background-size', esc_attr( $generate_settings[ 'footer_widget_size' ] ) );
- $css->add_property( 'background-attachment', esc_attr( $generate_settings[ 'footer_widget_attachment' ] ) );
- $css->add_property( 'background-position', esc_attr( $generate_settings[ 'footer_widget_position' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['footer_widget_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['footer_widget_repeat'] ) );
+ $css->add_property( 'background-size', esc_attr( $generate_settings['footer_widget_size'] ) );
+ $css->add_property( 'background-attachment', esc_attr( $generate_settings['footer_widget_attachment'] ) );
+ $css->add_property( 'background-position', esc_attr( $generate_settings['footer_widget_position'] ) );
- // Footer
$css->set_selector( '.site-info' );
- $css->add_property( 'background-image', esc_url( $generate_settings[ 'footer_image' ] ), 'url' );
- $css->add_property( 'background-repeat', esc_attr( $generate_settings[ 'footer_repeat' ] ) );
- $css->add_property( 'background-size', esc_attr( $generate_settings[ 'footer_size' ] ) );
- $css->add_property( 'background-attachment', esc_attr( $generate_settings[ 'footer_attachment' ] ) );
- $css->add_property( 'background-position', esc_attr( $generate_settings[ 'footer_position' ] ) );
+ $css->add_property( 'background-image', esc_url( $generate_settings['footer_image'] ), 'url' );
+ $css->add_property( 'background-repeat', esc_attr( $generate_settings['footer_repeat'] ) );
+ $css->add_property( 'background-size', esc_attr( $generate_settings['footer_size'] ) );
+ $css->add_property( 'background-attachment', esc_attr( $generate_settings['footer_attachment'] ) );
+ $css->add_property( 'background-position', esc_attr( $generate_settings['footer_position'] ) );
- // Return our dynamic CSS
return apply_filters( 'generate_backgrounds_css_output', $css->css_output() );
}
}
@@ -1310,6 +1317,26 @@ if ( ! function_exists( 'generate_background_scripts' ) ) {
* @since 0.1
*/
function generate_background_scripts() {
- wp_add_inline_style( 'generate-style', generate_backgrounds_css() );
+ if ( 'inline' === generate_get_css_print_method() ) {
+ wp_add_inline_style( 'generate-style', generate_backgrounds_css() );
+ }
}
}
+
+add_filter( 'generate_external_dynamic_css_output', 'generate_backgrounds_add_external_css' );
+/**
+ * Add to external stylesheet.
+ *
+ * @since 1.11.0
+ *
+ * @param string $css Existing CSS.
+ */
+function generate_backgrounds_add_external_css( $css ) {
+ if ( 'inline' === generate_get_css_print_method() ) {
+ return $css;
+ }
+
+ $css .= generate_backgrounds_css();
+
+ return $css;
+}
diff --git a/wp-content/plugins/gp-premium/backgrounds/functions/secondary-nav-backgrounds.php b/wp-content/plugins/gp-premium/backgrounds/functions/secondary-nav-backgrounds.php
index 5e42249..fdc17f1 100644
--- a/wp-content/plugins/gp-premium/backgrounds/functions/secondary-nav-backgrounds.php
+++ b/wp-content/plugins/gp-premium/backgrounds/functions/secondary-nav-backgrounds.php
@@ -1,6 +1,13 @@
get_section( 'secondary_nav_section' ) ) {
return;
}
- // Get our defaults
$defaults = generate_secondary_nav_get_defaults();
if ( method_exists( $wp_customize, 'register_control_type' ) ) {
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
}
- // Get our controls
require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';
- // Add our section
$wp_customize->add_section(
'secondary_bg_images_section',
array(
@@ -66,9 +70,9 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Background
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[nav_image]', array(
+ 'generate_secondary_nav_settings[nav_image]',
+ array(
'default' => $defaults['nav_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -89,7 +93,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Repeat
$wp_customize->add_setting(
'generate_secondary_nav_settings[nav_repeat]',
array(
@@ -111,13 +114,13 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
'no-repeat' => __( 'No Repeat', 'gp-premium' ),
),
'settings' => 'generate_secondary_nav_settings[nav_repeat]',
- 'priority' => 800
+ 'priority' => 800,
)
);
- // Item background
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[nav_item_image]', array(
+ 'generate_secondary_nav_settings[nav_item_image]',
+ array(
'default' => $defaults['nav_item_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -138,7 +141,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Item repeat
$wp_customize->add_setting(
'generate_secondary_nav_settings[nav_item_repeat]',
array(
@@ -160,13 +162,13 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
'no-repeat' => __( 'No Repeat', 'gp-premium' ),
),
'settings' => 'generate_secondary_nav_settings[nav_item_repeat]',
- 'priority' => 1000
+ 'priority' => 1000,
)
);
- // Item hover
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[nav_item_hover_image]', array(
+ 'generate_secondary_nav_settings[nav_item_hover_image]',
+ array(
'default' => $defaults['nav_item_hover_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -187,7 +189,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Item hover repeat
$wp_customize->add_setting(
'generate_secondary_nav_settings[nav_item_hover_repeat]',
array(
@@ -213,9 +214,9 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Current background
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[nav_item_current_image]', array(
+ 'generate_secondary_nav_settings[nav_item_current_image]',
+ array(
'default' => $defaults['nav_item_current_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -236,7 +237,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Current repeat
$wp_customize->add_setting(
'generate_secondary_nav_settings[nav_item_current_repeat]',
array(
@@ -262,7 +262,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Sub-navigation section
$wp_customize->add_section(
'secondary_subnav_bg_images_section',
array(
@@ -274,9 +273,9 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Item background
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[sub_nav_item_image]', array(
+ 'generate_secondary_nav_settings[sub_nav_item_image]',
+ array(
'default' => $defaults['sub_nav_item_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -297,7 +296,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Item repeat
$wp_customize->add_setting(
'generate_secondary_nav_settings[sub_nav_item_repeat]',
array(
@@ -319,13 +317,13 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
'no-repeat' => __( 'No Repeat', 'gp-premium' ),
),
'settings' => 'generate_secondary_nav_settings[sub_nav_item_repeat]',
- 'priority' => 1800
+ 'priority' => 1800,
)
);
- // Item hover
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[sub_nav_item_hover_image]', array(
+ 'generate_secondary_nav_settings[sub_nav_item_hover_image]',
+ array(
'default' => $defaults['sub_nav_item_hover_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -346,7 +344,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Item hover repeat
$wp_customize->add_setting(
'generate_secondary_nav_settings[sub_nav_item_hover_repeat]',
array(
@@ -372,9 +369,9 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Current background
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[sub_nav_item_current_image]', array(
+ 'generate_secondary_nav_settings[sub_nav_item_current_image]',
+ array(
'default' => $defaults['sub_nav_item_current_image'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -395,7 +392,6 @@ if ( ! function_exists( 'generate_backgrounds_secondary_nav_customizer' ) ) {
)
);
- // Current background repeat
$wp_customize->add_setting(
'generate_secondary_nav_settings[sub_nav_item_current_repeat]',
array(
diff --git a/wp-content/plugins/gp-premium/backgrounds/generate-backgrounds.php b/wp-content/plugins/gp-premium/backgrounds/generate-backgrounds.php
index b7f4b06..d9cd105 100644
--- a/wp-content/plugins/gp-premium/backgrounds/generate-backgrounds.php
+++ b/wp-content/plugins/gp-premium/backgrounds/generate-backgrounds.php
@@ -1,19 +1,19 @@
post_count ) {
$columns = false;
}
}
- // Return the result
+ // Return the result.
return apply_filters( 'generate_blog_columns', $columns );
}
}
@@ -56,6 +67,7 @@ if ( ! function_exists( 'generate_blog_get_masonry' ) ) {
);
// If masonry is enabled via option or filter, enable it.
+ // phpcs:ignore -- non-strict comparison allowed.
if ( $generate_blog_settings['masonry'] || 'true' == apply_filters( 'generate_blog_masonry', 'false' ) ) {
$masonry = 'true';
} else {
@@ -88,7 +100,7 @@ if ( ! function_exists( 'generate_blog_add_columns_container' ) ) {
printf(
'
%2$s',
'false' !== generate_blog_get_masonry() ? 'masonry-container are-images-unloaded' : '',
- 'false' !== generate_blog_get_masonry() ? '
' : ''
+ 'false' !== generate_blog_get_masonry() ? '
' : '' // phpcs:ignore -- no escaping needed.
);
}
}
@@ -126,7 +138,7 @@ if ( ! function_exists( 'generate_blog_columns_css' ) ) {
);
}
- $separator = ( function_exists('generate_spacing_get_defaults') ) ? absint( $spacing_settings['separator'] ) : 20;
+ $separator = ( function_exists( 'generate_spacing_get_defaults' ) ) ? absint( $spacing_settings['separator'] ) : 20;
$return = '';
if ( generate_blog_get_columns() ) {
diff --git a/wp-content/plugins/gp-premium/blog/functions/css/columns.css b/wp-content/plugins/gp-premium/blog/functions/css/columns.css
new file mode 100644
index 0000000..d145586
--- /dev/null
+++ b/wp-content/plugins/gp-premium/blog/functions/css/columns.css
@@ -0,0 +1,143 @@
+.masonry-enabled .page-header {
+ position: relative !important;
+}
+
+.separate-containers .site-main > .generate-columns-container {
+ margin-bottom: 0;
+}
+
+.masonry-container.are-images-unloaded,
+.load-more.are-images-unloaded,
+.masonry-enabled #nav-below {
+ opacity: 0;
+}
+
+/* columns */
+.generate-columns-container:not(.masonry-container) {
+ display: flex;
+ flex-flow: row wrap;
+ align-items: stretch;
+}
+
+.generate-columns-container:not(.masonry-container) .generate-columns {
+ display: flex;
+}
+
+.generate-columns .inside-article {
+ width: 100%;
+ box-sizing: border-box;
+}
+
+.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,
+.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image {
+ float: none;
+ text-align: center;
+ margin-left: 0;
+ margin-right: 0;
+}
+
+.generate-columns-container .paging-navigation,
+.generate-columns-container .page-header {
+ flex: 1 1 100%;
+ clear: both;
+}
+
+.generate-columns-container .paging-navigation {
+ margin-bottom: 0;
+}
+
+.no-sidebar .generate-columns-container .inside-article > * {
+ max-width: none;
+}
+
+.load-more:not(.has-svg-icon) .button.loading:before {
+ content: "\e900";
+ display: inline-block;
+ font-family: "GP Premium";
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+ animation: spin 2s infinite linear;
+ margin-right: 7px;
+}
+
+.load-more .button:not(.loading) .gp-icon {
+ display: none;
+}
+
+.load-more .gp-icon svg {
+ animation: spin 2s infinite linear;
+ margin-right: 7px;
+}
+
+@keyframes spin {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(360deg);
+ }
+}
+
+.generate-columns {
+ box-sizing: border-box;
+}
+
+.generate-columns.grid-20 {
+ width: 20%;
+}
+
+.generate-columns.grid-25 {
+ width: 25%;
+}
+
+.generate-columns.grid-33 {
+ width: 33.3333%;
+}
+
+.generate-columns.grid-50 {
+ width: 50%;
+}
+
+.generate-columns.grid-60 {
+ width: 60%;
+}
+
+.generate-columns.grid-66 {
+ width: 66.66667%;
+}
+
+@media (min-width: 768px) and (max-width: 1024px) {
+ .generate-columns.tablet-grid-50 {
+ width: 50%;
+ }
+}
+
+@media (max-width: 767px) {
+ .generate-columns-activated .generate-columns-container {
+ margin-left: 0;
+ margin-right: 0;
+ }
+ .generate-columns-container > * {
+ padding-left: 0;
+ }
+ .generate-columns-container .page-header {
+ margin-left: 0;
+ }
+ .generate-columns.mobile-grid-100 {
+ width: 100%;
+ }
+ .generate-columns-container > .paging-navigation {
+ margin-left: 0;
+ }
+}
+
+@media (max-width: 768px) {
+ .load-more {
+ display: block;
+ text-align: center;
+ margin-bottom: 0;
+ }
+}
diff --git a/wp-content/plugins/gp-premium/blog/functions/css/columns.min.css b/wp-content/plugins/gp-premium/blog/functions/css/columns.min.css
new file mode 100644
index 0000000..c2e2b6f
--- /dev/null
+++ b/wp-content/plugins/gp-premium/blog/functions/css/columns.min.css
@@ -0,0 +1 @@
+.masonry-enabled .page-header{position:relative!important}.separate-containers .site-main>.generate-columns-container{margin-bottom:0}.load-more.are-images-unloaded,.masonry-container.are-images-unloaded,.masonry-enabled #nav-below{opacity:0}.generate-columns-container:not(.masonry-container){display:flex;flex-flow:row wrap;align-items:stretch}.generate-columns-container:not(.masonry-container) .generate-columns{display:flex}.generate-columns .inside-article{width:100%;box-sizing:border-box}.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image{float:none;text-align:center;margin-left:0;margin-right:0}.generate-columns-container .page-header,.generate-columns-container .paging-navigation{flex:1 1 100%;clear:both}.generate-columns-container .paging-navigation{margin-bottom:0}.no-sidebar .generate-columns-container .inside-article>*{max-width:none}.load-more:not(.has-svg-icon) .button.loading:before{content:"\e900";display:inline-block;font-family:"GP Premium";font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;animation:spin 2s infinite linear;margin-right:7px}.load-more .button:not(.loading) .gp-icon{display:none}.load-more .gp-icon svg{animation:spin 2s infinite linear;margin-right:7px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.generate-columns{box-sizing:border-box}.generate-columns.grid-20{width:20%}.generate-columns.grid-25{width:25%}.generate-columns.grid-33{width:33.3333%}.generate-columns.grid-50{width:50%}.generate-columns.grid-60{width:60%}.generate-columns.grid-66{width:66.66667%}@media (min-width:768px) and (max-width:1024px){.generate-columns.tablet-grid-50{width:50%}}@media (max-width:767px){.generate-columns-activated .generate-columns-container{margin-left:0;margin-right:0}.generate-columns-container>*{padding-left:0}.generate-columns-container .page-header{margin-left:0}.generate-columns.mobile-grid-100{width:100%}.generate-columns-container>.paging-navigation{margin-left:0}}@media (max-width:768px){.load-more{display:block;text-align:center;margin-bottom:0}}
\ No newline at end of file
diff --git a/wp-content/plugins/gp-premium/blog/functions/css/featured-images.css b/wp-content/plugins/gp-premium/blog/functions/css/featured-images.css
new file mode 100644
index 0000000..885b231
--- /dev/null
+++ b/wp-content/plugins/gp-premium/blog/functions/css/featured-images.css
@@ -0,0 +1,110 @@
+.post-image-above-header .inside-article .post-image,
+.post-image-above-header .inside-article .featured-image {
+ margin-top: 0;
+ margin-bottom: 2em;
+}
+
+.post-image-aligned-left .inside-article .post-image,
+.post-image-aligned-left .inside-article .featured-image {
+ margin-top: 0;
+ margin-right: 2em;
+ float: left;
+ text-align: left;
+}
+
+.post-image-aligned-center .post-image,
+.post-image-aligned-center .featured-image {
+ text-align: center;
+}
+
+.post-image-aligned-right .inside-article .post-image,
+.post-image-aligned-right .inside-article .featured-image {
+ margin-top: 0;
+ margin-left: 2em;
+ float: right;
+ text-align: right;
+}
+
+.post-image-below-header.post-image-aligned-right .inside-article .post-image,
+.post-image-below-header.post-image-aligned-right .inside-article .featured-image,
+.post-image-below-header.post-image-aligned-center .inside-article .featured-image,
+.post-image-below-header.post-image-aligned-left .inside-article .post-image,
+.post-image-below-header.post-image-aligned-left .inside-article .featured-image {
+ margin-top: 2em;
+}
+
+.post-image-aligned-left > .featured-image,
+.post-image-aligned-right > .featured-image {
+ float: none;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.post-image-aligned-left .featured-image {
+ text-align: left;
+}
+
+.post-image-aligned-right .featured-image {
+ text-align: right;
+}
+
+.post-image-aligned-left .inside-article:before,
+.post-image-aligned-left .inside-article:after,
+.post-image-aligned-right .inside-article:before,
+.post-image-aligned-right .inside-article:after {
+ content: "";
+ display: table;
+}
+
+.post-image-aligned-left .inside-article:after,
+.post-image-aligned-right .inside-article:after {
+ clear: both;
+}
+
+.post-image-aligned-left .inside-article,
+.post-image-aligned-right .inside-article {
+ zoom: 1;
+ /* For IE 6/7 (trigger hasLayout) */
+}
+
+.one-container.post-image-above-header .page-header + .no-featured-image-padding .inside-article .post-image,
+.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image {
+ margin-top: 0;
+}
+
+.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
+.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
+.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,
+.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image {
+ margin-right: 0;
+}
+
+.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
+.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
+.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,
+.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image {
+ margin-left: 0;
+}
+
+.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image,
+.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image {
+ margin-left: 0;
+ margin-right: 0;
+}
+
+.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image,
+.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image {
+ margin-left: 0;
+ margin-right: 0;
+}
+
+@media (max-width: 768px) {
+ body:not(.post-image-aligned-center) .inside-article .post-image,
+ body:not(.post-image-aligned-center) .featured-image,
+ body:not(.post-image-aligned-center) .inside-article .featured-image {
+ margin-right: 0;
+ margin-left: 0;
+ float: none;
+ text-align: center;
+ }
+}
diff --git a/wp-content/plugins/gp-premium/blog/functions/css/featured-images.min.css b/wp-content/plugins/gp-premium/blog/functions/css/featured-images.min.css
new file mode 100644
index 0000000..f92c6ab
--- /dev/null
+++ b/wp-content/plugins/gp-premium/blog/functions/css/featured-images.min.css
@@ -0,0 +1 @@
+.post-image-above-header .inside-article .featured-image,.post-image-above-header .inside-article .post-image{margin-top:0;margin-bottom:2em}.post-image-aligned-left .inside-article .featured-image,.post-image-aligned-left .inside-article .post-image{margin-top:0;margin-right:2em;float:left;text-align:left}.post-image-aligned-center .featured-image,.post-image-aligned-center .post-image{text-align:center}.post-image-aligned-right .inside-article .featured-image,.post-image-aligned-right .inside-article .post-image{margin-top:0;margin-left:2em;float:right;text-align:right}.post-image-below-header.post-image-aligned-center .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .post-image,.post-image-below-header.post-image-aligned-right .inside-article .featured-image,.post-image-below-header.post-image-aligned-right .inside-article .post-image{margin-top:2em}.post-image-aligned-left>.featured-image,.post-image-aligned-right>.featured-image{float:none;margin-left:auto;margin-right:auto}.post-image-aligned-left .featured-image{text-align:left}.post-image-aligned-right .featured-image{text-align:right}.post-image-aligned-left .inside-article:after,.post-image-aligned-left .inside-article:before,.post-image-aligned-right .inside-article:after,.post-image-aligned-right .inside-article:before{content:"";display:table}.post-image-aligned-left .inside-article:after,.post-image-aligned-right .inside-article:after{clear:both}.post-image-aligned-left .inside-article,.post-image-aligned-right .inside-article{zoom:1}.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image,.one-container.post-image-above-header .page-header+.no-featured-image-padding .inside-article .post-image{margin-top:0}.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-right:0}.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0}.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0;margin-right:0}.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image,.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image{margin-left:0;margin-right:0}@media (max-width:768px){body:not(.post-image-aligned-center) .featured-image,body:not(.post-image-aligned-center) .inside-article .featured-image,body:not(.post-image-aligned-center) .inside-article .post-image{margin-right:0;margin-left:0;float:none;text-align:center}}
\ No newline at end of file
diff --git a/wp-content/plugins/gp-premium/blog/functions/css/style-min.css b/wp-content/plugins/gp-premium/blog/functions/css/style-min.css
deleted file mode 100644
index 1fd5813..0000000
--- a/wp-content/plugins/gp-premium/blog/functions/css/style-min.css
+++ /dev/null
@@ -1 +0,0 @@
-@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.post-image-above-header .inside-article .featured-image,.post-image-above-header .inside-article .post-image{margin-top:0;margin-bottom:2em}.post-image-aligned-left .inside-article .featured-image,.post-image-aligned-left .inside-article .post-image{margin-top:0;margin-right:2em;float:left;text-align:left}.post-image-aligned-center .featured-image,.post-image-aligned-center .post-image{text-align:center}.post-image-aligned-right .inside-article .featured-image,.post-image-aligned-right .inside-article .post-image{margin-top:0;margin-left:2em;float:right;text-align:right}.post-image-below-header.post-image-aligned-center .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .post-image,.post-image-below-header.post-image-aligned-right .inside-article .featured-image,.post-image-below-header.post-image-aligned-right .inside-article .post-image{margin-top:2em}.post-image-aligned-left>.featured-image,.post-image-aligned-right>.featured-image{float:none;margin-left:auto;margin-right:auto}.post-image-aligned-left .featured-image{text-align:left}.post-image-aligned-right .featured-image{text-align:right}.post-image-aligned-left .inside-article:after,.post-image-aligned-left .inside-article:before,.post-image-aligned-right .inside-article:after,.post-image-aligned-right .inside-article:before{content:"";display:table}.post-image-aligned-left .inside-article:after,.post-image-aligned-right .inside-article:after{clear:both}.post-image-aligned-left .inside-article,.post-image-aligned-right .inside-article{zoom:1}.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-right:0}.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0}.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image,.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image{margin-left:0;margin-right:0}.masonry-enabled .page-header{position:relative!important}.separate-containers .site-main>.generate-columns-container{margin-bottom:0}.load-more.are-images-unloaded,.masonry-container.are-images-unloaded,.masonry-enabled #nav-below{opacity:0}.generate-columns-container:not(.masonry-container){-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch}.generate-columns-container:not(.masonry-container),.generate-columns-container:not(.masonry-container) .generate-columns{display:-webkit-flex;display:-ms-flexbox;display:flex}.generate-columns .inside-article{width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image{float:none;text-align:center;margin-left:0;margin-right:0}.generate-columns-container .page-header,.generate-columns-container .paging-navigation{-webkit-box-flex:1;-webkit-flex:1 1 100%;-ms-flex:1 1 100%;flex:1 1 100%;clear:both}.generate-columns-container .paging-navigation{margin-bottom:0}.no-sidebar .generate-columns-container .inside-article>*{max-width:none}.load-more:not(.has-svg-icon) .button.loading:before{content:"\e900";display:inline-block;font-family:"GP Premium";speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;margin-right:7px}.load-more .button:not(.loading) .gp-icon{display:none}.load-more .gp-icon svg{-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;margin-right:7px}@media (max-width:767px){.generate-columns-activated .generate-columns-container{margin-left:0;margin-right:0}.generate-columns-container>*{padding-left:0}.generate-columns-container .page-header{margin-left:0}}@media (max-width:768px){body:not(.post-image-aligned-center) .featured-image,body:not(.post-image-aligned-center) .inside-article .featured-image,body:not(.post-image-aligned-center) .inside-article .post-image{margin-right:0;margin-left:0;float:none;text-align:center}.load-more{display:block;text-align:center;margin-bottom:0}}
diff --git a/wp-content/plugins/gp-premium/blog/functions/css/style.css b/wp-content/plugins/gp-premium/blog/functions/css/style.css
index 298e0cf..6a03256 100644
--- a/wp-content/plugins/gp-premium/blog/functions/css/style.css
+++ b/wp-content/plugins/gp-premium/blog/functions/css/style.css
@@ -1,27 +1,27 @@
.post-image-above-header .inside-article .post-image,
.post-image-above-header .inside-article .featured-image {
- margin-top:0;
- margin-bottom:2em;
+ margin-top: 0;
+ margin-bottom: 2em;
}
.post-image-aligned-left .inside-article .post-image,
.post-image-aligned-left .inside-article .featured-image {
- margin-top:0;
- margin-right:2em;
- float:left;
+ margin-top: 0;
+ margin-right: 2em;
+ float: left;
text-align: left;
}
.post-image-aligned-center .post-image,
.post-image-aligned-center .featured-image {
- text-align:center;
+ text-align: center;
}
.post-image-aligned-right .inside-article .post-image,
.post-image-aligned-right .inside-article .featured-image {
- margin-top:0;
- margin-left:2em;
- float:right;
+ margin-top: 0;
+ margin-left: 2em;
+ float: right;
text-align: right;
}
@@ -30,7 +30,7 @@
.post-image-below-header.post-image-aligned-center .inside-article .featured-image,
.post-image-below-header.post-image-aligned-left .inside-article .post-image,
.post-image-below-header.post-image-aligned-left .inside-article .featured-image {
- margin-top:2em;
+ margin-top: 2em;
}
.post-image-aligned-left > .featured-image,
@@ -63,31 +63,52 @@
.post-image-aligned-left .inside-article,
.post-image-aligned-right .inside-article {
- zoom: 1; /* For IE 6/7 (trigger hasLayout) */
+ zoom: 1;
+ /* For IE 6/7 (trigger hasLayout) */
+}
+
+.one-container.post-image-above-header .page-header + .no-featured-image-padding .inside-article .post-image,
+.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image {
+ margin-top: 0;
}
.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
-.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,
.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
+.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,
.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image {
margin-right: 0;
}
.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image,
-.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,
.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,
+.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,
.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image {
margin-left: 0;
}
.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image,
-.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,
+.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image {
+ margin-left: 0;
+ margin-right: 0;
+}
+
.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image,
.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image {
margin-left: 0;
margin-right: 0;
}
+@media (max-width: 768px) {
+ body:not(.post-image-aligned-center) .inside-article .post-image,
+ body:not(.post-image-aligned-center) .featured-image,
+ body:not(.post-image-aligned-center) .inside-article .featured-image {
+ margin-right: 0;
+ margin-left: 0;
+ float: none;
+ text-align: center;
+ }
+}
+
.masonry-enabled .page-header {
position: relative !important;
}
@@ -99,33 +120,22 @@
.masonry-container.are-images-unloaded,
.load-more.are-images-unloaded,
.masonry-enabled #nav-below {
- opacity: 0;
+ opacity: 0;
}
/* columns */
.generate-columns-container:not(.masonry-container) {
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
- -webkit-flex-flow: row wrap;
- -ms-flex-flow: row wrap;
- flex-flow: row wrap;
-
- -webkit-align-items: stretch;
- -ms-flex-align: stretch;
- align-items: stretch;
+ flex-flow: row wrap;
+ align-items: stretch;
}
.generate-columns-container:not(.masonry-container) .generate-columns {
- display: -webkit-flex;
- display: -ms-flexbox;
display: flex;
}
.generate-columns .inside-article {
width: 100%;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
box-sizing: border-box;
}
@@ -139,10 +149,7 @@
.generate-columns-container .paging-navigation,
.generate-columns-container .page-header {
- -webkit-box-flex: 1;
- -webkit-flex: 1 1 100%;
- -ms-flex: 1 1 100%;
- flex: 1 1 100%;
+ flex: 1 1 100%;
clear: both;
}
@@ -157,16 +164,12 @@
.load-more:not(.has-svg-icon) .button.loading:before {
content: "\e900";
display: inline-block;
- font-family: "GP Premium";
- speak: none;
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
- line-height: 1;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- -webkit-animation: spin 2s infinite linear;
+ font-family: "GP Premium";
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
animation: spin 2s infinite linear;
margin-right: 7px;
}
@@ -176,23 +179,53 @@
}
.load-more .gp-icon svg {
- -webkit-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
margin-right: 7px;
}
@keyframes spin {
0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
+ transform: rotate(0deg);
}
-
100% {
- -webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
+.generate-columns {
+ box-sizing: border-box;
+}
+
+.generate-columns.grid-20 {
+ width: 20%;
+}
+
+.generate-columns.grid-25 {
+ width: 25%;
+}
+
+.generate-columns.grid-33 {
+ width: 33.3333%;
+}
+
+.generate-columns.grid-50 {
+ width: 50%;
+}
+
+.generate-columns.grid-60 {
+ width: 60%;
+}
+
+.generate-columns.grid-66 {
+ width: 66.66667%;
+}
+
+@media (min-width: 768px) and (max-width: 1024px) {
+ .generate-columns.tablet-grid-50 {
+ width: 50%;
+ }
+}
+
@media (max-width: 767px) {
.generate-columns-activated .generate-columns-container {
margin-left: 0;
@@ -204,21 +237,18 @@
.generate-columns-container .page-header {
margin-left: 0;
}
+ .generate-columns.mobile-grid-100 {
+ width: 100%;
+ }
+ .generate-columns-container > .paging-navigation {
+ margin-left: 0;
+ }
}
-@media (max-width:768px) {
- body:not(.post-image-aligned-center) .inside-article .post-image,
- body:not(.post-image-aligned-center) .featured-image,
- body:not(.post-image-aligned-center) .inside-article .featured-image {
- margin-right: 0;
- margin-left: 0;
- float: none;
- text-align: center;
- }
-
+@media (max-width: 768px) {
.load-more {
display: block;
- text-align:center;
+ text-align: center;
margin-bottom: 0;
}
}
diff --git a/wp-content/plugins/gp-premium/blog/functions/css/style.min.css b/wp-content/plugins/gp-premium/blog/functions/css/style.min.css
new file mode 100644
index 0000000..cdcdddd
--- /dev/null
+++ b/wp-content/plugins/gp-premium/blog/functions/css/style.min.css
@@ -0,0 +1 @@
+.post-image-above-header .inside-article .featured-image,.post-image-above-header .inside-article .post-image{margin-top:0;margin-bottom:2em}.post-image-aligned-left .inside-article .featured-image,.post-image-aligned-left .inside-article .post-image{margin-top:0;margin-right:2em;float:left;text-align:left}.post-image-aligned-center .featured-image,.post-image-aligned-center .post-image{text-align:center}.post-image-aligned-right .inside-article .featured-image,.post-image-aligned-right .inside-article .post-image{margin-top:0;margin-left:2em;float:right;text-align:right}.post-image-below-header.post-image-aligned-center .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .featured-image,.post-image-below-header.post-image-aligned-left .inside-article .post-image,.post-image-below-header.post-image-aligned-right .inside-article .featured-image,.post-image-below-header.post-image-aligned-right .inside-article .post-image{margin-top:2em}.post-image-aligned-left>.featured-image,.post-image-aligned-right>.featured-image{float:none;margin-left:auto;margin-right:auto}.post-image-aligned-left .featured-image{text-align:left}.post-image-aligned-right .featured-image{text-align:right}.post-image-aligned-left .inside-article:after,.post-image-aligned-left .inside-article:before,.post-image-aligned-right .inside-article:after,.post-image-aligned-right .inside-article:before{content:"";display:table}.post-image-aligned-left .inside-article:after,.post-image-aligned-right .inside-article:after{clear:both}.post-image-aligned-left .inside-article,.post-image-aligned-right .inside-article{zoom:1}.one-container.post-image-above-header .no-featured-image-padding.generate-columns .inside-article .post-image,.one-container.post-image-above-header .page-header+.no-featured-image-padding .inside-article .post-image{margin-top:0}.one-container.both-right.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-right.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.right-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-right:0}.one-container.both-left.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-left.post-image-aligned-center .no-featured-image-padding .post-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.left-sidebar.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0}.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .featured-image,.one-container.both-sidebars.post-image-aligned-center .no-featured-image-padding .post-image{margin-left:0;margin-right:0}.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .featured-image,.one-container.post-image-aligned-center .no-featured-image-padding.generate-columns .post-image{margin-left:0;margin-right:0}@media (max-width:768px){body:not(.post-image-aligned-center) .featured-image,body:not(.post-image-aligned-center) .inside-article .featured-image,body:not(.post-image-aligned-center) .inside-article .post-image{margin-right:0;margin-left:0;float:none;text-align:center}}.masonry-enabled .page-header{position:relative!important}.separate-containers .site-main>.generate-columns-container{margin-bottom:0}.load-more.are-images-unloaded,.masonry-container.are-images-unloaded,.masonry-enabled #nav-below{opacity:0}.generate-columns-container:not(.masonry-container){display:flex;flex-flow:row wrap;align-items:stretch}.generate-columns-container:not(.masonry-container) .generate-columns{display:flex}.generate-columns .inside-article{width:100%;box-sizing:border-box}.generate-columns-activated.post-image-aligned-left .generate-columns-container article:not(.featured-column) .post-image,.generate-columns-activated.post-image-aligned-right .generate-columns-container article:not(.featured-column) .post-image{float:none;text-align:center;margin-left:0;margin-right:0}.generate-columns-container .page-header,.generate-columns-container .paging-navigation{flex:1 1 100%;clear:both}.generate-columns-container .paging-navigation{margin-bottom:0}.no-sidebar .generate-columns-container .inside-article>*{max-width:none}.load-more:not(.has-svg-icon) .button.loading:before{content:"\e900";display:inline-block;font-family:"GP Premium";font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;animation:spin 2s infinite linear;margin-right:7px}.load-more .button:not(.loading) .gp-icon{display:none}.load-more .gp-icon svg{animation:spin 2s infinite linear;margin-right:7px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.generate-columns{box-sizing:border-box}.generate-columns.grid-20{width:20%}.generate-columns.grid-25{width:25%}.generate-columns.grid-33{width:33.3333%}.generate-columns.grid-50{width:50%}.generate-columns.grid-60{width:60%}.generate-columns.grid-66{width:66.66667%}@media (min-width:768px) and (max-width:1024px){.generate-columns.tablet-grid-50{width:50%}}@media (max-width:767px){.generate-columns-activated .generate-columns-container{margin-left:0;margin-right:0}.generate-columns-container>*{padding-left:0}.generate-columns-container .page-header{margin-left:0}.generate-columns.mobile-grid-100{width:100%}.generate-columns-container>.paging-navigation{margin-left:0}}@media (max-width:768px){.load-more{display:block;text-align:center;margin-bottom:0}}
\ No newline at end of file
diff --git a/wp-content/plugins/gp-premium/blog/functions/generate-blog.php b/wp-content/plugins/gp-premium/blog/functions/generate-blog.php
index 23a5373..fde80ed 100644
--- a/wp-content/plugins/gp-premium/blog/functions/generate-blog.php
+++ b/wp-content/plugins/gp-premium/blog/functions/generate-blog.php
@@ -14,6 +14,8 @@ if ( ! function_exists( 'generate_blog_scripts' ) ) {
* Enqueue scripts and styles
*/
function generate_blog_scripts() {
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
+
$settings = wp_parse_args(
get_option( 'generate_blog_settings', array() ),
generate_blog_get_defaults()
@@ -47,15 +49,80 @@ if ( ! function_exists( 'generate_blog_scripts' ) ) {
}
if ( ( 'true' == generate_blog_get_masonry() && generate_blog_get_columns() ) || ( $settings[ 'infinite_scroll' ] && ! is_singular() && ! is_404() ) ) {
- wp_enqueue_script( 'generate-blog', plugin_dir_url( __FILE__ ) . 'js/scripts.min.js', $deps, GENERATE_BLOG_VERSION, true );
- wp_localize_script( 'generate-blog', 'blog', array(
- 'more' => $settings['masonry_load_more'],
- 'loading' => $settings['masonry_loading'],
- 'icon' => function_exists( 'generate_get_svg_icon' ) ? generate_get_svg_icon( 'spinner' ) : '',
- ) );
+ wp_enqueue_script( 'generate-blog', plugin_dir_url( __FILE__ ) . "js/scripts{$suffix}.js", $deps, GENERATE_BLOG_VERSION, true );
+
+ wp_localize_script(
+ 'generate-blog',
+ 'generateBlog',
+ array(
+ 'more' => $settings['masonry_load_more'],
+ 'loading' => $settings['masonry_loading'],
+ 'icon' => function_exists( 'generate_get_svg_icon' ) ? generate_get_svg_icon( 'spinner' ) : '',
+ 'masonryInit' => apply_filters(
+ 'generate_blog_masonry_init',
+ array(
+ 'columnWidth' => '.grid-sizer',
+ 'itemSelector' => 'none',
+ 'stamp' => '.page-header',
+ 'percentPosition' => true,
+ 'stagger' => 30,
+ 'visibleStyle' => array(
+ 'transform' => 'translateY(0)',
+ 'opacity' => 1,
+ ),
+ 'hiddenStyle' => array(
+ 'transform' => 'translateY(5px)',
+ 'opacity' => 0,
+ ),
+ )
+ ),
+ 'infiniteScrollInit' => apply_filters(
+ 'generate_blog_infinite_scroll_init',
+ array(
+ 'path' => '.nav-links .next',
+ 'append' => '#main article',
+ 'history' => false,
+ 'loadOnScroll' => $settings['infinite_scroll_button'] ? false : true,
+ 'button' => $settings['infinite_scroll_button'] ? '.load-more a' : null,
+ 'scrollThreshold' => $settings['infinite_scroll_button'] ? false : 600,
+ )
+ ),
+ )
+ );
}
- wp_enqueue_style( 'generate-blog', plugin_dir_url( __FILE__ ) . 'css/style-min.css', array(), GENERATE_BLOG_VERSION );
+ $needs_columns_css = false;
+ $needs_featured_image_css = false;
+
+ if ( ( ! is_singular() && $settings['column_layout'] ) || $settings['infinite_scroll'] ) {
+ $needs_columns_css = true;
+ }
+
+ if ( ! is_singular() ) {
+ if ( $settings['post_image'] ) {
+ $needs_featured_image_css = true;
+ }
+ }
+
+ if ( is_page() && has_post_thumbnail() ) {
+ if ( $settings['page_post_image'] ) {
+ $needs_featured_image_css = true;
+ }
+ }
+
+ if ( is_single() && has_post_thumbnail() ) {
+ if ( $settings['single_post_image'] ) {
+ $needs_featured_image_css = true;
+ }
+ }
+
+ if ( $needs_columns_css && $needs_featured_image_css ) {
+ wp_enqueue_style( 'generate-blog', plugin_dir_url( __FILE__ ) . "css/style{$suffix}.css", array(), GENERATE_BLOG_VERSION );
+ } elseif ( $needs_columns_css ) {
+ wp_enqueue_style( 'generate-blog-columns', plugin_dir_url( __FILE__ ) . "css/columns{$suffix}.css", array(), GENERATE_BLOG_VERSION );
+ } elseif ( $needs_featured_image_css ) {
+ wp_enqueue_style( 'generate-blog-images', plugin_dir_url( __FILE__ ) . "css/featured-images{$suffix}.css", array(), GENERATE_BLOG_VERSION );
+ }
}
}
@@ -220,31 +287,37 @@ if ( ! function_exists( 'generate_blog_css' ) ) {
generate_blog_get_defaults()
);
- // Get disable headline meta
- $disable_headline = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate-disable-headline', true ) : '';
-
- if ( ! $settings['categories'] && ! $settings['comments'] && ! $settings['tags'] && ! is_singular() ) {
- $return .= '.blog footer.entry-meta, .archive footer.entry-meta {display:none;}';
+ if ( ! defined( 'GENERATE_VERSION' ) ) {
+ return;
}
- if ( ! $settings['single_date'] && ! $settings['single_author'] && $disable_headline && is_singular() ) {
- $return .= '.single .entry-header{display:none;}.single .entry-content {margin-top:0;}';
- }
+ if ( version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '<' ) ) {
+ // Get disable headline meta.
+ $disable_headline = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate-disable-headline', true ) : '';
- if ( ! $settings['date'] && ! $settings['author'] && ! is_singular() ) {
- $return .= '.entry-header .entry-meta {display:none;}';
- }
+ if ( ! $settings['categories'] && ! $settings['comments'] && ! $settings['tags'] && ! is_singular() ) {
+ $return .= '.blog footer.entry-meta, .archive footer.entry-meta {display:none;}';
+ }
- if ( ! $settings['single_date'] && ! $settings['single_author'] && is_singular() ) {
- $return .= '.entry-header .entry-meta {display:none;}';
- }
+ if ( ! $settings['single_date'] && ! $settings['single_author'] && $disable_headline && is_singular() ) {
+ $return .= '.single .entry-header{display:none;}.single .entry-content {margin-top:0;}';
+ }
- if ( ! $settings['single_post_navigation'] && is_singular() ) {
- $return .= '.post-navigation {display:none;}';
- }
+ if ( ! $settings['date'] && ! $settings['author'] && ! is_singular() ) {
+ $return .= '.entry-header .entry-meta {display:none;}';
+ }
- if ( ! $settings['single_categories'] && ! $settings['single_post_navigation'] && ! $settings['single_tags'] && is_singular() ) {
- $return .= '.single footer.entry-meta {display:none;}';
+ if ( ! $settings['single_date'] && ! $settings['single_author'] && is_singular() ) {
+ $return .= '.entry-header .entry-meta {display:none;}';
+ }
+
+ if ( ! $settings['single_post_navigation'] && is_singular() ) {
+ $return .= '.post-navigation {display:none;}';
+ }
+
+ if ( ! $settings['single_categories'] && ! $settings['single_post_navigation'] && ! $settings['single_tags'] && is_singular() ) {
+ $return .= '.single footer.entry-meta {display:none;}';
+ }
}
$separator = 20;
@@ -349,16 +422,24 @@ if ( ! function_exists( 'generate_blog_excerpt_more' ) ) {
generate_blog_get_defaults()
);
- // If empty, return
if ( '' == $generate_settings['read_more'] ) {
return '';
}
- return apply_filters( 'generate_excerpt_more_output', sprintf( ' ...
%3$s',
- the_title_attribute( 'echo=0' ),
- esc_url( get_permalink( get_the_ID() ) ),
- wp_kses_post( $generate_settings['read_more'] )
- ) );
+ return apply_filters(
+ 'generate_excerpt_more_output',
+ sprintf(
+ ' ...
%3$s',
+ the_title_attribute( 'echo=0' ),
+ esc_url( get_permalink( get_the_ID() ) ),
+ wp_kses_post( $generate_settings['read_more'] ),
+ sprintf(
+ /* translators: Aria-label describing the read more button */
+ _x( 'More on %s', 'more on post title', 'gp-premium' ),
+ the_title_attribute( 'echo=0' )
+ )
+ )
+ );
}
}
@@ -373,17 +454,24 @@ if ( ! function_exists( 'generate_blog_content_more' ) ) {
generate_blog_get_defaults()
);
- // If empty, return
if ( '' == $generate_settings['read_more'] ) {
return '';
}
- return apply_filters( 'generate_content_more_link_output', sprintf( '
%3$s%4$s
',
- the_title_attribute( 'echo=0' ),
- esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ),
- wp_kses_post( $generate_settings['read_more'] ),
- '
' . get_the_title() . ''
- ) );
+ return apply_filters(
+ 'generate_content_more_link_output',
+ sprintf(
+ '
%3$s
',
+ the_title_attribute( 'echo=0' ),
+ esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump', '#more-' . get_the_ID() ) ),
+ wp_kses_post( $generate_settings['read_more'] ),
+ sprintf(
+ /* translators: Aria-label describing the read more button */
+ _x( 'More on %s', 'more on post title', 'gp-premium' ),
+ the_title_attribute( 'echo=0' )
+ )
+ )
+ );
}
}
@@ -485,15 +573,18 @@ if ( ! function_exists( 'generate_disable_post_comments_link' ) ) {
}
}
-add_filter( 'next_post_link', 'generate_disable_post_navigation' );
-add_filter( 'previous_post_link', 'generate_disable_post_navigation' );
+add_filter( 'generate_show_post_navigation', 'generate_disable_post_navigation' );
/**
* Remove the single post navigation
*
* @since 1.5
*/
function generate_disable_post_navigation( $navigation ) {
- return generate_disable_post_thing( $navigation, 'single_post_navigation' );
+ if ( is_singular() ) {
+ return generate_disable_post_thing( $navigation, 'single_post_navigation' );
+ } else {
+ return $navigation;
+ }
}
add_filter( 'generate_excerpt_more_output', 'generate_blog_read_more_button' );
diff --git a/wp-content/plugins/gp-premium/blog/functions/images.php b/wp-content/plugins/gp-premium/blog/functions/images.php
index ddd6280..00c9cc1 100644
--- a/wp-content/plugins/gp-premium/blog/functions/images.php
+++ b/wp-content/plugins/gp-premium/blog/functions/images.php
@@ -1,5 +1,13 @@
( in_array( $settings["{$single}post_image_width"], $ignore_crop ) ) ? 9999 : absint( $settings["{$single}post_image_width"] ),
- 'height' => ( in_array( $settings["{$single}post_image_height"], $ignore_crop ) ) ? 9999 : absint( $settings["{$single}post_image_height"] ),
- 'crop' => ( in_array( $settings["{$single}post_image_width"], $ignore_crop ) || in_array( $settings["{$single}post_image_height"], $ignore_crop ) ) ? false : true
+ 'width' => ( in_array( $settings[ "{$single}post_image_width" ], $ignore_crop ) ) ? 9999 : absint( $settings[ "{$single}post_image_width" ] ),
+ 'height' => ( in_array( $settings[ "{$single}post_image_height" ], $ignore_crop ) ) ? 9999 : absint( $settings[ "{$single}post_image_height" ] ),
+ 'crop' => ( in_array( $settings[ "{$single}post_image_width" ], $ignore_crop ) || in_array( $settings[ "{$single}post_image_height" ], $ignore_crop ) ) ? false : true,
);
- // If there's no height or width, empty the array
- if ( 9999 == $atts[ 'width' ] && 9999 == $atts[ 'height' ] ) {
+ // If there's no height or width, empty the array.
+ if ( 9999 == $atts['width'] && 9999 == $atts['height'] ) { // phpcs:ignore
$atts = array();
}
@@ -122,13 +130,13 @@ if ( ! function_exists( 'generate_blog_setup' ) ) {
generate_blog_get_defaults()
);
- // Move our featured images to above the title
- if ( 'post-image-above-header' == $settings['post_image_position'] ) {
+ // Move our featured images to above the title.
+ if ( 'post-image-above-header' === $settings['post_image_position'] ) {
remove_action( 'generate_after_entry_header', 'generate_post_image' );
add_action( 'generate_before_content', 'generate_post_image' );
- // If we're using the Page Header add-on, move those as well
- if ( function_exists('generate_page_header_post_image') ) {
+ // If we're using the Page Header add-on, move those as well.
+ if ( function_exists( 'generate_page_header_post_image' ) ) {
remove_action( 'generate_after_entry_header', 'generate_page_header_post_image' );
add_action( 'generate_before_content', 'generate_page_header_post_image' );
}
@@ -137,12 +145,13 @@ if ( ! function_exists( 'generate_blog_setup' ) ) {
$page_header_content = false;
if ( function_exists( 'generate_page_header_get_options' ) ) {
$options = generate_page_header_get_options();
- if ( '' !== $options[ 'content' ] ) {
+
+ if ( $options && '' !== $options['content'] ) {
$page_header_content = true;
}
- // If our Page Header has no content, remove it
- // This will allow the Blog add-on to add an image for us
+ // If our Page Header has no content, remove it.
+ // This will allow the Blog add-on to add an image for us.
if ( ! $page_header_content && is_singular() ) {
remove_action( 'generate_before_content', 'generate_page_header' );
remove_action( 'generate_after_entry_header', 'generate_page_header' );
@@ -150,23 +159,23 @@ if ( ! function_exists( 'generate_blog_setup' ) ) {
}
}
- // Remove the core theme featured image
- // I would like to filter instead one day
+ // Remove the core theme featured image.
+ // I would like to filter instead one day.
remove_action( 'generate_after_header', 'generate_featured_page_header' );
remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single' );
$location = generate_blog_get_singular_template();
- if ( $settings[$location . '_post_image'] && is_singular() && ! $page_header_content ) {
- if ( 'below-title' == $settings[$location . '_post_image_position'] ) {
+ if ( $settings[ $location . '_post_image' ] && is_singular() && ! $page_header_content ) {
+ if ( 'below-title' === $settings[ $location . '_post_image_position' ] ) {
add_action( 'generate_after_entry_header', 'generate_blog_single_featured_image' );
}
- if ( 'inside-content' == $settings[$location . '_post_image_position'] ) {
+ if ( 'inside-content' === $settings[ $location . '_post_image_position' ] ) {
add_action( 'generate_before_content', 'generate_blog_single_featured_image' );
}
- if ( 'above-content' == $settings[$location . '_post_image_position'] ) {
+ if ( 'above-content' === $settings[ $location . '_post_image_position' ] ) {
add_action( 'generate_after_header', 'generate_blog_single_featured_image' );
}
}
@@ -178,6 +187,7 @@ add_filter( 'generate_featured_image_output', 'generate_blog_featured_image' );
* Remove featured image if set or using WooCommerce.
*
* @since 1.5
+ * @param string $output The existing output.
* @return string The image HTML
*/
function generate_blog_featured_image( $output ) {
@@ -219,15 +229,27 @@ function generate_blog_single_featured_image() {
$location = generate_blog_get_singular_template();
- if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings[$location . '_post_image'] || ! $image_id ) {
+ if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings[ $location . '_post_image' ] || ! $image_id ) {
return false;
}
- $image_html = apply_filters( 'post_thumbnail_html',
- wp_get_attachment_image( $image_id, apply_filters( 'generate_page_header_default_size', 'full' ), '',
- array(
- 'itemprop' => 'image',
- )
+ $attrs = array(
+ 'itemprop' => 'image',
+ );
+
+ if ( function_exists( 'generate_get_schema_type' ) ) {
+ if ( 'microdata' !== generate_get_schema_type() ) {
+ $attrs = array();
+ }
+ }
+
+ $image_html = apply_filters(
+ 'post_thumbnail_html', // phpcs:ignore -- Core filter.
+ wp_get_attachment_image(
+ $image_id,
+ apply_filters( 'generate_page_header_default_size', 'full' ),
+ '',
+ $attrs
),
get_the_ID(),
$image_id,
@@ -240,18 +262,23 @@ function generate_blog_single_featured_image() {
$classes = array(
is_page() ? 'page-header-image' : null,
is_singular() && ! is_page() ? 'page-header-image-single' : null,
- 'above-content' == $settings[$location . '_post_image_position'] ? 'grid-container grid-parent' : null,
+ 'above-content' === $settings[ $location . '_post_image_position' ] ? 'grid-container grid-parent' : null,
);
$image_html = apply_filters( 'generate_single_featured_image_html', $image_html );
- echo apply_filters( 'generate_single_featured_image_output', sprintf(
- '
- %1$s
-
',
- $image_html,
- implode( ' ', $classes )
- ), $image_html );
+ // phpcs:ignore -- No need to escape here.
+ echo apply_filters(
+ 'generate_single_featured_image_output',
+ sprintf(
+ '
+ %1$s
+
',
+ $image_html,
+ implode( ' ', $classes )
+ ),
+ $image_html
+ );
}
add_filter( 'generate_blog_image_attributes', 'generate_blog_page_header_image_atts' );
@@ -274,13 +301,13 @@ function generate_blog_page_header_image_atts( $atts ) {
$options = generate_page_header_get_options();
- if ( 'enable' == $options[ 'image_resize' ] ) {
+ if ( $options && 'enable' === $options['image_resize'] ) {
$ignore_crop = array( '', '0', '9999' );
$atts = array(
- 'width' => ( in_array( $options[ 'image_width' ], $ignore_crop ) ) ? 9999 : absint( $options[ 'image_width' ] ),
- 'height' => ( in_array( $options[ 'image_height' ], $ignore_crop ) ) ? 9999 : absint( $options[ 'image_height' ] ),
- 'crop' => ( in_array( $options[ 'image_width' ], $ignore_crop ) || in_array( $options[ 'image_height' ], $ignore_crop ) ) ? false : true
+ 'width' => ( in_array( $options['image_width'], $ignore_crop ) ) ? 9999 : absint( $options['image_width'] ),
+ 'height' => ( in_array( $options['image_height'], $ignore_crop ) ) ? 9999 : absint( $options['image_height'] ),
+ 'crop' => ( in_array( $options['image_width'], $ignore_crop ) || in_array( $options['image_height'], $ignore_crop ) ) ? false : true,
);
}
@@ -304,7 +331,7 @@ function generate_blog_page_header_link( $image_html ) {
$options = generate_page_header_get_options();
if ( ! empty( $options['image_link'] ) ) {
- return '
' . $image_html . '';
+ return '
' . $image_html . '';
} else {
return $image_html;
}
diff --git a/wp-content/plugins/gp-premium/blog/functions/js/scripts.js b/wp-content/plugins/gp-premium/blog/functions/js/scripts.js
index f6603e2..adc0210 100644
--- a/wp-content/plugins/gp-premium/blog/functions/js/scripts.js
+++ b/wp-content/plugins/gp-premium/blog/functions/js/scripts.js
@@ -3,15 +3,7 @@ jQuery( document ).ready( function( $ ) {
var msnry = false;
if ( $masonry_container.length ) {
- var $grid = $masonry_container.masonry({
- columnWidth: '.grid-sizer',
- itemSelector: 'none',
- stamp: '.page-header',
- percentPosition: true,
- stagger: 30,
- visibleStyle: { transform: 'translateY(0)', opacity: 1 },
- hiddenStyle: { transform: 'translateY(5px)', opacity: 0 },
- } );
+ var $grid = $masonry_container.masonry( generateBlog.masonryInit );
msnry = $grid.data( 'masonry' );
@@ -37,22 +29,19 @@ jQuery( document ).ready( function( $ ) {
var $button = $( '.load-more a' );
var svgIcon = '';
- if ( blog.icon ) {
- svgIcon = blog.icon;
+ if ( generateBlog.icon ) {
+ svgIcon = generateBlog.icon;
}
- $container.infiniteScroll( {
- path: '.nav-links .next',
- append: '#main article',
- history: false,
- outlayer: msnry,
- loadOnScroll: $button.length ? false : true,
- button: $button.length ? '.load-more a' : null,
- scrollThreshold: $button.length ? false : 600,
- } );
+ var infiniteScrollInit = generateBlog.infiniteScrollInit;
+
+ infiniteScrollInit.outlayer = msnry;
+
+ $container.infiniteScroll( infiniteScrollInit );
$button.on( 'click', function( e ) {
- $( this ).html( svgIcon + blog.loading ).addClass( 'loading' );
+ document.activeElement.blur();
+ $( this ).html( svgIcon + generateBlog.loading ).addClass( 'loading' );
} );
$container.on( 'append.infiniteScroll', function( event, response, path, items ) {
@@ -60,8 +49,11 @@ jQuery( document ).ready( function( $ ) {
$container.append( $button.parent() );
}
+ // Fix srcset images not loading in Safari.
+ // img.outerHTML = img.outerHTML isn't minified properly, so we need the extra var.
$( items ).find( 'img' ).each( function( index, img ) {
- img.outerHTML = img.outerHTML;
+ var imgOuterHTML = img.outerHTML;
+ img.outerHTML = imgOuterHTML;
} );
if ( $grid ) {
@@ -70,7 +62,7 @@ jQuery( document ).ready( function( $ ) {
} );
}
- $button.html( svgIcon + blog.more ).removeClass( 'loading' );
+ $button.html( svgIcon + generateBlog.more ).removeClass( 'loading' );
} );
$container.on( 'last.infiniteScroll', function() {
diff --git a/wp-content/plugins/gp-premium/blog/functions/js/scripts.min.js b/wp-content/plugins/gp-premium/blog/functions/js/scripts.min.js
index 04870ae..2e3ecc1 100644
--- a/wp-content/plugins/gp-premium/blog/functions/js/scripts.min.js
+++ b/wp-content/plugins/gp-premium/blog/functions/js/scripts.min.js
@@ -1 +1 @@
-jQuery(document).ready(function(t){var n=t(".masonry-container"),o=!1;if(n.length){var i=n.masonry({columnWidth:".grid-sizer",itemSelector:"none",stamp:".page-header",percentPosition:!0,stagger:30,visibleStyle:{transform:"translateY(0)",opacity:1},hiddenStyle:{transform:"translateY(5px)",opacity:0}});o=i.data("masonry"),i.imagesLoaded(function(){i.masonry("layout"),i.removeClass("are-images-unloaded"),t(".load-more").removeClass("are-images-unloaded"),t("#nav-below").css("opacity","1"),i.masonry("option",{itemSelector:".masonry-post"});var n=i.find(".masonry-post");i.masonry("appended",n)}),t("#nav-below").insertAfter(".masonry-container"),t(window).on("orientationchange",function(n){i.masonry("layout")})}if(t(".infinite-scroll").length&&t(".nav-links .next").length){var l=t("#main article").first().parent(),r=t(".load-more a"),s="";blog.icon&&(s=blog.icon),l.infiniteScroll({path:".nav-links .next",append:"#main article",history:!1,outlayer:o,loadOnScroll:!r.length,button:r.length?".load-more a":null,scrollThreshold:!r.length&&600}),r.on("click",function(n){t(this).html(s+blog.loading).addClass("loading")}),l.on("append.infiniteScroll",function(n,o,e,a){t(".generate-columns-container").length||l.append(r.parent()),t(a).find("img").each(function(n,o){o.outerHTML=o.outerHTML}),i&&i.imagesLoaded(function(){i.masonry("layout")}),r.html(s+blog.more).removeClass("loading")}),l.on("last.infiniteScroll",function(){t(".load-more").hide()})}});
+jQuery(document).ready(function(t){var i,r,l,s,n,e=t(".masonry-container"),o=!1;e.length&&(o=(i=e.masonry(generateBlog.masonryInit)).data("masonry"),i.imagesLoaded(function(){i.masonry("layout"),i.removeClass("are-images-unloaded"),t(".load-more").removeClass("are-images-unloaded"),t("#nav-below").css("opacity","1"),i.masonry("option",{itemSelector:".masonry-post"});var n=i.find(".masonry-post");i.masonry("appended",n)}),t("#nav-below").insertAfter(".masonry-container"),t(window).on("orientationchange",function(n){i.masonry("layout")})),t(".infinite-scroll").length&&t(".nav-links .next").length&&(r=t("#main article").first().parent(),l=t(".load-more a"),s="",generateBlog.icon&&(s=generateBlog.icon),(n=generateBlog.infiniteScrollInit).outlayer=o,r.infiniteScroll(n),l.on("click",function(n){document.activeElement.blur(),t(this).html(s+generateBlog.loading).addClass("loading")}),r.on("append.infiniteScroll",function(n,e,o,a){t(".generate-columns-container").length||r.append(l.parent()),t(a).find("img").each(function(n,e){var o=e.outerHTML;e.outerHTML=o}),i&&i.imagesLoaded(function(){i.masonry("layout")}),l.html(s+generateBlog.more).removeClass("loading")}),r.on("last.infiniteScroll",function(){t(".load-more").hide()}))});
\ No newline at end of file
diff --git a/wp-content/plugins/gp-premium/blog/generate-blog.php b/wp-content/plugins/gp-premium/blog/generate-blog.php
index bd7f63d..49fd37f 100644
--- a/wp-content/plugins/gp-premium/blog/generate-blog.php
+++ b/wp-content/plugins/gp-premium/blog/generate-blog.php
@@ -1,17 +1,20 @@
register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' );
$wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' );
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
}
- // Get our palettes
+ // Get our palettes.
$palettes = generate_get_default_color_palettes();
- // Add our Colors panel
+ // Add our Colors panel.
if ( class_exists( 'WP_Customize_Panel' ) ) {
- $wp_customize->add_panel( 'generate_colors_panel', array(
- 'priority' => 30,
- 'theme_supports' => '',
- 'title' => __( 'Colors', 'gp-premium' ),
- 'description' => '',
- ) );
+ $wp_customize->add_panel(
+ 'generate_colors_panel',
+ array(
+ 'priority' => 30,
+ 'theme_supports' => '',
+ 'title' => __( 'Colors', 'gp-premium' ),
+ 'description' => '',
+ )
+ );
}
$wp_customize->add_control(
@@ -64,8 +74,8 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add Top Bar Colors section
- if ( isset( $defaults[ 'top_bar_background_color' ] ) && function_exists( 'generate_is_top_bar_active' ) ) {
+ // Add Top Bar Colors section.
+ if ( isset( $defaults['top_bar_background_color'] ) && function_exists( 'generate_is_top_bar_active' ) ) {
$wp_customize->add_section(
'generate_top_bar_colors',
array(
@@ -101,7 +111,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$top_bar_colors = array();
$top_bar_colors[] = array(
'slug' => 'top_bar_text_color',
@@ -122,13 +132,14 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'priority' => 4,
);
- foreach( $top_bar_colors as $color ) {
+ foreach ( $top_bar_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
- 'transport' => 'postMessage'
+ 'transport' => 'postMessage',
)
);
@@ -142,14 +153,14 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'settings' => 'generate_settings[' . $color['slug'] . ']',
'priority' => $color['priority'],
'palette' => $palettes,
- 'active_callback' => 'generate_is_top_bar_active'
+ 'active_callback' => 'generate_is_top_bar_active',
)
)
);
}
}
- // Add Header Colors section
+ // Add Header Colors section.
$wp_customize->add_section(
'header_color_section',
array(
@@ -202,7 +213,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$header_colors = array();
$header_colors[] = array(
'slug' => 'header_text_color',
@@ -235,13 +246,14 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'priority' => 6,
);
- foreach( $header_colors as $color ) {
+ foreach ( $header_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
- 'transport' => 'postMessage'
+ 'transport' => 'postMessage',
)
);
@@ -260,7 +272,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
}
- // Add Navigation section
+ // Add Navigation section.
$wp_customize->add_section(
'navigation_color_section',
array(
@@ -293,11 +305,11 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
$wp_customize,
'generate_primary_navigation_parent_items',
array(
- 'section' => 'navigation_color_section',
- 'type' => 'generatepress-customizer-title',
- 'title' => __( 'Parent Items', 'gp-premium' ),
+ 'section' => 'navigation_color_section',
+ 'type' => 'generatepress-customizer-title',
+ 'title' => __( 'Parent Items', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
- 'priority' => 1,
+ 'priority' => 1,
)
)
);
@@ -374,34 +386,35 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$navigation_colors = array();
$navigation_colors[] = array(
- 'slug'=>'navigation_text_color',
+ 'slug' => 'navigation_text_color',
'default' => $defaults['navigation_text_color'],
'label' => __( 'Text', 'gp-premium' ),
'priority' => 2,
);
$navigation_colors[] = array(
- 'slug'=>'navigation_text_hover_color',
+ 'slug' => 'navigation_text_hover_color',
'default' => $defaults['navigation_text_hover_color'],
'label' => __( 'Text Hover', 'gp-premium' ),
'priority' => 4,
);
$navigation_colors[] = array(
- 'slug'=>'navigation_text_current_color',
+ 'slug' => 'navigation_text_current_color',
'default' => $defaults['navigation_text_current_color'],
'label' => __( 'Text Current', 'gp-premium' ),
'priority' => 6,
);
- foreach( $navigation_colors as $color ) {
+ foreach ( $navigation_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
- 'transport' => 'postMessage'
+ 'transport' => 'postMessage',
)
);
@@ -413,7 +426,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'label' => $color['label'],
'section' => 'navigation_color_section',
'settings' => 'generate_settings[' . $color['slug'] . ']',
- 'priority' => $color['priority']
+ 'priority' => $color['priority'],
)
)
);
@@ -424,9 +437,9 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
$wp_customize,
'generate_primary_navigation_sub_menu_items',
array(
- 'section' => 'navigation_color_section',
- 'type' => 'generatepress-customizer-title',
- 'title' => __( 'Sub-Menu Items', 'gp-premium' ),
+ 'section' => 'navigation_color_section',
+ 'type' => 'generatepress-customizer-title',
+ 'title' => __( 'Sub-Menu Items', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
'priority' => 7,
)
@@ -505,29 +518,31 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$subnavigation_colors = array();
$subnavigation_colors[] = array(
- 'slug'=>'subnavigation_text_color',
+ 'slug' => 'subnavigation_text_color',
'default' => $defaults['subnavigation_text_color'],
'label' => __( 'Text', 'gp-premium' ),
'priority' => 9,
);
$subnavigation_colors[] = array(
- 'slug'=>'subnavigation_text_hover_color',
+ 'slug' => 'subnavigation_text_hover_color',
'default' => $defaults['subnavigation_text_hover_color'],
'label' => __( 'Text Hover', 'gp-premium' ),
'priority' => 11,
);
$subnavigation_colors[] = array(
- 'slug'=>'subnavigation_text_current_color',
+ 'slug' => 'subnavigation_text_current_color',
'default' => $defaults['subnavigation_text_current_color'],
'label' => __( 'Text Current', 'gp-premium' ),
'priority' => 13,
);
- foreach( $subnavigation_colors as $color ) {
+
+ foreach ( $subnavigation_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -555,9 +570,9 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
$wp_customize,
'generate_primary_navigation_search',
array(
- 'section' => 'navigation_color_section',
- 'type' => 'generatepress-customizer-title',
- 'title' => __( 'Navigation Search', 'gp-premium' ),
+ 'section' => 'navigation_color_section',
+ 'type' => 'generatepress-customizer-title',
+ 'title' => __( 'Navigation Search', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
'priority' => 15,
)
@@ -589,11 +604,12 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[navigation_search_text_color]', array(
+ 'generate_settings[navigation_search_text_color]',
+ array(
'default' => $defaults['navigation_search_text_color'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
- 'transport' => 'postMessage'
+ 'transport' => 'postMessage',
)
);
@@ -660,7 +676,8 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[form_button_text_color]', array(
+ 'generate_settings[form_button_text_color]',
+ array(
'default' => $defaults['form_button_text_color'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -704,7 +721,8 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[form_button_text_color_hover]', array(
+ 'generate_settings[form_button_text_color_hover]',
+ array(
'default' => $defaults['form_button_text_color_hover'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -724,7 +742,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add Content Colors section
+ // Add Content Colors section.
$wp_customize->add_section(
'content_color_section',
array(
@@ -776,7 +794,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$content_colors = array();
$content_colors[] = array(
'slug' => 'content_text_color',
@@ -869,9 +887,10 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
}
- foreach( $content_colors as $color ) {
+ foreach ( $content_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -893,7 +912,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
}
- // Add Sidebar Widget colors
+ // Add Sidebar Widget colors.
$wp_customize->add_section(
'sidebar_widget_color_section',
array(
@@ -945,7 +964,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$sidebar_widget_colors = array();
$sidebar_widget_colors[] = array(
'slug' => 'sidebar_widget_text_color',
@@ -972,9 +991,10 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'priority' => 5,
);
- foreach( $sidebar_widget_colors as $color ) {
+ foreach ( $sidebar_widget_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -996,7 +1016,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
}
- // Add Form colors
+ // Add Form colors.
$wp_customize->add_section(
'form_color_section',
array(
@@ -1102,7 +1122,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$form_colors = array();
$form_colors[] = array(
'slug' => 'form_text_color',
@@ -1117,9 +1137,10 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'priority' => 4,
);
- foreach( $form_colors as $color ) {
+ foreach ( $form_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -1141,7 +1162,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
}
- // Add Footer colors
+ // Add Footer colors.
$wp_customize->add_section(
'footer_color_section',
array(
@@ -1205,7 +1226,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$footer_widget_colors = array();
$footer_widget_colors[] = array(
'slug' => 'footer_widget_text_color',
@@ -1228,9 +1249,10 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'label' => __( 'Widget Title', 'gp-premium' ),
);
- foreach( $footer_widget_colors as $color ) {
+ foreach ( $footer_widget_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -1287,7 +1309,7 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
)
);
- // Add color settings
+ // Add color settings.
$footer_colors = array();
$footer_colors[] = array(
'slug' => 'footer_text_color',
@@ -1305,9 +1327,10 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
'label' => __( 'Link Hover', 'gp-premium' ),
);
- foreach( $footer_colors as $color ) {
+ foreach ( $footer_colors as $color ) {
$wp_customize->add_setting(
- 'generate_settings[' . $color['slug'] . ']', array(
+ 'generate_settings[' . $color['slug'] . ']',
+ array(
'default' => $color['default'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -1343,7 +1366,8 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[back_to_top_background_color]', array(
+ 'generate_settings[back_to_top_background_color]',
+ array(
'default' => $defaults['back_to_top_background_color'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_rgba',
@@ -1365,7 +1389,8 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[back_to_top_text_color]', array(
+ 'generate_settings[back_to_top_text_color]',
+ array(
'default' => $defaults['back_to_top_text_color'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_rgba',
@@ -1386,7 +1411,8 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[back_to_top_background_color_hover]', array(
+ 'generate_settings[back_to_top_background_color_hover]',
+ array(
'default' => $defaults['back_to_top_background_color_hover'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_rgba',
@@ -1408,7 +1434,8 @@ if ( ! function_exists( 'generate_colors_customize_register' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[back_to_top_text_color_hover]', array(
+ 'generate_settings[back_to_top_text_color_hover]',
+ array(
'default' => $defaults['back_to_top_text_color_hover'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_rgba',
@@ -1436,16 +1463,17 @@ if ( ! function_exists( 'generate_get_color_setting' ) ) {
* Wrapper function to get our settings
*
* @since 1.3.42
+ * @param string $setting The setting to check.
*/
function generate_get_color_setting( $setting ) {
- // Bail if we don't have our color defaults
+ // Bail if we don't have our color defaults.
if ( ! function_exists( 'generate_get_color_defaults' ) ) {
return;
}
if ( function_exists( 'generate_get_defaults' ) ) {
- $defaults = array_merge( generate_get_defaults(), generate_get_color_defaults() );
+ $defaults = array_merge( generate_get_defaults(), generate_get_color_defaults() );
} else {
$defaults = generate_get_color_defaults();
}
@@ -1462,10 +1490,12 @@ if ( ! function_exists( 'generate_get_color_setting' ) ) {
if ( ! function_exists( 'generate_colors_rgba_to_hex' ) ) {
/**
* Convert RGBA to hex if necessary
+ *
* @since 1.3.42
+ * @param string $rgba The string to convert to hex.
*/
function generate_colors_rgba_to_hex( $rgba ) {
- // If it's not rgba, return it
+ // If it's not rgba, return it.
if ( false === strpos( $rgba, 'rgba' ) ) {
return $rgba;
}
@@ -1489,7 +1519,7 @@ if ( ! function_exists( 'generate_get_default_color_palettes' ) ) {
'#F1C40F',
'#1e72bd',
'#1ABC9C',
- '#3498DB'
+ '#3498DB',
);
return apply_filters( 'generate_default_color_palettes', $palettes );
@@ -1505,16 +1535,16 @@ if ( ! function_exists( 'generate_enqueue_color_palettes' ) ) {
* @since 1.3.42
*/
function generate_enqueue_color_palettes() {
- // Old versions of WP don't get nice things
+ // Old versions of WP don't get nice things.
if ( ! function_exists( 'wp_add_inline_script' ) ) {
return;
}
- // Grab our palette array and turn it into JS
- $palettes = json_encode( generate_get_default_color_palettes() );
+ // Grab our palette array and turn it into JS.
+ $palettes = wp_json_encode( generate_get_default_color_palettes() );
- // Add our custom palettes
- // json_encode takes care of escaping
+ // Add our custom palettes.
+ // json_encode takes care of escaping.
wp_add_inline_script( 'wp-color-picker', 'jQuery.wp.wpColorPicker.prototype.options.palettes = ' . $palettes . ';' );
}
}
@@ -1528,27 +1558,27 @@ if ( ! function_exists( 'generate_colors_customizer_live_preview' ) ) {
*/
function generate_colors_customizer_live_preview() {
wp_enqueue_script(
- 'generate-colors-customizer',
- trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/customizer.js',
- array( 'jquery','customize-preview' ),
- GENERATE_COLORS_VERSION,
- true
+ 'generate-colors-customizer',
+ trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/customizer.js',
+ array( 'jquery', 'customize-preview' ),
+ GENERATE_COLORS_VERSION,
+ true
);
wp_register_script(
- 'generate-wc-colors-customizer',
- trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/wc-customizer.js',
- array( 'jquery','customize-preview', 'generate-colors-customizer' ),
- GENERATE_COLORS_VERSION,
- true
+ 'generate-wc-colors-customizer',
+ trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/wc-customizer.js',
+ array( 'jquery', 'customize-preview', 'generate-colors-customizer' ),
+ GENERATE_COLORS_VERSION,
+ true
);
wp_register_script(
- 'generate-menu-plus-colors-customizer',
- trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/menu-plus-customizer.js',
- array( 'jquery','customize-preview', 'generate-colors-customizer' ),
- GENERATE_COLORS_VERSION,
- true
+ 'generate-menu-plus-colors-customizer',
+ trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/menu-plus-customizer.js',
+ array( 'jquery', 'customize-preview', 'generate-colors-customizer' ),
+ GENERATE_COLORS_VERSION,
+ true
);
}
}
diff --git a/wp-content/plugins/gp-premium/colors/functions/js/customizer.js b/wp-content/plugins/gp-premium/colors/functions/js/customizer.js
index d0e099d..58e641b 100644
--- a/wp-content/plugins/gp-premium/colors/functions/js/customizer.js
+++ b/wp-content/plugins/gp-premium/colors/functions/js/customizer.js
@@ -129,7 +129,8 @@ generate_colors_live_update( 'navigation_text_color',
button.menu-toggle:focus,\
.main-navigation .mobile-bar-items a,\
.main-navigation .mobile-bar-items a:hover,\
- .main-navigation .mobile-bar-items a:focus',
+ .main-navigation .mobile-bar-items a:focus,\
+ .main-navigation .menu-bar-items',
'color', '', 'link_color'
);
@@ -143,7 +144,8 @@ generate_colors_live_update( 'navigation_text_hover_color',
.navigation-search input[type="search"]:focus,\
.main-navigation .main-nav ul li:hover > a,\
.main-navigation .main-nav ul li:focus > a,\
- .main-navigation .main-nav ul li.sfHover > a',
+ .main-navigation .main-nav ul li.sfHover > a,\
+ .main-navigation .menu-bar-item:hover a',
'color', '', 'link_color_hover'
);
@@ -156,7 +158,8 @@ generate_colors_live_update( 'navigation_background_hover_color',
.navigation-search input[type="search"]:focus,\
.main-navigation .main-nav ul li:hover > a,\
.main-navigation .main-nav ul li:focus > a,\
- .main-navigation .main-nav ul li.sfHover > a',
+ .main-navigation .main-nav ul li.sfHover > a,\
+ .main-navigation .menu-bar-item:hover a',
'background-color', 'transparent'
);
@@ -245,7 +248,9 @@ generate_colors_live_update( 'navigation_text_color',
button.secondary-menu-toggle:hover,\
button.secondary-menu-toggle:focus, \
.secondary-navigation .top-bar, \
- .secondary-navigation .top-bar a',
+ .secondary-navigation .top-bar a,\
+ .secondary-menu-bar-items,\
+ .secondary-menu-bar-items .menu-bar-item > a',
'color', '', 'link_color', 'generate_secondary_nav_settings'
);
@@ -290,7 +295,8 @@ generate_colors_live_update( 'navigation_search_text_color', '.navigation-search
generate_colors_live_update( 'navigation_text_hover_color',
'.secondary-navigation .main-nav ul li:hover > a, \
.secondary-navigation .main-nav ul li:focus > a, \
- .secondary-navigation .main-nav ul li.sfHover > a',
+ .secondary-navigation .main-nav ul li.sfHover > a,\
+ .secondary-menu-bar-items .menu-bar-item:hover > a',
'color', '', 'link_color_hover', 'generate_secondary_nav_settings'
);
@@ -301,7 +307,8 @@ generate_colors_live_update( 'navigation_text_hover_color',
generate_colors_live_update( 'navigation_background_hover_color',
'.secondary-navigation .main-nav ul li:hover > a, \
.secondary-navigation .main-nav ul li:focus > a, \
- .secondary-navigation .main-nav ul li.sfHover > a',
+ .secondary-navigation .main-nav ul li.sfHover > a, \
+ .secondary-menu-bar-items .menu-bar-item:hover > a',
'background-color', 'transparent', '', 'generate_secondary_nav_settings'
);
diff --git a/wp-content/plugins/gp-premium/colors/functions/secondary-nav-colors.php b/wp-content/plugins/gp-premium/colors/functions/secondary-nav-colors.php
index 440c100..e28ff43 100644
--- a/wp-content/plugins/gp-premium/colors/functions/secondary-nav-colors.php
+++ b/wp-content/plugins/gp-premium/colors/functions/secondary-nav-colors.php
@@ -1,6 +1,12 @@
get_section( 'secondary_nav_section' ) ) {
return;
}
- // Bail if we don't have our color defaults
+ // Bail if we don't have our color defaults.
if ( ! function_exists( 'generate_secondary_nav_get_defaults' ) ) {
return;
}
- // Add our controls
+ // Add our controls.
require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';
- // Get our defaults
+ // Get our defaults.
$defaults = generate_secondary_nav_get_defaults();
- // Add control types so controls can be built using JS
+ // Add control types so controls can be built using JS.
if ( method_exists( $wp_customize, 'register_control_type' ) ) {
$wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' );
$wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' );
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
}
- // Get our palettes
+ // Get our palettes.
$palettes = generate_get_default_color_palettes();
- // Add Secondary Navigation section
+ // Add Secondary Navigation section.
$wp_customize->add_section(
'secondary_navigation_color_section',
array(
@@ -78,17 +86,18 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
$wp_customize,
'generate_secondary_navigation_items',
array(
- 'section' => 'secondary_navigation_color_section',
- 'type' => 'generatepress-customizer-title',
- 'title' => __( 'Parent Items', 'gp-premium' ),
+ 'section' => 'secondary_navigation_color_section',
+ 'type' => 'generatepress-customizer-title',
+ 'title' => __( 'Parent Items', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
- // Background
+ // Background.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[navigation_background_color]', array(
+ 'generate_secondary_nav_settings[navigation_background_color]',
+ array(
'default' => $defaults['navigation_background_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -110,9 +119,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Text
+ // Text.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[navigation_text_color]', array(
+ 'generate_secondary_nav_settings[navigation_text_color]',
+ array(
'default' => $defaults['navigation_text_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -133,9 +143,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Background hover
+ // Background hover.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[navigation_background_hover_color]', array(
+ 'generate_secondary_nav_settings[navigation_background_hover_color]',
+ array(
'default' => $defaults['navigation_background_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -157,9 +168,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Text hover
+ // Text hover.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[navigation_text_hover_color]', array(
+ 'generate_secondary_nav_settings[navigation_text_hover_color]',
+ array(
'default' => $defaults['navigation_text_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -180,9 +192,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Background current
+ // Background current.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[navigation_background_current_color]', array(
+ 'generate_secondary_nav_settings[navigation_background_current_color]',
+ array(
'default' => $defaults['navigation_background_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -204,9 +217,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Text current
+ // Text current.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[navigation_text_current_color]', array(
+ 'generate_secondary_nav_settings[navigation_text_current_color]',
+ array(
'default' => $defaults['navigation_text_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -232,17 +246,18 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
$wp_customize,
'generate_secondary_navigation_sub_menu_items',
array(
- 'section' => 'secondary_navigation_color_section',
- 'type' => 'generatepress-customizer-title',
- 'title' => __( 'Sub-Menu Items', 'gp-premium' ),
+ 'section' => 'secondary_navigation_color_section',
+ 'type' => 'generatepress-customizer-title',
+ 'title' => __( 'Sub-Menu Items', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
- // Background
+ // Background.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[subnavigation_background_color]', array(
+ 'generate_secondary_nav_settings[subnavigation_background_color]',
+ array(
'default' => $defaults['subnavigation_background_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -264,9 +279,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Text
+ // Text.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[subnavigation_text_color]', array(
+ 'generate_secondary_nav_settings[subnavigation_text_color]',
+ array(
'default' => $defaults['subnavigation_text_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -287,9 +303,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Background hover
+ // Background hover.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[subnavigation_background_hover_color]', array(
+ 'generate_secondary_nav_settings[subnavigation_background_hover_color]',
+ array(
'default' => $defaults['subnavigation_background_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -311,9 +328,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Text hover
+ // Text hover.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[subnavigation_text_hover_color]', array(
+ 'generate_secondary_nav_settings[subnavigation_text_hover_color]',
+ array(
'default' => $defaults['subnavigation_text_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -334,9 +352,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Background current
+ // Background current.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[subnavigation_background_current_color]', array(
+ 'generate_secondary_nav_settings[subnavigation_background_current_color]',
+ array(
'default' => $defaults['subnavigation_background_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -358,9 +377,10 @@ if ( ! function_exists( 'generate_colors_secondary_nav_customizer' ) ) {
)
);
- // Text current
+ // Text current.
$wp_customize->add_setting(
- 'generate_secondary_nav_settings[subnavigation_text_current_color]', array(
+ 'generate_secondary_nav_settings[subnavigation_text_current_color]',
+ array(
'default' => $defaults['subnavigation_text_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
diff --git a/wp-content/plugins/gp-premium/colors/functions/slideout-nav-colors.php b/wp-content/plugins/gp-premium/colors/functions/slideout-nav-colors.php
index be25a5e..f479dd6 100644
--- a/wp-content/plugins/gp-premium/colors/functions/slideout-nav-colors.php
+++ b/wp-content/plugins/gp-premium/colors/functions/slideout-nav-colors.php
@@ -1,9 +1,18 @@
get_section( 'menu_plus_slideout_menu' ) ) {
return;
}
- // Bail if we don't have our color defaults
+ // Bail if we don't have our color defaults.
if ( ! function_exists( 'generate_get_color_defaults' ) ) {
return;
}
- // Add our controls
+ // Add our controls.
require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';
- // Get our defaults
+ // Get our defaults.
$defaults = generate_get_color_defaults();
- // Add control types so controls can be built using JS
+ // Add control types so controls can be built using JS.
if ( method_exists( $wp_customize, 'register_control_type' ) ) {
$wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' );
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
}
- // Get our palettes
+ // Get our palettes.
$palettes = generate_get_default_color_palettes();
- // Add Secondary Navigation section
+ // Add Secondary Navigation section.
$wp_customize->add_section(
'slideout_color_section',
array(
@@ -73,17 +83,18 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
$wp_customize,
'generate_slideout_navigation_items',
array(
- 'section' => 'slideout_color_section',
- 'type' => 'generatepress-customizer-title',
- 'title' => __( 'Parent Menu Items', 'gp-premium' ),
+ 'section' => 'slideout_color_section',
+ 'type' => 'generatepress-customizer-title',
+ 'title' => __( 'Parent Menu Items', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
- // Background
+ // Background.
$wp_customize->add_setting(
- 'generate_settings[slideout_background_color]', array(
+ 'generate_settings[slideout_background_color]',
+ array(
'default' => $defaults['slideout_background_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -105,9 +116,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Text
+ // Text.
$wp_customize->add_setting(
- 'generate_settings[slideout_text_color]', array(
+ 'generate_settings[slideout_text_color]',
+ array(
'default' => $defaults['slideout_text_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -128,9 +140,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Background hover
+ // Background hover.
$wp_customize->add_setting(
- 'generate_settings[slideout_background_hover_color]', array(
+ 'generate_settings[slideout_background_hover_color]',
+ array(
'default' => $defaults['slideout_background_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -152,9 +165,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Text hover
+ // Text hover.
$wp_customize->add_setting(
- 'generate_settings[slideout_text_hover_color]', array(
+ 'generate_settings[slideout_text_hover_color]',
+ array(
'default' => $defaults['slideout_text_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -175,9 +189,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Background current
+ // Background current.
$wp_customize->add_setting(
- 'generate_settings[slideout_background_current_color]', array(
+ 'generate_settings[slideout_background_current_color]',
+ array(
'default' => $defaults['slideout_background_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -199,9 +214,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Text current
+ // Text current.
$wp_customize->add_setting(
- 'generate_settings[slideout_text_current_color]', array(
+ 'generate_settings[slideout_text_current_color]',
+ array(
'default' => $defaults['slideout_text_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -227,17 +243,18 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
$wp_customize,
'generate_slideout_navigation_sub_menu_items',
array(
- 'section' => 'slideout_color_section',
- 'type' => 'generatepress-customizer-title',
- 'title' => __( 'Sub-Menu Items', 'gp-premium' ),
+ 'section' => 'slideout_color_section',
+ 'type' => 'generatepress-customizer-title',
+ 'title' => __( 'Sub-Menu Items', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
- // Background
+ // Background.
$wp_customize->add_setting(
- 'generate_settings[slideout_submenu_background_color]', array(
+ 'generate_settings[slideout_submenu_background_color]',
+ array(
'default' => $defaults['slideout_submenu_background_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -259,9 +276,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Text
+ // Text.
$wp_customize->add_setting(
- 'generate_settings[slideout_submenu_text_color]', array(
+ 'generate_settings[slideout_submenu_text_color]',
+ array(
'default' => $defaults['slideout_submenu_text_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -282,9 +300,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Background hover
+ // Background hover.
$wp_customize->add_setting(
- 'generate_settings[slideout_submenu_background_hover_color]', array(
+ 'generate_settings[slideout_submenu_background_hover_color]',
+ array(
'default' => $defaults['slideout_submenu_background_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -306,9 +325,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Text hover
+ // Text hover.
$wp_customize->add_setting(
- 'generate_settings[slideout_submenu_text_hover_color]', array(
+ 'generate_settings[slideout_submenu_text_hover_color]',
+ array(
'default' => $defaults['slideout_submenu_text_hover_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -329,9 +349,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Background current
+ // Background current.
$wp_customize->add_setting(
- 'generate_settings[slideout_submenu_background_current_color]', array(
+ 'generate_settings[slideout_submenu_background_current_color]',
+ array(
'default' => $defaults['slideout_submenu_background_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -353,9 +374,10 @@ function generate_slideout_navigation_color_controls( $wp_customize ) {
)
);
- // Text current
+ // Text current.
$wp_customize->add_setting(
- 'generate_settings[slideout_submenu_text_current_color]', array(
+ 'generate_settings[slideout_submenu_text_current_color]',
+ array(
'default' => $defaults['slideout_submenu_text_current_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
diff --git a/wp-content/plugins/gp-premium/colors/functions/woocommerce-colors.php b/wp-content/plugins/gp-premium/colors/functions/woocommerce-colors.php
index 0ba6412..6c45381 100644
--- a/wp-content/plugins/gp-premium/colors/functions/woocommerce-colors.php
+++ b/wp-content/plugins/gp-premium/colors/functions/woocommerce-colors.php
@@ -1,16 +1,23 @@
get_section( 'generate_woocommerce_colors' ) ) {
return;
}
@@ -19,13 +26,13 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
return;
}
- // Add our controls
+ // Add our controls.
require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';
- // Get our defaults
+ // Get our defaults.
$defaults = generate_get_color_defaults();
- // Add control types so controls can be built using JS
+ // Add control types so controls can be built using JS.
if ( method_exists( $wp_customize, 'register_control_type' ) ) {
$wp_customize->register_control_type( 'GeneratePress_Alpha_Color_Customize_Control' );
$wp_customize->register_control_type( 'GeneratePress_Title_Customize_Control' );
@@ -33,7 +40,7 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
$wp_customize->register_control_type( 'GeneratePress_Section_Shortcut_Control' );
}
- // Get our palettes
+ // Get our palettes.
$palettes = generate_get_default_color_palettes();
$wp_customize->add_control(
@@ -61,7 +68,7 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
'section' => 'generate_woocommerce_colors',
'type' => 'generatepress-customizer-title',
'title' => __( 'Buttons', 'gp-premium' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
@@ -71,10 +78,10 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
$wp_customize,
'generate_woocommerce_primary_button_message',
array(
- 'section' => 'generate_woocommerce_colors',
- 'label' => __( 'Primary Button Colors','generate-woocommerce' ),
- 'description' => __( 'Primary button colors can be set
here.','generate-woocommerce' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'section' => 'generate_woocommerce_colors',
+ 'label' => __( 'Primary Button Colors', 'gp-premium' ),
+ 'description' => __( 'Primary button colors can be set
here.', 'gp-premium' ),
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
@@ -128,7 +135,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_alt_button_text]', array(
+ 'generate_settings[wc_alt_button_text]',
+ array(
'default' => $defaults['wc_alt_button_text'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -149,9 +157,9 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
)
);
-
$wp_customize->add_setting(
- 'generate_settings[wc_alt_button_text_hover]', array(
+ 'generate_settings[wc_alt_button_text_hover]',
+ array(
'default' => $defaults['wc_alt_button_text_hover'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -180,13 +188,14 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
'section' => 'generate_woocommerce_colors',
'type' => 'generatepress-customizer-title',
'title' => __( 'Products', 'gp-premium' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
$wp_customize->add_setting(
- 'generate_settings[wc_product_title_color]', array(
+ 'generate_settings[wc_product_title_color]',
+ array(
'default' => $defaults['wc_product_title_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -208,7 +217,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_product_title_color_hover]', array(
+ 'generate_settings[wc_product_title_color_hover]',
+ array(
'default' => $defaults['wc_product_title_color_hover'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -278,7 +288,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_sale_sticker_text]', array(
+ 'generate_settings[wc_sale_sticker_text]',
+ array(
'default' => $defaults['wc_sale_sticker_text'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -300,7 +311,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_price_color]', array(
+ 'generate_settings[wc_price_color]',
+ array(
'default' => $defaults['wc_price_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -329,7 +341,7 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
'section' => 'generate_woocommerce_colors',
'type' => 'generatepress-customizer-title',
'title' => __( 'Sticky Panel Cart', 'gp-premium' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
@@ -359,7 +371,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_panel_cart_text_color]', array(
+ 'generate_settings[wc_panel_cart_text_color]',
+ array(
'default' => $defaults['wc_panel_cart_text_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -381,7 +394,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_panel_cart_button_background]', array(
+ 'generate_settings[wc_panel_cart_button_background]',
+ array(
'default' => $defaults['wc_panel_cart_button_background'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -403,7 +417,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_panel_cart_button_background_hover]', array(
+ 'generate_settings[wc_panel_cart_button_background_hover]',
+ array(
'default' => $defaults['wc_panel_cart_button_background_hover'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -425,7 +440,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_panel_cart_button_text]', array(
+ 'generate_settings[wc_panel_cart_button_text]',
+ array(
'default' => $defaults['wc_panel_cart_button_text'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -447,7 +463,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_panel_cart_button_text_hover]', array(
+ 'generate_settings[wc_panel_cart_button_text_hover]',
+ array(
'default' => $defaults['wc_panel_cart_button_text_hover'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -476,7 +493,7 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
'section' => 'generate_woocommerce_colors',
'type' => 'generatepress-customizer-title',
'title' => __( 'Menu Mini Cart', 'gp-premium' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
@@ -506,7 +523,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_mini_cart_text_color]', array(
+ 'generate_settings[wc_mini_cart_text_color]',
+ array(
'default' => $defaults['wc_mini_cart_text_color'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -528,7 +546,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_mini_cart_button_background]', array(
+ 'generate_settings[wc_mini_cart_button_background]',
+ array(
'default' => $defaults['wc_mini_cart_button_background'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -550,7 +569,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_mini_cart_button_background_hover]', array(
+ 'generate_settings[wc_mini_cart_button_background_hover]',
+ array(
'default' => $defaults['wc_mini_cart_button_background_hover'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -572,7 +592,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_mini_cart_button_text]', array(
+ 'generate_settings[wc_mini_cart_button_text]',
+ array(
'default' => $defaults['wc_mini_cart_button_text'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -594,7 +615,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_mini_cart_button_text_hover]', array(
+ 'generate_settings[wc_mini_cart_button_text_hover]',
+ array(
'default' => $defaults['wc_mini_cart_button_text_hover'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -623,13 +645,14 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
'section' => 'generate_woocommerce_colors',
'type' => 'generatepress-customizer-title',
'title' => __( 'Price Slider Widget', 'gp-premium' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
$wp_customize->add_setting(
- 'generate_settings[wc_price_slider_background_color]', array(
+ 'generate_settings[wc_price_slider_background_color]',
+ array(
'default' => $defaults['wc_price_slider_background_color'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -650,7 +673,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_price_slider_bar_color]', array(
+ 'generate_settings[wc_price_slider_bar_color]',
+ array(
'default' => $defaults['wc_price_slider_bar_color'],
'type' => 'option',
'sanitize_callback' => 'generate_premium_sanitize_hex_color',
@@ -678,13 +702,14 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
'section' => 'generate_woocommerce_colors',
'type' => 'generatepress-customizer-title',
'title' => __( 'Product Tabs', 'gp-premium' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
$wp_customize->add_setting(
- 'generate_settings[wc_product_tab]', array(
+ 'generate_settings[wc_product_tab]',
+ array(
'default' => $defaults['wc_product_tab'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -706,7 +731,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_product_tab_highlight]', array(
+ 'generate_settings[wc_product_tab_highlight]',
+ array(
'default' => $defaults['wc_product_tab_highlight'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -735,7 +761,7 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
'section' => 'generate_woocommerce_colors',
'type' => 'generatepress-customizer-title',
'title' => __( 'Messages', 'gp-premium' ),
- 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
+ 'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
)
)
);
@@ -765,7 +791,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_success_message_text]', array(
+ 'generate_settings[wc_success_message_text]',
+ array(
'default' => $defaults['wc_success_message_text'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -811,7 +838,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_info_message_text]', array(
+ 'generate_settings[wc_info_message_text]',
+ array(
'default' => $defaults['wc_info_message_text'],
'type' => 'option',
'capability' => 'edit_theme_options',
@@ -857,7 +885,8 @@ if ( ! function_exists( 'generate_colors_wc_customizer' ) ) {
);
$wp_customize->add_setting(
- 'generate_settings[wc_error_message_text]', array(
+ 'generate_settings[wc_error_message_text]',
+ array(
'default' => $defaults['wc_error_message_text'],
'type' => 'option',
'capability' => 'edit_theme_options',
diff --git a/wp-content/plugins/gp-premium/colors/generate-colors.php b/wp-content/plugins/gp-premium/colors/generate-colors.php
index 9de9aa2..a90e5c4 100644
--- a/wp-content/plugins/gp-premium/colors/generate-colors.php
+++ b/wp-content/plugins/gp-premium/colors/generate-colors.php
@@ -1,19 +1,20 @@
register_control_type( 'GeneratePress_Copyright_Customize_Control' );
}
- // Copyright
$wp_customize->add_setting(
'generate_copyright',
array(
@@ -31,23 +37,27 @@ if ( ! function_exists( 'generate_copyright_customize_register' ) ) {
$wp_customize->add_control(
new GeneratePress_Copyright_Customize_Control(
- $wp_customize,
- 'generate_copyright',
- array(
- 'label' => __( 'Copyright', 'gp-premium' ),
- 'section' => 'generate_layout_footer',
- 'settings' => 'generate_copyright',
- 'priority' => 500,
- ) )
+ $wp_customize,
+ 'generate_copyright',
+ array(
+ 'label' => __( 'Copyright', 'gp-premium' ),
+ 'section' => 'generate_layout_footer',
+ 'settings' => 'generate_copyright',
+ 'priority' => 500,
+ )
+ )
);
- // Initiate selective refresh
+ // Initiate selective refresh.
if ( isset( $wp_customize->selective_refresh ) ) {
- $wp_customize->selective_refresh->add_partial( 'generate_copyright', array(
- 'selector' => '.copyright-bar',
- 'settings' => array( 'generate_copyright' ),
- 'render_callback' => 'generate_copyright_selective_refresh',
- ) );
+ $wp_customize->selective_refresh->add_partial(
+ 'generate_copyright',
+ array(
+ 'selector' => '.copyright-bar',
+ 'settings' => array( 'generate_copyright' ),
+ 'render_callback' => 'generate_copyright_selective_refresh',
+ )
+ );
}
}
}
@@ -59,12 +69,12 @@ if ( ! function_exists( 'generate_copyright_selective_refresh' ) ) {
function generate_copyright_selective_refresh() {
$options = array(
'%current_year%',
- '%copy%'
+ '%copy%',
);
$replace = array(
- date('Y'),
- '©'
+ date( 'Y' ), // phpcs:ignore -- prefer date().
+ '©',
);
$new_copyright = get_theme_mod( 'generate_copyright' );
@@ -77,20 +87,21 @@ if ( ! function_exists( 'generate_copyright_selective_refresh' ) ) {
if ( ! function_exists( 'generate_copyright_remove_default' ) ) {
add_action( 'wp', 'generate_copyright_remove_default' );
/**
- * Remove the default copyright
+ * Remove the default copyright.
+ *
* @since 0.1
* @deprecated GP 1.3.42
*/
function generate_copyright_remove_default() {
- // As of 1.3.42, we no longer need to do this
- // We use a nice little filter instead
+ // As of 1.3.42, we no longer need to do this.
+ // We use a nice little filter instead.
if ( ! function_exists( 'generate_add_login_attribution' ) ) {
return;
}
if ( get_theme_mod( 'generate_copyright' ) && '' !== get_theme_mod( 'generate_copyright' ) ) {
remove_action( 'generate_credits', 'generate_add_footer_info' );
- remove_action( 'generate_copyright_line','generate_add_login_attribution' );
+ remove_action( 'generate_copyright_line', 'generate_add_login_attribution' );
}
}
}
@@ -98,25 +109,26 @@ if ( ! function_exists( 'generate_copyright_remove_default' ) ) {
if ( ! function_exists( 'generate_copyright_add_custom' ) ) {
add_action( 'generate_credits', 'generate_copyright_add_custom' );
/**
- * Add the custom copyright
+ * Add the custom copyright.
+ *
* @since 0.1
* @deprecated GP 1.3.42
*/
function generate_copyright_add_custom() {
- // As of 1.3.42, we no longer need to do this
- // We use a nice little filter instead
+ // As of 1.3.42, we no longer need to do this.
+ // We use a nice little filter instead.
if ( ! function_exists( 'generate_add_login_attribution' ) ) {
return;
}
$options = array(
'%current_year%',
- '%copy%'
+ '%copy%',
);
$replace = array(
- date('Y'),
- '©'
+ date( 'Y' ), // phpcs:ignore -- prefer date().
+ '©',
);
$new_copyright = get_theme_mod( 'generate_copyright' );
@@ -134,21 +146,22 @@ if ( ! function_exists( 'generate_apply_custom_copyright' ) ) {
* Add the custom copyright
*
* @since 1.2.92
+ * @param string $copyright The copyright value.
*/
function generate_apply_custom_copyright( $copyright ) {
- // This will only work if GP >= 1.3.42 and the below function doesn't exist
+ // This will only work if GP >= 1.3.42 and the below function doesn't exist.
if ( function_exists( 'generate_add_login_attribution' ) ) {
return;
}
$options = array(
'%current_year%',
- '%copy%'
+ '%copy%',
);
$replace = array(
- date('Y'),
- '©'
+ date( 'Y' ), // phpcs:ignore -- prefer date().
+ '©',
);
$new_copyright = get_theme_mod( 'generate_copyright' );
@@ -170,11 +183,11 @@ if ( ! function_exists( 'generate_copyright_customizer_live_preview' ) ) {
*/
function generate_copyright_customizer_live_preview() {
wp_enqueue_script(
- 'generate-copyright-customizer',
- plugin_dir_url( __FILE__ ) . 'js/customizer.js',
- array( 'jquery','customize-preview' ),
- GENERATE_COPYRIGHT_VERSION,
- true
+ 'generate-copyright-customizer',
+ plugin_dir_url( __FILE__ ) . 'js/customizer.js',
+ array( 'jquery', 'customize-preview' ),
+ GENERATE_COPYRIGHT_VERSION,
+ true
);
}
}
@@ -202,7 +215,7 @@ if ( ! function_exists( 'generate_update_copyright' ) ) {
// Now let's update the new logo setting with our ID.
set_theme_mod( 'generate_copyright', $old_value );
- // Got our custom logo? Time to delete the old value
+ // Got our custom logo? Time to delete the old value.
if ( get_theme_mod( 'generate_copyright' ) ) {
delete_option( 'gen_custom_copyright' );
}
diff --git a/wp-content/plugins/gp-premium/copyright/generate-copyright.php b/wp-content/plugins/gp-premium/copyright/generate-copyright.php
index f09491f..2b9ce0b 100644
--- a/wp-content/plugins/gp-premium/copyright/generate-copyright.php
+++ b/wp-content/plugins/gp-premium/copyright/generate-copyright.php
@@ -1,19 +1,20 @@
ID, '_generate-disable-header', true );
$disable_nav = get_post_meta( $post->ID, '_generate-disable-nav', true );
@@ -47,7 +53,13 @@ if ( ! function_exists( 'generate_disable_elements' ) ) {
$return .= '.generate-page-header, .page-header-image, .page-header-image-single {display:none}';
}
- if ( ( ! empty( $disable_headline ) && false !== $disable_headline ) && ! is_single() ) {
+ $need_css_removal = true;
+
+ if ( defined( 'GENERATE_VERSION' ) && version_compare( GENERATE_VERSION, '3.0.0-alpha.1', '>=' ) ) {
+ $need_css_removal = false;
+ }
+
+ if ( $need_css_removal && ! empty( $disable_headline ) && false !== $disable_headline && ! is_single() ) {
$return .= '.entry-header {display:none} .page-content, .entry-content, .entry-summary {margin-top:0}';
}
@@ -59,7 +71,7 @@ if ( ! function_exists( 'generate_disable_elements' ) ) {
}
}
-if ( ! function_exists('generate_de_scripts') ) {
+if ( ! function_exists( 'generate_de_scripts' ) ) {
add_action( 'wp_enqueue_scripts', 'generate_de_scripts', 50 );
/**
* Enqueue scripts and styles
@@ -69,7 +81,7 @@ if ( ! function_exists('generate_de_scripts') ) {
}
}
-if ( ! function_exists('generate_add_de_meta_box') ) {
+if ( ! function_exists( 'generate_add_de_meta_box' ) ) {
add_action( 'add_meta_boxes', 'generate_add_de_meta_box', 50 );
/**
* Generate the layout metabox.
@@ -77,10 +89,10 @@ if ( ! function_exists('generate_add_de_meta_box') ) {
* @since 0.1
*/
function generate_add_de_meta_box() {
- // Set user role - make filterable
+ // Set user role - make filterable.
$allowed = apply_filters( 'generate_metabox_capability', 'edit_theme_options' );
- // If not an administrator, don't show the metabox
+ // If not an administrator, don't show the metabox.
if ( ! current_user_can( $allowed ) ) {
return;
}
@@ -91,7 +103,7 @@ if ( ! function_exists('generate_add_de_meta_box') ) {
$args = array( 'public' => true );
$post_types = get_post_types( $args );
- foreach ($post_types as $type) {
+ foreach ( $post_types as $type ) {
if ( 'attachment' !== $type ) {
add_meta_box(
'generate_de_meta_box',
@@ -106,13 +118,15 @@ if ( ! function_exists('generate_add_de_meta_box') ) {
}
}
-if ( ! function_exists('generate_show_de_meta_box') ) {
+if ( ! function_exists( 'generate_show_de_meta_box' ) ) {
/**
- * Outputs the content of the metabox
+ * Outputs the content of the metabox.
+ *
+ * @param object $post The post object.
*/
function generate_show_de_meta_box( $post ) {
- wp_nonce_field( basename( __FILE__ ), 'generate_de_nonce' );
- $stored_meta = get_post_meta( $post->ID );
+ wp_nonce_field( basename( __FILE__ ), 'generate_de_nonce' );
+ $stored_meta = get_post_meta( $post->ID );
$stored_meta['_generate-disable-header'][0] = ( isset( $stored_meta['_generate-disable-header'][0] ) ) ? $stored_meta['_generate-disable-header'][0] : '';
$stored_meta['_generate-disable-nav'][0] = ( isset( $stored_meta['_generate-disable-nav'][0] ) ) ? $stored_meta['_generate-disable-nav'][0] : '';
$stored_meta['_generate-disable-secondary-nav'][0] = ( isset( $stored_meta['_generate-disable-secondary-nav'][0] ) ) ? $stored_meta['_generate-disable-secondary-nav'][0] : '';
@@ -120,59 +134,61 @@ if ( ! function_exists('generate_show_de_meta_box') ) {
$stored_meta['_generate-disable-headline'][0] = ( isset( $stored_meta['_generate-disable-headline'][0] ) ) ? $stored_meta['_generate-disable-headline'][0] : '';
$stored_meta['_generate-disable-footer'][0] = ( isset( $stored_meta['_generate-disable-footer'][0] ) ) ? $stored_meta['_generate-disable-footer'][0] : '';
$stored_meta['_generate-disable-top-bar'][0] = ( isset( $stored_meta['_generate-disable-top-bar'][0] ) ) ? $stored_meta['_generate-disable-top-bar'][0] : '';
- ?>
+ ?>
-
+
-
- ID, '_generate-disable-top-bar', true );
$disable_header = get_post_meta( $post->ID, '_generate-disable-header', true );
+ $disable_mobile_header = get_post_meta( $post->ID, '_generate-disable-mobile-header', true );
$disable_nav = get_post_meta( $post->ID, '_generate-disable-nav', true );
$disable_headline = get_post_meta( $post->ID, '_generate-disable-headline', true );
$disable_footer = get_post_meta( $post->ID, '_generate-disable-footer', true );
}
- // Remove the top bar
+ // Remove the top bar.
if ( ! empty( $disable_top_bar ) && false !== $disable_top_bar && function_exists( 'generate_top_bar' ) ) {
- remove_action( 'generate_before_header','generate_top_bar', 5 );
+ remove_action( 'generate_before_header', 'generate_top_bar', 5 );
+ remove_action( 'generate_inside_secondary_navigation', 'generate_secondary_nav_top_bar_widget', 5 );
}
- // Remove the header
+ // Remove the header.
if ( ! empty( $disable_header ) && false !== $disable_header && function_exists( 'generate_construct_header' ) ) {
- remove_action( 'generate_header','generate_construct_header' );
+ remove_action( 'generate_header', 'generate_construct_header' );
}
- // Remove the navigation
+ // Remove the mobile header.
+ if ( ! empty( $disable_mobile_header ) && false !== $disable_mobile_header && function_exists( 'generate_menu_plus_mobile_header' ) ) {
+ remove_action( 'generate_after_header', 'generate_menu_plus_mobile_header', 5 );
+ }
+
+ // Remove the navigation.
if ( ! empty( $disable_nav ) && false !== $disable_nav && function_exists( 'generate_get_navigation_location' ) ) {
- add_filter( 'generate_navigation_location','__return_false', 20 );
+ add_filter( 'generate_navigation_location', '__return_false', 20 );
}
- // Remove the title
+ // Remove the title.
if ( ! empty( $disable_headline ) && false !== $disable_headline && function_exists( 'generate_show_title' ) ) {
- add_filter( 'generate_show_title','__return_false' );
+ add_filter( 'generate_show_title', '__return_false' );
}
- // Remove the footer
+ // Remove the footer.
if ( ! empty( $disable_footer ) && false !== $disable_footer ) {
if ( function_exists( 'generate_construct_footer_widgets' ) ) {
- remove_action( 'generate_footer','generate_construct_footer_widgets', 5 );
+ remove_action( 'generate_footer', 'generate_construct_footer_widgets', 5 );
}
if ( function_exists( 'generate_construct_footer' ) ) {
- remove_action( 'generate_footer','generate_construct_footer' );
+ remove_action( 'generate_footer', 'generate_construct_footer' );
}
}
}
@@ -275,9 +301,11 @@ add_action( 'generate_layout_disable_elements_section', 'generate_premium_disabl
* Add the meta box options to the Layout meta box in the new GP
*
* @since 1.4
+ * @param array $stored_meta Existing meta data.
*/
function generate_premium_disable_elements_options( $stored_meta ) {
$stored_meta['_generate-disable-header'][0] = ( isset( $stored_meta['_generate-disable-header'][0] ) ) ? $stored_meta['_generate-disable-header'][0] : '';
+ $stored_meta['_generate-disable-mobile-header'][0] = ( isset( $stored_meta['_generate-disable-mobile-header'][0] ) ) ? $stored_meta['_generate-disable-mobile-header'][0] : '';
$stored_meta['_generate-disable-nav'][0] = ( isset( $stored_meta['_generate-disable-nav'][0] ) ) ? $stored_meta['_generate-disable-nav'][0] : '';
$stored_meta['_generate-disable-secondary-nav'][0] = ( isset( $stored_meta['_generate-disable-secondary-nav'][0] ) ) ? $stored_meta['_generate-disable-secondary-nav'][0] : '';
$stored_meta['_generate-disable-post-image'][0] = ( isset( $stored_meta['_generate-disable-post-image'][0] ) ) ? $stored_meta['_generate-disable-post-image'][0] : '';
@@ -287,42 +315,60 @@ function generate_premium_disable_elements_options( $stored_meta ) {
?>
-
+
>
-
+
-
+
>
-
+
-
+
+
+ >
+
+
+
+
+
>
-
+
-
+
>
-
+
-
+
>
-
+
-
+
>
-
+
-
+
>
-
+
input,
@@ -355,35 +316,6 @@ select.select-type:hover {
height: 300px;
}
-.choose-element-type-parent:before {
- content: "";
- position: fixed;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
-}
-
-.choose-element-type {
- position: fixed;
- width: 500px;
- background: #fff;
- left: calc(50% - 250px);
- padding: 50px;
- box-sizing: border-box;
- box-shadow: 0 0 20px rgba(0,0,0,0.05);
- border: 1px solid #ddd;
- z-index: 11;
-}
-
-#poststuff .choose-element-type h2 {
- font-size: 30px;
- text-align: center;
- margin-bottom: 30px;
- padding: 0;
- line-height: 1;
-}
-
.layout-radio-item {
margin-bottom: 3px;
}
@@ -441,6 +373,16 @@ body .select2-container--default .select2-selection--single {
margin-left: -6px;
}
-.generate-element-row-content .color-alpha {
- height: 100% !important;
+.hide-hook-row,
+.sidebar-notice {
+ display: none;
+}
+
+.sidebar-notice {
+ margin-top: 10px;
+ font-style: italic;
+}
+
+.element-settings.block .generate-elements-settings[data-type="hook"] tr:last-child td {
+ border-bottom: 0;
}
diff --git a/wp-content/plugins/gp-premium/elements/assets/admin/metabox.js b/wp-content/plugins/gp-premium/elements/assets/admin/metabox.js
index 239b4ed..b85de67 100644
--- a/wp-content/plugins/gp-premium/elements/assets/admin/metabox.js
+++ b/wp-content/plugins/gp-premium/elements/assets/admin/metabox.js
@@ -7,40 +7,27 @@ jQuery(document).ready(function( $ ) {
} );
}
- if ( $( '.choose-element-type-parent' ).is( ':visible' ) ) {
- $( '.select-type' ).focus();
- }
+ $( '#_generate_block_type' ).on( 'change', function() {
+ var _this = $( this ).val();
- $( 'select[name="_generate_element_type"]' ).on( 'change', function() {
- var _this = $( this ),
- element = _this.val();
-
- if ( '' == element ) {
- return;
+ if ( 'hook' === _this ) {
+ $( '.hook-row' ).removeClass( 'hide-hook-row' );
+ } else {
+ $( '.hook-row' ).addClass( 'hide-hook-row' );
}
- $( '.element-settings' ).addClass( element ).removeClass( 'no-element-type' ).css( 'opacity', '' );
- $( 'body' ).removeClass( 'no-element-type' );
+ $( 'body' ).removeClass( 'right-sidebar-block-type' );
+ $( 'body' ).removeClass( 'left-sidebar-block-type' );
+ $( 'body' ).removeClass( 'header-block-type' );
+ $( 'body' ).removeClass( 'footer-block-type' );
- var active_tab = $( '.element-metabox-tabs' ).find( 'li:visible:first' );
- active_tab.addClass( 'is-selected' );
- $( '.generate-elements-settings[data-tab="' + active_tab.attr( 'data-tab' ) + '"]' ).show();
+ $( 'body' ).addClass( _this + '-block-type' );
- if ( 'layout' === element ) {
- $( '#generate-element-content' ).hide();
+ if ( 'left-sidebar' === _this || 'right-sidebar' === _this ) {
+ $( '.sidebar-notice' ).show();
+ } else {
+ $( '.sidebar-notice' ).hide();
}
-
- if ( 'header' === element ) {
- $( 'body' ).addClass( 'header-element-type' );
- }
-
- if ( elements.settings && 'layout' !== element ) {
- $( function() {
- wp.codeEditor.initialize( "generate-element-content", elements.settings );
- } );
- }
-
- _this.closest( '.choose-element-type-parent' ).hide();
} );
$( '#_generate_hook' ).on( 'change', function() {
@@ -76,6 +63,10 @@ jQuery(document).ready(function( $ ) {
$( '.generate-elements-settings' ).hide();
$( '.generate-elements-settings[data-tab="' + tab + '"]' ).show();
+ if ( $( '.element-settings' ).hasClass( 'block' ) & 'hook-settings' === tab ) {
+ $( '.generate-elements-settings[data-tab="display-rules"]' ).show();
+ }
+
if ( $( '.element-settings' ).hasClass( 'header' ) ) {
if ( 'hero' !== tab ) {
$( '#generate-element-content' ).next( '.CodeMirror' ).hide();
@@ -208,6 +199,8 @@ jQuery(document).ready(function( $ ) {
$( '.condition select.condition-select' ).on( 'change', function() {
get_location_objects( $( this ) );
+
+ $( '.elements-no-location-error' ).hide();
} );
$( '.generate-elements-rule-objects-visible' ).each( function() {
diff --git a/wp-content/plugins/gp-premium/elements/assets/admin/wp-color-picker-alpha.js b/wp-content/plugins/gp-premium/elements/assets/admin/wp-color-picker-alpha.js
new file mode 100644
index 0000000..3a7d5bb
--- /dev/null
+++ b/wp-content/plugins/gp-premium/elements/assets/admin/wp-color-picker-alpha.js
@@ -0,0 +1,498 @@
+/**!
+ * wp-color-picker-alpha
+ *
+ * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
+ * Only run in input and is defined data alpha in true
+ *
+ * Version: 2.1.4
+ * https://github.com/kallookoo/wp-color-picker-alpha
+ * Licensed under the GPLv2 license or later.
+ */
+( function( $ ) {
+ // Prevent double-init.
+ if ( $.wp.wpColorPicker.prototype._hasAlpha ) {
+ return;
+ }
+
+ // Variable for some backgrounds ( grid )
+ var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==',
+ // html stuff for wpColorPicker copy of the original color-picker.js
+ _after = '
',
+ _wrap = '
',
+ _button = '
',
+ // Prevent CSS issues in < WordPress 4.9
+ _deprecated = ( wpColorPickerL10n.current !== undefined );
+ // Declare some global variables when is deprecated or not
+ if ( _deprecated ) {
+ var _before = '
';
+ } else {
+ var _before = '
',
+ _wrappingLabel = '
',
+ _wrappingLabelText = '
';
+ }
+ /**
+ * Overwrite Color
+ * for enable support rbga
+ */
+ Color.fn.toString = function() {
+ if ( this._alpha < 1 )
+ return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
+
+ var hex = parseInt( this._color, 10 ).toString( 16 );
+
+ if ( this.error )
+ return '';
+
+ if ( hex.length < 6 )
+ hex = ( '00000' + hex ).substr( -6 );
+
+ return '#' + hex;
+ };
+
+ /**
+ * Overwrite wpColorPicker
+ */
+ $.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
+ _hasAlpha: true,
+ /**
+ * @summary Creates the color picker.
+ *
+ * Creates the color picker, sets default values, css classes and wraps it all in HTML.
+ *
+ * @since 3.5.0
+ *
+ * @access private
+ *
+ * @returns {void}
+ */
+ _create: function() {
+ // Return early if Iris support is missing.
+ if ( ! $.support.iris ) {
+ return;
+ }
+
+ var self = this,
+ el = self.element;
+
+ // Override default options with options bound to the element.
+ $.extend( self.options, el.data() );
+
+ // Create a color picker which only allows adjustments to the hue.
+ if ( self.options.type === 'hue' ) {
+ return self._createHueOnly();
+ }
+
+ // Bind the close event.
+ self.close = $.proxy( self.close, self );
+
+ self.initialValue = el.val();
+
+ // Add a CSS class to the input field.
+ el.addClass( 'wp-color-picker' );
+
+ if ( _deprecated ) {
+ el.hide().wrap( _wrap );
+ self.wrap = el.parent();
+ self.toggler = $( _before )
+ .insertBefore( el )
+ .css( { backgroundColor : self.initialValue } )
+ .attr( 'title', wpColorPickerL10n.pick )
+ .attr( 'data-current', wpColorPickerL10n.current );
+ self.pickerContainer = $( _after ).insertAfter( el );
+ self.button = $( _button ).addClass('hidden');
+ } else {
+ /*
+ * Check if there's already a wrapping label, e.g. in the Customizer.
+ * If there's no label, add a default one to match the Customizer template.
+ */
+ if ( ! el.parent( 'label' ).length ) {
+ // Wrap the input field in the default label.
+ el.wrap( _wrappingLabel );
+ // Insert the default label text.
+ self.wrappingLabelText = $( _wrappingLabelText )
+ .insertBefore( el )
+ .text( wpColorPickerL10n.defaultLabel );
+ }
+
+ /*
+ * At this point, either it's the standalone version or the Customizer
+ * one, we have a wrapping label to use as hook in the DOM, let's store it.
+ */
+ self.wrappingLabel = el.parent();
+
+ // Wrap the label in the main wrapper.
+ self.wrappingLabel.wrap( _wrap );
+ // Store a reference to the main wrapper.
+ self.wrap = self.wrappingLabel.parent();
+ // Set up the toggle button and insert it before the wrapping label.
+ self.toggler = $( _before )
+ .insertBefore( self.wrappingLabel )
+ .css( { backgroundColor: self.initialValue } );
+ // Set the toggle button span element text.
+ self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
+ // Set up the Iris container and insert it after the wrapping label.
+ self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
+ // Store a reference to the Clear/Default button.
+ self.button = $( _button );
+ }
+
+ // Set up the Clear/Default button.
+ if ( self.options.defaultColor ) {
+ self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
+ if ( ! _deprecated ) {
+ self.button.attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
+ }
+ } else {
+ self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
+ if ( ! _deprecated ) {
+ self.button.attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
+ }
+ }
+
+ if ( _deprecated ) {
+ el.wrap( '
' ).after( self.button );
+ } else {
+ // Wrap the wrapping label in its wrapper and append the Clear/Default button.
+ self.wrappingLabel
+ .wrap( '
' )
+ .after( self.button );
+
+ /*
+ * The input wrapper now contains the label+input+Clear/Default button.
+ * Store a reference to the input wrapper: we'll use this to toggle
+ * the controls visibility.
+ */
+ self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
+ }
+
+ el.iris( {
+ target: self.pickerContainer,
+ hide: self.options.hide,
+ width: self.options.width,
+ mode: self.options.mode,
+ palettes: self.options.palettes,
+ /**
+ * @summary Handles the onChange event if one has been defined in the options.
+ *
+ * Handles the onChange event if one has been defined in the options and additionally
+ * sets the background color for the toggler element.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ * @param {HTMLElement} ui The HTMLElement containing the color picker.
+ *
+ * @returns {void}
+ */
+ change: function( event, ui ) {
+ if ( self.options.alpha ) {
+ self.toggler.css( { 'background-image' : 'url(' + image + ')' } );
+ if ( _deprecated ) {
+ self.toggler.html( '
' );
+ } else {
+ self.toggler.css( {
+ 'position' : 'relative'
+ } );
+ if ( self.toggler.find('span.color-alpha').length == 0 ) {
+ self.toggler.append('
');
+ }
+ }
+
+ self.toggler.find( 'span.color-alpha' ).css( {
+ 'width' : '30px',
+ 'height' : '100%',
+ 'position' : 'absolute',
+ 'top' : 0,
+ 'left' : 0,
+ 'border-top-left-radius' : '2px',
+ 'border-bottom-left-radius' : '2px',
+ 'background' : ui.color.toString()
+ } );
+ } else {
+ self.toggler.css( { backgroundColor : ui.color.toString() } );
+ }
+
+ if ( $.isFunction( self.options.change ) ) {
+ self.options.change.call( this, event, ui );
+ }
+ }
+ } );
+
+ el.val( self.initialValue );
+ self._addListeners();
+
+ // Force the color picker to always be closed on initial load.
+ if ( ! self.options.hide ) {
+ self.toggler.click();
+ }
+ },
+ /**
+ * @summary Binds event listeners to the color picker.
+ *
+ * @since 3.5.0
+ *
+ * @access private
+ *
+ * @returns {void}
+ */
+ _addListeners: function() {
+ var self = this;
+
+ /**
+ * @summary Prevent any clicks inside this widget from leaking to the top and closing it.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returs {void}
+ */
+ self.wrap.on( 'click.wpcolorpicker', function( event ) {
+ event.stopPropagation();
+ });
+
+ /**
+ * @summary Open or close the color picker depending on the class.
+ *
+ * @since 3.5
+ */
+ self.toggler.click( function(){
+ if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
+ self.close();
+ } else {
+ self.open();
+ }
+ });
+
+ /**
+ * @summary Checks if value is empty when changing the color in the color picker.
+ *
+ * Checks if value is empty when changing the color in the color picker.
+ * If so, the background color is cleared.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returns {void}
+ */
+ self.element.on( 'change', function( event ) {
+ // Empty or Error = clear
+ if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) {
+ if ( self.options.alpha ) {
+ if ( _deprecated ) {
+ self.toggler.removeAttr( 'style' );
+ }
+ self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
+ } else {
+ self.toggler.css( 'backgroundColor', '' );
+ }
+
+ // fire clear callback if we have one
+ if ( $.isFunction( self.options.clear ) )
+ self.options.clear.call( this, event );
+ }
+ } );
+
+ /**
+ * @summary Enables the user to clear or revert the color in the color picker.
+ *
+ * Enables the user to either clear the color in the color picker or revert back to the default color.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returns {void}
+ */
+ self.button.on( 'click', function( event ) {
+ if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
+ self.element.val( '' );
+ if ( self.options.alpha ) {
+ if ( _deprecated ) {
+ self.toggler.removeAttr( 'style' );
+ }
+ self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
+ } else {
+ self.toggler.css( 'backgroundColor', '' );
+ }
+
+ if ( $.isFunction( self.options.clear ) )
+ self.options.clear.call( this, event );
+
+ self.element.trigger( 'change' );
+ } else if ( $( this ).hasClass( 'wp-picker-default' ) ) {
+ self.element.val( self.options.defaultColor ).change();
+ }
+ });
+ },
+ });
+
+ /**
+ * Overwrite iris
+ */
+ $.widget( 'a8c.iris', $.a8c.iris, {
+ _create: function() {
+ this._super();
+
+ // Global option for check is mode rbga is enabled
+ this.options.alpha = this.element.data( 'alpha' ) || false;
+
+ // Is not input disabled
+ if ( ! this.element.is( ':input' ) )
+ this.options.alpha = false;
+
+ if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
+ var self = this,
+ el = self.element,
+ _html = '
',
+ aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
+ aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
+ controls = {
+ aContainer : aContainer,
+ aSlider : aSlider
+ };
+
+ if ( typeof el.data( 'custom-width' ) !== 'undefined' ) {
+ self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0;
+ } else {
+ self.options.customWidth = 100;
+ }
+
+ // Set default width for input reset
+ self.options.defaultWidth = el.width();
+
+ // Update width for input
+ if ( self._color._alpha < 1 || self._color.toString().indexOf('rgb') != -1 )
+ el.width( parseInt( self.options.defaultWidth + self.options.customWidth ) );
+
+ // Push new controls
+ $.each( controls, function( k, v ) {
+ self.controls[k] = v;
+ } );
+
+ // Change size strip and add margin for sliders
+ self.controls.square.css( { 'margin-right': '0' } );
+ var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
+ stripsMargin = ( emptyWidth / 6 ),
+ stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin );
+
+ $.each( [ 'aContainer', 'strip' ], function( k, v ) {
+ self.controls[v].width( stripsWidth ).css( { 'margin-left' : stripsMargin + 'px' } );
+ } );
+
+ // Add new slider
+ self._initControls();
+
+ // For updated widget
+ self._change();
+ }
+ },
+ _initControls: function() {
+ this._super();
+
+ if ( this.options.alpha ) {
+ var self = this,
+ controls = self.controls;
+
+ controls.aSlider.slider({
+ orientation : 'vertical',
+ min : 0,
+ max : 100,
+ step : 1,
+ value : parseInt( self._color._alpha * 100 ),
+ slide : function( event, ui ) {
+ // Update alpha value
+ self._color._alpha = parseFloat( ui.value / 100 );
+ self._change.apply( self, arguments );
+ }
+ });
+ }
+ },
+ _change: function() {
+ this._super();
+
+ var self = this,
+ el = self.element;
+
+ if ( this.options.alpha ) {
+ var controls = self.controls,
+ alpha = parseInt( self._color._alpha * 100 ),
+ color = self._color.toRgb(),
+ gradient = [
+ 'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
+ 'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
+ ],
+ defaultWidth = self.options.defaultWidth,
+ customWidth = self.options.customWidth,
+ target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
+
+ // Generate background slider alpha, only for CSS3 old browser fuck!! :)
+ controls.aContainer.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } );
+
+ if ( target.hasClass( 'wp-picker-open' ) ) {
+ // Update alpha value
+ controls.aSlider.slider( 'value', alpha );
+
+ /**
+ * Disabled change opacity in default slider Saturation ( only is alpha enabled )
+ * and change input width for view all value
+ */
+ if ( self._color._alpha < 1 ) {
+ controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) );
+ el.width( parseInt( defaultWidth + customWidth ) );
+ } else {
+ el.width( defaultWidth );
+ }
+ }
+ }
+
+ var reset = el.data( 'reset-alpha' ) || false;
+
+ if ( reset ) {
+ self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
+ self._color._alpha = 1;
+ self.active = 'external';
+ self._change();
+ } );
+ }
+ el.trigger( 'change' );
+ },
+ _addInputListeners: function( input ) {
+ var self = this,
+ debounceTimeout = 100,
+ callback = function( event ) {
+ var color = new Color( input.val() ),
+ val = input.val();
+
+ input.removeClass( 'iris-error' );
+ // we gave a bad color
+ if ( color.error ) {
+ // don't error on an empty input
+ if ( val !== '' )
+ input.addClass( 'iris-error' );
+ } else {
+ if ( color.toString() !== self._color.toString() ) {
+ // let's not do this on keyup for hex shortcodes
+ if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) )
+ self._setOption( 'color', color.toString() );
+ }
+ }
+ };
+
+ input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
+
+ // If we initialized hidden, show on first focus. The rest is up to you.
+ if ( self.options.hide ) {
+ input.on( 'focus', function() {
+ self.show();
+ } );
+ }
+ }
+ } );
+}( jQuery ) );
+
+// Auto Call plugin is class is color-picker
+jQuery( document ).ready( function( $ ) {
+ $( '.color-picker' ).wpColorPicker();
+} );
diff --git a/wp-content/plugins/gp-premium/elements/assets/admin/wp-color-picker-alpha.min.js b/wp-content/plugins/gp-premium/elements/assets/admin/wp-color-picker-alpha.min.js
index 21fe8c4..db88dc7 100644
--- a/wp-content/plugins/gp-premium/elements/assets/admin/wp-color-picker-alpha.min.js
+++ b/wp-content/plugins/gp-premium/elements/assets/admin/wp-color-picker-alpha.min.js
@@ -4,8 +4,8 @@
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
* Only run in input and is defined data alpha in true
*
- * Version: 2.1.3
+ * Version: 2.1.4
* https://github.com/kallookoo/wp-color-picker-alpha
- * Licensed under the GPLv2 license.
+ * Licensed under the GPLv2 license or later.
*/
-!function(t){if(!t.wp.wpColorPicker.prototype._hasAlpha){var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",r='
',e='
',a='
',i=void 0!==wpColorPickerL10n.current;if(i)var n='
';else{n='
';var l="
",s='
'}Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_hasAlpha:!0,_create:function(){if(t.support.iris){var p=this,c=p.element;if(t.extend(p.options,c.data()),"hue"===p.options.type)return p._createHueOnly();p.close=t.proxy(p.close,p),p.initialValue=c.val(),c.addClass("wp-color-picker"),i?(c.hide().wrap(e),p.wrap=c.parent(),p.toggler=t(n).insertBefore(c).css({backgroundColor:p.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),p.pickerContainer=t(r).insertAfter(c),p.button=t(a).addClass("hidden")):(c.parent("label").length||(c.wrap(l),p.wrappingLabelText=t(s).insertBefore(c).text(wpColorPickerL10n.defaultLabel)),p.wrappingLabel=c.parent(),p.wrappingLabel.wrap(e),p.wrap=p.wrappingLabel.parent(),p.toggler=t(n).insertBefore(p.wrappingLabel).css({backgroundColor:p.initialValue}),p.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),p.pickerContainer=t(r).insertAfter(p.wrappingLabel),p.button=t(a)),p.options.defaultColor?(p.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),i||p.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(p.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),i||p.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),i?c.wrap('
').after(p.button):(p.wrappingLabel.wrap('
').after(p.button),p.inputWrapper=c.closest(".wp-picker-input-wrap")),c.iris({target:p.pickerContainer,hide:p.options.hide,width:p.options.width,mode:p.options.mode,palettes:p.options.palettes,change:function(r,e){p.options.alpha?(p.toggler.css({"background-image":"url("+o+")"}),i?p.toggler.html('
'):(p.toggler.css({position:"relative"}),0==p.toggler.find("span.color-alpha").length&&p.toggler.append('
')),p.toggler.find("span.color-alpha").css({width:"30px",height:"24px",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:e.color.toString()})):p.toggler.css({backgroundColor:e.color.toString()}),t.isFunction(p.options.change)&&p.options.change.call(this,r,e)}}),c.val(p.initialValue),p._addListeners(),p.options.hide||p.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(r){(""===t(this).val()||o.element.hasClass("iris-error"))&&(o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r))}),o.button.on("click",function(r){t(this).hasClass("wp-picker-clear")?(o.element.val(""),o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r),o.element.trigger("change")):t(this).hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var o=this,r=o.element,e=t('
').appendTo(o.picker.find(".iris-picker-inner")),a={aContainer:e,aSlider:e.find(".iris-slider-offset-alpha")};void 0!==r.data("custom-width")?o.options.customWidth=parseInt(r.data("custom-width"))||0:o.options.customWidth=100,o.options.defaultWidth=r.width(),(o._color._alpha<1||-1!=o._color.toString().indexOf("rgb"))&&r.width(parseInt(o.options.defaultWidth+o.options.customWidth)),t.each(a,function(t,r){o.controls[t]=r}),o.controls.square.css({"margin-right":"0"});var i=o.picker.width()-o.controls.square.width()-20,n=i/6,l=i/2-n;t.each(["aContainer","strip"],function(t,r){o.controls[r].width(l).css({"margin-left":n+"px"})}),o._initControls(),o._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,r){t._color._alpha=parseFloat(r.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,r=t.element;if(this.options.alpha){var e=t.controls,a=parseInt(100*t._color._alpha),i=t._color.toRgb(),n=["rgb("+i.r+","+i.g+","+i.b+") 0%","rgba("+i.r+","+i.g+","+i.b+", 0) 100%"],l=t.options.defaultWidth,s=t.options.customWidth,p=t.picker.closest(".wp-picker-container").find(".wp-color-result");e.aContainer.css({background:"linear-gradient(to bottom, "+n.join(", ")+"), url("+o+")"}),p.hasClass("wp-picker-open")&&(e.aSlider.slider("value",a),t._color._alpha<1?(e.strip.attr("style",e.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),r.width(parseInt(l+s))):r.width(l))}(r.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()}),r.trigger("change")},_addInputListeners:function(t){var o=this,r=function(r){var e=new Color(t.val()),a=t.val();t.removeClass("iris-error"),e.error?""!==a&&t.addClass("iris-error"):e.toString()!==o._color.toString()&&("keyup"===r.type&&a.match(/^[0-9a-fA-F]{3}$/)||o._setOption("color",e.toString()))};t.on("change",r).on("keyup",o._debounce(r,100)),o.options.hide&&t.on("focus",function(){o.show()})}})}}(jQuery),jQuery(document).ready(function(t){t(".color-picker").wpColorPicker()});
\ No newline at end of file
+!function(t){if(!t.wp.wpColorPicker.prototype._hasAlpha){var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",r='
',e='
',a='
',i=void 0!==wpColorPickerL10n.current;if(i)var n='
';else{n='
';var l="
",s='
'}Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var t=parseInt(this._color,10).toString(16);return this.error?"":(t.length<6&&(t=("00000"+t).substr(-6)),"#"+t)},t.widget("wp.wpColorPicker",t.wp.wpColorPicker,{_hasAlpha:!0,_create:function(){if(t.support.iris){var p=this,c=p.element;if(t.extend(p.options,c.data()),"hue"===p.options.type)return p._createHueOnly();p.close=t.proxy(p.close,p),p.initialValue=c.val(),c.addClass("wp-color-picker"),i?(c.hide().wrap(e),p.wrap=c.parent(),p.toggler=t(n).insertBefore(c).css({backgroundColor:p.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current),p.pickerContainer=t(r).insertAfter(c),p.button=t(a).addClass("hidden")):(c.parent("label").length||(c.wrap(l),p.wrappingLabelText=t(s).insertBefore(c).text(wpColorPickerL10n.defaultLabel)),p.wrappingLabel=c.parent(),p.wrappingLabel.wrap(e),p.wrap=p.wrappingLabel.parent(),p.toggler=t(n).insertBefore(p.wrappingLabel).css({backgroundColor:p.initialValue}),p.toggler.find(".wp-color-result-text").text(wpColorPickerL10n.pick),p.pickerContainer=t(r).insertAfter(p.wrappingLabel),p.button=t(a)),p.options.defaultColor?(p.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString),i||p.button.attr("aria-label",wpColorPickerL10n.defaultAriaLabel)):(p.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear),i||p.button.attr("aria-label",wpColorPickerL10n.clearAriaLabel)),i?c.wrap('
').after(p.button):(p.wrappingLabel.wrap('
').after(p.button),p.inputWrapper=c.closest(".wp-picker-input-wrap")),c.iris({target:p.pickerContainer,hide:p.options.hide,width:p.options.width,mode:p.options.mode,palettes:p.options.palettes,change:function(r,e){p.options.alpha?(p.toggler.css({"background-image":"url("+o+")"}),i?p.toggler.html('
'):(p.toggler.css({position:"relative"}),0==p.toggler.find("span.color-alpha").length&&p.toggler.append('
')),p.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,left:0,"border-top-left-radius":"2px","border-bottom-left-radius":"2px",background:e.color.toString()})):p.toggler.css({backgroundColor:e.color.toString()}),t.isFunction(p.options.change)&&p.options.change.call(this,r,e)}}),c.val(p.initialValue),p._addListeners(),p.options.hide||p.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(t){t.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(r){(""===t(this).val()||o.element.hasClass("iris-error"))&&(o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r))}),o.button.on("click",function(r){t(this).hasClass("wp-picker-clear")?(o.element.val(""),o.options.alpha?(i&&o.toggler.removeAttr("style"),o.toggler.find("span.color-alpha").css("backgroundColor","")):o.toggler.css("backgroundColor",""),t.isFunction(o.options.clear)&&o.options.clear.call(this,r),o.element.trigger("change")):t(this).hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})}}),t.widget("a8c.iris",t.a8c.iris,{_create:function(){if(this._super(),this.options.alpha=this.element.data("alpha")||!1,this.element.is(":input")||(this.options.alpha=!1),void 0!==this.options.alpha&&this.options.alpha){var o=this,r=o.element,e=t('
').appendTo(o.picker.find(".iris-picker-inner")),a={aContainer:e,aSlider:e.find(".iris-slider-offset-alpha")};void 0!==r.data("custom-width")?o.options.customWidth=parseInt(r.data("custom-width"))||0:o.options.customWidth=100,o.options.defaultWidth=r.width(),(o._color._alpha<1||-1!=o._color.toString().indexOf("rgb"))&&r.width(parseInt(o.options.defaultWidth+o.options.customWidth)),t.each(a,function(t,r){o.controls[t]=r}),o.controls.square.css({"margin-right":"0"});var i=o.picker.width()-o.controls.square.width()-20,n=i/6,l=i/2-n;t.each(["aContainer","strip"],function(t,r){o.controls[r].width(l).css({"margin-left":n+"px"})}),o._initControls(),o._change()}},_initControls:function(){if(this._super(),this.options.alpha){var t=this;t.controls.aSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,r){t._color._alpha=parseFloat(r.value/100),t._change.apply(t,arguments)}})}},_change:function(){this._super();var t=this,r=t.element;if(this.options.alpha){var e=t.controls,a=parseInt(100*t._color._alpha),i=t._color.toRgb(),n=["rgb("+i.r+","+i.g+","+i.b+") 0%","rgba("+i.r+","+i.g+","+i.b+", 0) 100%"],l=t.options.defaultWidth,s=t.options.customWidth,p=t.picker.closest(".wp-picker-container").find(".wp-color-result");e.aContainer.css({background:"linear-gradient(to bottom, "+n.join(", ")+"), url("+o+")"}),p.hasClass("wp-picker-open")&&(e.aSlider.slider("value",a),t._color._alpha<1?(e.strip.attr("style",e.strip.attr("style").replace(/rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g,"rgb($1$3$5)")),r.width(parseInt(l+s))):r.width(l))}(r.data("reset-alpha")||!1)&&t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){t._color._alpha=1,t.active="external",t._change()}),r.trigger("change")},_addInputListeners:function(t){var o=this,r=function(r){var e=new Color(t.val()),a=t.val();t.removeClass("iris-error"),e.error?""!==a&&t.addClass("iris-error"):e.toString()!==o._color.toString()&&("keyup"===r.type&&a.match(/^[0-9a-fA-F]{3}$/)||o._setOption("color",e.toString()))};t.on("change",r).on("keyup",o._debounce(r,100)),o.options.hide&&t.on("focus",function(){o.show()})}})}}(jQuery),jQuery(document).ready(function(t){t(".color-picker").wpColorPicker()});
diff --git a/wp-content/plugins/gp-premium/elements/class-block.php b/wp-content/plugins/gp-premium/elements/class-block.php
new file mode 100644
index 0000000..f73df33
--- /dev/null
+++ b/wp-content/plugins/gp-premium/elements/class-block.php
@@ -0,0 +1,163 @@
+post_id = $post_id;
+ $this->type = get_post_meta( $post_id, '_generate_block_type', true );
+
+ $display_conditions = get_post_meta( $post_id, '_generate_element_display_conditions', true ) ? get_post_meta( $post_id, '_generate_element_display_conditions', true ) : array();
+ $exclude_conditions = get_post_meta( $post_id, '_generate_element_exclude_conditions', true ) ? get_post_meta( $post_id, '_generate_element_exclude_conditions', true ) : array();
+ $user_conditions = get_post_meta( $post_id, '_generate_element_user_conditions', true ) ? get_post_meta( $post_id, '_generate_element_user_conditions', true ) : array();
+
+ $display = apply_filters(
+ 'generate_block_element_display',
+ GeneratePress_Conditions::show_data(
+ $display_conditions,
+ $exclude_conditions,
+ $user_conditions
+ ),
+ $post_id
+ );
+
+ if ( $display ) {
+ $hook = get_post_meta( $post_id, '_generate_hook', true );
+ $custom_hook = get_post_meta( $post_id, '_generate_custom_hook', true );
+ $priority = get_post_meta( $post_id, '_generate_hook_priority', true );
+
+ if ( '' === $priority ) {
+ $priority = 10;
+ }
+
+ switch ( $this->type ) {
+ case 'site-header':
+ $hook = 'generate_header';
+ break;
+
+ case 'site-footer':
+ $hook = 'generate_footer';
+ break;
+
+ case 'right-sidebar':
+ $hook = 'generate_before_right_sidebar_content';
+ break;
+
+ case 'left-sidebar':
+ $hook = 'generate_before_left_sidebar_content';
+ break;
+
+ case 'custom':
+ $hook = $custom_hook;
+ break;
+ }
+
+ if ( ! $hook ) {
+ return;
+ }
+
+ if ( 'generate_header' === $hook ) {
+ remove_action( 'generate_header', 'generate_construct_header' );
+ }
+
+ if ( 'generate_footer' === $hook ) {
+ remove_action( 'generate_footer', 'generate_construct_footer' );
+ }
+
+ add_action( esc_attr( $hook ), array( $this, 'build_hook' ), absint( $priority ) );
+
+ if ( 'right-sidebar' === $this->type || 'left-sidebar' === $this->type ) {
+ add_filter( 'sidebars_widgets', array( $this, 'remove_sidebar_widgets' ) );
+ add_filter( 'generate_show_default_sidebar_widgets', '__return_false' );
+ }
+
+ add_filter( 'generateblocks_do_content', array( $this, 'do_block_content' ) );
+ }
+
+ }
+
+ /**
+ * Tell GenerateBlocks about our block element content so it can build CSS.
+ *
+ * @since 1.11.0
+ * @param string $content The existing content.
+ */
+ public function do_block_content( $content ) {
+ if ( has_blocks( $this->post_id ) ) {
+ $block_element = get_post( $this->post_id );
+
+ if ( ! $block_element || 'gp_elements' !== $block_element->post_type ) {
+ return $content;
+ }
+
+ if ( 'publish' !== $block_element->post_status || ! empty( $block_element->post_password ) ) {
+ return $content;
+ }
+
+ $content .= $block_element->post_content;
+ }
+
+ return $content;
+ }
+
+ /**
+ * Remove existing sidebar widgets.
+ *
+ * @since 1.11.0
+ * @param array $widgets The existing widgets.
+ */
+ public function remove_sidebar_widgets( $widgets ) {
+ if ( 'right-sidebar' === $this->type ) {
+ unset( $widgets['sidebar-1'] );
+ }
+
+ if ( 'left-sidebar' === $this->type ) {
+ unset( $widgets['sidebar-2'] );
+ }
+
+ return $widgets;
+ }
+
+ /**
+ * Builds the HTML structure for Page Headers.
+ *
+ * @since 1.11.0
+ */
+ public function build_hook() {
+ echo GeneratePress_Elements_Helper::build_content( $this->post_id); // phpcs:ignore -- No escaping needed.
+ }
+}
diff --git a/wp-content/plugins/gp-premium/elements/class-conditions.php b/wp-content/plugins/gp-premium/elements/class-conditions.php
index b2e89f1..e9c1110 100644
--- a/wp-content/plugins/gp-premium/elements/class-conditions.php
+++ b/wp-content/plugins/gp-premium/elements/class-conditions.php
@@ -1,9 +1,17 @@
array(
- 'label' => esc_attr__( 'General', 'gp-premium' ),
+ 'label' => esc_attr__( 'General', 'gp-premium' ),
'locations' => array(
- 'general:site' => esc_attr__( 'Entire Site', 'gp-premium' ),
- 'general:front_page' => esc_attr__( 'Front Page', 'gp-premium' ),
- 'general:blog' => esc_attr__( 'Blog', 'gp-premium' ),
- 'general:singular' => esc_attr__( 'All Singular', 'gp-premium' ),
- 'general:archive' => esc_attr__( 'All Archives', 'gp-premium' ),
- 'general:author' => esc_attr__( 'Author Archives', 'gp-premium' ),
- 'general:date' => esc_attr__( 'Date Archives', 'gp-premium' ),
- 'general:search' => esc_attr__( 'Search Results', 'gp-premium' ),
- 'general:404' => esc_attr__( '404 Template', 'gp-premium' ),
- )
- )
+ 'general:site' => esc_attr__( 'Entire Site', 'gp-premium' ),
+ 'general:front_page' => esc_attr__( 'Front Page', 'gp-premium' ),
+ 'general:blog' => esc_attr__( 'Blog', 'gp-premium' ),
+ 'general:singular' => esc_attr__( 'All Singular', 'gp-premium' ),
+ 'general:archive' => esc_attr__( 'All Archives', 'gp-premium' ),
+ 'general:author' => esc_attr__( 'Author Archives', 'gp-premium' ),
+ 'general:date' => esc_attr__( 'Date Archives', 'gp-premium' ),
+ 'general:search' => esc_attr__( 'Search Results', 'gp-premium' ),
+ 'general:404' => esc_attr__( '404 Template', 'gp-premium' ),
+ ),
+ ),
);
// Add the post types.
- $post_types = get_post_types( array(
- 'public' => true,
- ), 'objects' );
+ $post_types = get_post_types(
+ array(
+ 'public' => true,
+ ),
+ 'objects'
+ );
foreach ( $post_types as $post_type_slug => $post_type ) {
@@ -67,15 +78,17 @@ class GeneratePress_Conditions {
$types[ $post_type_slug ] = array(
'label' => esc_html( $post_type->labels->name ),
'locations' => array(
- 'post:' . $post_type_slug => esc_html( $post_type->labels->singular_name )
- )
+ 'post:' . $post_type_slug => esc_html( $post_type->labels->singular_name ),
+ ),
);
// Add the post type archive.
- if ( 'post' == $post_type_slug || ! empty( $post_type_object->has_archive ) ) {
+ if ( 'post' === $post_type_slug || ! empty( $post_type_object->has_archive ) ) {
$types[ $post_type_slug . '_archive' ] = array(
+ /* translators: post type name */
'label' => sprintf( esc_html_x( '%s Archives', '%s is a singular post type name', 'gp-premium' ), $post_type->labels->singular_name ),
'locations' => array(
+ /* translators: post type name */
'archive:' . $post_type_slug => sprintf( esc_html_x( '%s Archive', '%s is a singular post type name', 'gp-premium' ), $post_type->labels->singular_name ),
),
);
@@ -88,23 +101,28 @@ class GeneratePress_Conditions {
$public = $taxonomy->public && $taxonomy->show_ui;
- if ( 'post_format' == $taxonomy_slug ) {
+ if ( 'post_format' === $taxonomy_slug ) {
continue;
} elseif ( ! apply_filters( 'generate_elements_show_taxonomy', $public, $taxonomy ) ) {
continue;
}
- $label = str_replace( array(
- $post_type->labels->name,
- $post_type->labels->singular_name,
- ), '', $taxonomy->labels->singular_name );
+ $label = str_replace(
+ array(
+ $post_type->labels->name,
+ $post_type->labels->singular_name,
+ ),
+ '',
+ $taxonomy->labels->singular_name
+ );
if ( isset( $types[ $post_type_slug . '_archive' ]['locations'] ) ) {
- $types[ $post_type_slug . '_archive' ]['locations']['taxonomy:' . $taxonomy_slug] = sprintf( esc_html_x( '%1$s %2$s Archive', '%1$s is post type label. %2$s is taxonomy label.', 'gp-premium' ), $post_type->labels->singular_name, $label );
+ /* translators: '%1$s is post type label. %2$s is taxonomy label. */
+ $types[ $post_type_slug . '_archive' ]['locations'][ 'taxonomy:' . $taxonomy_slug ] = sprintf( esc_html_x( '%1$s %2$s Archive', '%1$s is post type label. %2$s is taxonomy label.', 'gp-premium' ), $post_type->labels->singular_name, $label );
}
if ( isset( $types[ $post_type_slug ]['locations'] ) ) {
- $types[ $post_type_slug ]['locations'][$post_type_slug . ':taxonomy:' . $taxonomy_slug] = esc_html( $post_type->labels->singular_name . ' ' . $label );
+ $types[ $post_type_slug ]['locations'][ $post_type_slug . ':taxonomy:' . $taxonomy_slug ] = esc_html( $post_type->labels->singular_name . ' ' . $label );
}
}
}
@@ -122,17 +140,17 @@ class GeneratePress_Conditions {
public static function get_user_conditions() {
$rules = array(
'general' => array(
- 'label' => esc_attr__( 'General', 'gp-premium' ),
+ 'label' => esc_attr__( 'General', 'gp-premium' ),
'rules' => array(
- 'general:all' => esc_attr__( 'All Users', 'gp-premium' ),
- 'general:logged_in' => esc_attr__( 'Logged In', 'gp-premium' ),
- 'general:logged_out' => esc_attr__( 'Logged Out', 'gp-premium' ),
- )
+ 'general:all' => esc_attr__( 'All Users', 'gp-premium' ),
+ 'general:logged_in' => esc_attr__( 'Logged In', 'gp-premium' ),
+ 'general:logged_out' => esc_attr__( 'Logged Out', 'gp-premium' ),
+ ),
),
'role' => array(
'label' => esc_attr__( 'Roles', 'gp-premium' ),
'rules' => array(),
- )
+ ),
);
$roles = get_editable_roles();
@@ -207,6 +225,37 @@ class GeneratePress_Conditions {
}
}
+ if ( is_admin() && function_exists( 'get_current_screen' ) ) {
+ $current_screen = get_current_screen();
+
+ if ( isset( $current_screen->is_block_editor ) && $current_screen->is_block_editor ) {
+ $post_id = false;
+
+ if ( isset( $_GET['post'] ) ) { // phpcs:ignore -- Just checking if it's set.
+ $post_id = absint( $_GET['post'] ); // phpcs:ignore -- No data processing going on.
+ }
+
+ if ( $post_id ) {
+
+ // Get the location string.
+ $front_page_id = get_option( 'page_on_front' );
+ $blog_id = get_option( 'page_for_posts' );
+
+ if ( (int) $post_id === (int) $front_page_id ) {
+ $location = 'general:front_page';
+ } elseif ( (int) $post_id === (int) $blog_id ) {
+ $location = 'general:blog';
+ } else {
+ if ( isset( $current_screen->post_type ) ) {
+ $location = 'post:' . $current_screen->post_type;
+ }
+
+ $object = $post_id;
+ }
+ }
+ }
+ }
+
return array(
'rule' => $location,
'object' => $object,
@@ -230,7 +279,7 @@ class GeneratePress_Conditions {
$user = wp_get_current_user();
- foreach ( ( array ) $user->roles as $role ) {
+ foreach ( (array) $user->roles as $role ) {
$status[] = $role;
}
@@ -242,6 +291,9 @@ class GeneratePress_Conditions {
*
* @since 1.7
*
+ * @param array $conditionals The conditions.
+ * @param array $exclude The exclusions.
+ * @param array $roles The roles.
* @return bool
*/
public static function show_data( $conditionals, $exclude, $roles ) {
@@ -250,7 +302,7 @@ class GeneratePress_Conditions {
// Show depending on location conditionals.
if ( ! $show ) {
- foreach( ( array ) $conditionals as $conditional ) {
+ foreach ( (array) $conditionals as $conditional ) {
if ( in_array( 'general:site', $conditional ) ) {
$show = true;
} elseif ( is_singular() && in_array( 'general:singular', $conditional ) ) {
@@ -280,7 +332,7 @@ class GeneratePress_Conditions {
// Exclude based on exclusion conditionals.
if ( $show ) {
- foreach( ( array ) $exclude as $conditional ) {
+ foreach ( (array) $exclude as $conditional ) {
if ( is_singular() && in_array( 'general:singular', $conditional ) ) {
$show = false;
} elseif ( is_archive() && in_array( 'general:archive', $conditional ) ) {
@@ -294,7 +346,7 @@ class GeneratePress_Conditions {
}
}
} elseif ( is_singular() && strstr( $conditional['rule'], ':taxonomy:' ) ) {
- $tax = substr( $conditional['rule'], strrpos( $conditional['rule'], ':') + 1 );
+ $tax = substr( $conditional['rule'], strrpos( $conditional['rule'], ':' ) + 1 );
if ( $tax && isset( $conditional['object'] ) && has_term( $conditional['object'], $tax ) ) {
$show = false;
@@ -323,11 +375,11 @@ class GeneratePress_Conditions {
* Returns the label for a saved location.
*
* @since 1.7
- * @param string $saved_location
+ * @param string $saved_location The location.
* @return string|bool
*/
- static public function get_saved_label( $saved_location ) {
- $locations = self::get_conditions();
+ public static function get_saved_label( $saved_location ) {
+ $locations = self::get_conditions();
$rule = $saved_location['rule'];
$object_id = $saved_location['object'];
diff --git a/wp-content/plugins/gp-premium/elements/class-elements-helper.php b/wp-content/plugins/gp-premium/elements/class-elements-helper.php
index b920c5b..3330023 100644
--- a/wp-content/plugins/gp-premium/elements/class-elements-helper.php
+++ b/wp-content/plugins/gp-premium/elements/class-elements-helper.php
@@ -1,8 +1,17 @@
post_type ) {
+ return '';
+ }
+
+ if ( 'publish' !== $block_element->post_status || ! empty( $block_element->post_password ) ) {
+ return '';
+ }
+
+ return apply_filters( 'generate_do_block_element_content', do_blocks( $block_element->post_content ) );
+ }
}
diff --git a/wp-content/plugins/gp-premium/elements/class-hero.php b/wp-content/plugins/gp-premium/elements/class-hero.php
index 3dbe756..ccfbc22 100644
--- a/wp-content/plugins/gp-premium/elements/class-hero.php
+++ b/wp-content/plugins/gp-premium/elements/class-hero.php
@@ -1,10 +1,23 @@
apply_filters( 'generate_hero_parallax_speed', 2 ),
- ) );
+ wp_localize_script(
+ 'generate-hero-parallax',
+ 'hero',
+ array(
+ 'parallax' => apply_filters( 'generate_hero_parallax_speed', 2 ),
+ )
+ );
}
}
@@ -120,30 +142,41 @@ class GeneratePress_Hero {
return;
}
- $options['container_classes'] = implode( ' ', array(
- 'page-hero',
- 'contained' === $options['container'] ? 'grid-container grid-parent' : '',
- $options['classes'],
- ) );
+ $options['container_classes'] = implode(
+ ' ',
+ array(
+ 'page-hero',
+ 'contained' === $options['container'] ? 'grid-container grid-parent' : '',
+ $options['classes'],
+ )
+ );
- $options['inner_container_classes'] = implode( ' ', array(
- 'inside-page-hero',
- 'full-width' !== $options['inner_container'] ? 'grid-container grid-parent' : '',
- ) );
+ $options['inner_container_classes'] = implode(
+ ' ',
+ array(
+ 'inside-page-hero',
+ 'full-width' !== $options['inner_container'] ? 'grid-container grid-parent' : '',
+ )
+ );
$options['content'] = self::template_tags( $options['content'] );
$options['content'] = do_shortcode( $options['content'] );
- echo apply_filters( 'generate_page_hero_output', sprintf(
- '
',
- trim( $options['container_classes'] ),
- trim( $options['inner_container_classes'] ),
- $options['content']
- ), $options );
+ // phpcs:ignore -- No escaping needed.
+ echo apply_filters(
+ 'generate_page_hero_output',
+ sprintf(
+ '
',
+ trim( $options['container_classes'] ),
+ trim( $options['inner_container_classes'] ),
+ $options['content']
+ ),
+ $options
+ );
}
/**
@@ -156,9 +189,9 @@ class GeneratePress_Hero {
public static function build_css() {
$options = self::get_options();
- // Initiate our CSS class
+ // Initiate our CSS class.
require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php';
- $css = new GeneratePress_Pro_CSS;
+ $css = new GeneratePress_Pro_CSS();
$image_url = false;
if ( $options['background_image'] && function_exists( 'get_the_post_thumbnail_url' ) ) {
@@ -180,16 +213,16 @@ class GeneratePress_Hero {
$image_url = apply_filters( 'generate_page_hero_background_image_url', $image_url, $options );
// Figure out desktop units.
- $options['padding_top_unit'] = $options['padding_top_unit'] ? $options['padding_top_unit'] : 'px';
- $options['padding_right_unit'] = $options['padding_right_unit'] ? $options['padding_right_unit'] : 'px';
+ $options['padding_top_unit'] = $options['padding_top_unit'] ? $options['padding_top_unit'] : 'px';
+ $options['padding_right_unit'] = $options['padding_right_unit'] ? $options['padding_right_unit'] : 'px';
$options['padding_bottom_unit'] = $options['padding_bottom_unit'] ? $options['padding_bottom_unit'] : 'px';
- $options['padding_left_unit'] = $options['padding_left_unit'] ? $options['padding_left_unit'] : 'px';
+ $options['padding_left_unit'] = $options['padding_left_unit'] ? $options['padding_left_unit'] : 'px';
// Figure out mobile units.
- $options['padding_top_unit_mobile'] = $options['padding_top_unit_mobile'] ? $options['padding_top_unit_mobile'] : 'px';
- $options['padding_right_unit_mobile'] = $options['padding_right_unit_mobile'] ? $options['padding_right_unit_mobile'] : 'px';
- $options['padding_bottom_unit_mobile'] = $options['padding_bottom_unit_mobile'] ? $options['padding_bottom_unit_mobile'] : 'px';
- $options['padding_left_unit_mobile'] = $options['padding_left_unit_mobile'] ? $options['padding_left_unit_mobile'] : 'px';
+ $options['padding_top_unit_mobile'] = $options['padding_top_unit_mobile'] ? $options['padding_top_unit_mobile'] : 'px';
+ $options['padding_right_unit_mobile'] = $options['padding_right_unit_mobile'] ? $options['padding_right_unit_mobile'] : 'px';
+ $options['padding_bottom_unit_mobile'] = $options['padding_bottom_unit_mobile'] ? $options['padding_bottom_unit_mobile'] : 'px';
+ $options['padding_left_unit_mobile'] = $options['padding_left_unit_mobile'] ? $options['padding_left_unit_mobile'] : 'px';
$css->set_selector( '.page-hero' );
@@ -349,24 +382,24 @@ class GeneratePress_Hero {
$css->add_property( 'background', $navigation_background );
$css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li > a, .header-wrap #mobile-header:not(.toggled):not(.navigation-stick) .main-nav > ul > li > a, .header-wrap .main-navigation:not(.toggled):not(.navigation-stick) .menu-toggle, .header-wrap .main-navigation:not(.toggled):not(.navigation-stick) .menu-toggle:hover, .main-navigation:not(.toggled):not(.navigation-stick) .mobile-bar-items a, .main-navigation:not(.toggled):not(.navigation-stick) .mobile-bar-items a:hover, .main-navigation:not(.toggled):not(.navigation-stick) .mobile-bar-items a:focus' );
- $css->add_property( 'color', esc_attr( $options['navigation_text_color' ] ) );
+ $css->add_property( 'color', esc_attr( $options['navigation_text_color'] ) );
$css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li:hover > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li:focus > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li.sfHover > a, .header-wrap #mobile-header:not(.toggled) .main-nav > ul > li:hover > a' );
$css->add_property( 'background', $navigation_background_hover );
- if ( '' !== $options[ 'navigation_text_color_hover' ] ) {
- $css->add_property( 'color', esc_attr( $options[ 'navigation_text_color_hover' ] ) );
+ if ( '' !== $options['navigation_text_color_hover'] ) {
+ $css->add_property( 'color', esc_attr( $options['navigation_text_color_hover'] ) );
} else {
- $css->add_property( 'color', esc_attr( $options[ 'navigation_text_color' ] ) );
+ $css->add_property( 'color', esc_attr( $options['navigation_text_color'] ) );
}
$css->set_selector( '.header-wrap #site-navigation:not(.toggled) .main-nav > ul > li[class*="current-menu-"] > a, .header-wrap #mobile-header:not(.toggled) .main-nav > ul > li[class*="current-menu-"] > a, .header-wrap #site-navigation:not(.toggled) .main-nav > ul > li[class*="current-menu-"]:hover > a, .header-wrap #mobile-header:not(.toggled) .main-nav > ul > li[class*="current-menu-"]:hover > a' );
$css->add_property( 'background', $navigation_background_current );
- if ( '' !== $options[ 'navigation_text_color_current' ] ) {
- $css->add_property( 'color', esc_attr( $options[ 'navigation_text_color_current' ] ) );
+ if ( '' !== $options['navigation_text_color_current'] ) {
+ $css->add_property( 'color', esc_attr( $options['navigation_text_color_current'] ) );
} else {
- $css->add_property( 'color', esc_attr( $options[ 'navigation_text_color' ] ) );
+ $css->add_property( 'color', esc_attr( $options['navigation_text_color'] ) );
}
}
@@ -467,59 +500,62 @@ class GeneratePress_Hero {
public static function get_options() {
$post_id = self::$post_id;
- return apply_filters( 'generate_hero_options', array(
- 'element_id' => $post_id,
- 'content' => get_post_meta( $post_id, '_generate_element_content', true ),
- 'classes' => get_post_meta( $post_id, '_generate_hero_custom_classes', true ),
- 'container' => get_post_meta( $post_id, '_generate_hero_container', true ),
- 'inner_container' => get_post_meta( $post_id, '_generate_hero_inner_container', true ),
- 'horizontal_alignment' => get_post_meta( $post_id, '_generate_hero_horizontal_alignment', true ),
- 'full_screen' => get_post_meta( $post_id, '_generate_hero_full_screen', true ),
- 'vertical_alignment' => get_post_meta( $post_id, '_generate_hero_vertical_alignment', true ),
- 'padding_top' => get_post_meta( $post_id, '_generate_hero_padding_top', true ),
- 'padding_top_unit' => get_post_meta( $post_id, '_generate_hero_padding_top_unit', true ),
- 'padding_right' => get_post_meta( $post_id, '_generate_hero_padding_right', true ),
- 'padding_right_unit' => get_post_meta( $post_id, '_generate_hero_padding_right_unit', true ),
- 'padding_bottom' => get_post_meta( $post_id, '_generate_hero_padding_bottom', true ),
- 'padding_bottom_unit' => get_post_meta( $post_id, '_generate_hero_padding_bottom_unit', true ),
- 'padding_left' => get_post_meta( $post_id, '_generate_hero_padding_left', true ),
- 'padding_left_unit' => get_post_meta( $post_id, '_generate_hero_padding_left_unit', true ),
- 'padding_top_mobile' => get_post_meta( $post_id, '_generate_hero_padding_top_mobile', true ),
- 'padding_top_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_top_unit_mobile', true ),
- 'padding_right_mobile' => get_post_meta( $post_id, '_generate_hero_padding_right_mobile', true ),
- 'padding_right_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_right_unit_mobile', true ),
- 'padding_bottom_mobile' => get_post_meta( $post_id, '_generate_hero_padding_bottom_mobile', true ),
- 'padding_bottom_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_bottom_unit_mobile', true ),
- 'padding_left_mobile' => get_post_meta( $post_id, '_generate_hero_padding_left_mobile', true ),
- 'padding_left_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_left_unit_mobile', true ),
- 'background_image' => get_post_meta( $post_id, '_generate_hero_background_image', true ),
- 'disable_featured_image' => get_post_meta( $post_id, '_generate_hero_disable_featured_image', true ),
- 'background_overlay' => get_post_meta( $post_id, '_generate_hero_background_overlay', true ),
- 'background_position' => get_post_meta( $post_id, '_generate_hero_background_position', true ),
- 'parallax' => get_post_meta( $post_id, '_generate_hero_background_parallax', true ),
- 'background_color' => get_post_meta( $post_id, '_generate_hero_background_color', true ),
- 'text_color' => get_post_meta( $post_id, '_generate_hero_text_color', true ),
- 'link_color' => get_post_meta( $post_id, '_generate_hero_link_color', true ),
- 'link_color_hover' => get_post_meta( $post_id, '_generate_hero_background_link_color_hover', true ),
- 'site_header_merge' => get_post_meta( $post_id, '_generate_site_header_merge', true ),
- 'site_header_height' => get_post_meta( $post_id, '_generate_site_header_height', true ),
- 'site_header_height_mobile' => get_post_meta( $post_id, '_generate_site_header_height_mobile', true ),
- 'site_logo' => get_post_meta( $post_id, '_generate_site_logo', true ),
- 'retina_logo' => get_post_meta( $post_id, '_generate_retina_logo', true ),
- 'navigation_logo' => get_post_meta( $post_id, '_generate_navigation_logo', true ),
- 'mobile_logo' => get_post_meta( $post_id, '_generate_mobile_logo', true ),
- 'navigation_location' => get_post_meta( $post_id, '_generate_navigation_location', true ),
- 'header_background_color' => get_post_meta( $post_id, '_generate_site_header_background_color', true ),
- 'header_title_color' => get_post_meta( $post_id, '_generate_site_header_title_color', true ),
- 'header_tagline_color' => get_post_meta( $post_id, '_generate_site_header_tagline_color', true ),
- 'navigation_colors' => get_post_meta( $post_id, '_generate_navigation_colors', true ),
- 'navigation_background_color' => get_post_meta( $post_id, '_generate_navigation_background_color', true ),
- 'navigation_text_color' => get_post_meta( $post_id, '_generate_navigation_text_color', true ),
- 'navigation_background_color_hover' => get_post_meta( $post_id, '_generate_navigation_background_color_hover', true ),
- 'navigation_text_color_hover' => get_post_meta( $post_id, '_generate_navigation_text_color_hover', true ),
- 'navigation_background_color_current' => get_post_meta( $post_id, '_generate_navigation_background_color_current', true ),
- 'navigation_text_color_current' => get_post_meta( $post_id, '_generate_navigation_text_color_current', true ),
- ) );
+ return apply_filters(
+ 'generate_hero_options',
+ array(
+ 'element_id' => $post_id,
+ 'content' => get_post_meta( $post_id, '_generate_element_content', true ),
+ 'classes' => get_post_meta( $post_id, '_generate_hero_custom_classes', true ),
+ 'container' => get_post_meta( $post_id, '_generate_hero_container', true ),
+ 'inner_container' => get_post_meta( $post_id, '_generate_hero_inner_container', true ),
+ 'horizontal_alignment' => get_post_meta( $post_id, '_generate_hero_horizontal_alignment', true ),
+ 'full_screen' => get_post_meta( $post_id, '_generate_hero_full_screen', true ),
+ 'vertical_alignment' => get_post_meta( $post_id, '_generate_hero_vertical_alignment', true ),
+ 'padding_top' => get_post_meta( $post_id, '_generate_hero_padding_top', true ),
+ 'padding_top_unit' => get_post_meta( $post_id, '_generate_hero_padding_top_unit', true ),
+ 'padding_right' => get_post_meta( $post_id, '_generate_hero_padding_right', true ),
+ 'padding_right_unit' => get_post_meta( $post_id, '_generate_hero_padding_right_unit', true ),
+ 'padding_bottom' => get_post_meta( $post_id, '_generate_hero_padding_bottom', true ),
+ 'padding_bottom_unit' => get_post_meta( $post_id, '_generate_hero_padding_bottom_unit', true ),
+ 'padding_left' => get_post_meta( $post_id, '_generate_hero_padding_left', true ),
+ 'padding_left_unit' => get_post_meta( $post_id, '_generate_hero_padding_left_unit', true ),
+ 'padding_top_mobile' => get_post_meta( $post_id, '_generate_hero_padding_top_mobile', true ),
+ 'padding_top_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_top_unit_mobile', true ),
+ 'padding_right_mobile' => get_post_meta( $post_id, '_generate_hero_padding_right_mobile', true ),
+ 'padding_right_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_right_unit_mobile', true ),
+ 'padding_bottom_mobile' => get_post_meta( $post_id, '_generate_hero_padding_bottom_mobile', true ),
+ 'padding_bottom_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_bottom_unit_mobile', true ),
+ 'padding_left_mobile' => get_post_meta( $post_id, '_generate_hero_padding_left_mobile', true ),
+ 'padding_left_unit_mobile' => get_post_meta( $post_id, '_generate_hero_padding_left_unit_mobile', true ),
+ 'background_image' => get_post_meta( $post_id, '_generate_hero_background_image', true ),
+ 'disable_featured_image' => get_post_meta( $post_id, '_generate_hero_disable_featured_image', true ),
+ 'background_overlay' => get_post_meta( $post_id, '_generate_hero_background_overlay', true ),
+ 'background_position' => get_post_meta( $post_id, '_generate_hero_background_position', true ),
+ 'parallax' => get_post_meta( $post_id, '_generate_hero_background_parallax', true ),
+ 'background_color' => get_post_meta( $post_id, '_generate_hero_background_color', true ),
+ 'text_color' => get_post_meta( $post_id, '_generate_hero_text_color', true ),
+ 'link_color' => get_post_meta( $post_id, '_generate_hero_link_color', true ),
+ 'link_color_hover' => get_post_meta( $post_id, '_generate_hero_background_link_color_hover', true ),
+ 'site_header_merge' => get_post_meta( $post_id, '_generate_site_header_merge', true ),
+ 'site_header_height' => get_post_meta( $post_id, '_generate_site_header_height', true ),
+ 'site_header_height_mobile' => get_post_meta( $post_id, '_generate_site_header_height_mobile', true ),
+ 'site_logo' => get_post_meta( $post_id, '_generate_site_logo', true ),
+ 'retina_logo' => get_post_meta( $post_id, '_generate_retina_logo', true ),
+ 'navigation_logo' => get_post_meta( $post_id, '_generate_navigation_logo', true ),
+ 'mobile_logo' => get_post_meta( $post_id, '_generate_mobile_logo', true ),
+ 'navigation_location' => get_post_meta( $post_id, '_generate_navigation_location', true ),
+ 'header_background_color' => get_post_meta( $post_id, '_generate_site_header_background_color', true ),
+ 'header_title_color' => get_post_meta( $post_id, '_generate_site_header_title_color', true ),
+ 'header_tagline_color' => get_post_meta( $post_id, '_generate_site_header_tagline_color', true ),
+ 'navigation_colors' => get_post_meta( $post_id, '_generate_navigation_colors', true ),
+ 'navigation_background_color' => get_post_meta( $post_id, '_generate_navigation_background_color', true ),
+ 'navigation_text_color' => get_post_meta( $post_id, '_generate_navigation_text_color', true ),
+ 'navigation_background_color_hover' => get_post_meta( $post_id, '_generate_navigation_background_color_hover', true ),
+ 'navigation_text_color_hover' => get_post_meta( $post_id, '_generate_navigation_text_color_hover', true ),
+ 'navigation_background_color_current' => get_post_meta( $post_id, '_generate_navigation_background_color_current', true ),
+ 'navigation_text_color_current' => get_post_meta( $post_id, '_generate_navigation_text_color_current', true ),
+ )
+ );
}
/**
@@ -627,12 +663,15 @@ class GeneratePress_Hero {
return;
}
- $attr = apply_filters( 'generate_page_hero_logo_attributes', array(
- 'class' => 'header-image',
- 'alt' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
- 'src' => $logo_url,
- 'title' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
- ) );
+ $attr = apply_filters(
+ 'generate_page_hero_logo_attributes',
+ array(
+ 'class' => 'header-image',
+ 'alt' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
+ 'src' => $logo_url,
+ 'title' => esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
+ )
+ );
if ( '' !== $retina_logo_url ) {
$attr['srcset'] = $logo_url . ' 1x, ' . $retina_logo_url . ' 2x';
@@ -653,16 +692,22 @@ class GeneratePress_Hero {
$html_attr .= " $name=" . '"' . $value . '"';
}
- echo apply_filters( 'generate_page_hero_logo_output', sprintf( // WPCS: XSS ok, sanitization ok.
- '
-
-
-
-
',
- esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
- esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
+ // phpcs:ignore -- Escaping not needed.
+ echo apply_filters(
+ 'generate_page_hero_logo_output',
+ sprintf(
+ '
+
+
+
+
',
+ esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ),
+ esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
+ $html_attr
+ ),
+ $logo_url,
$html_attr
- ), $logo_url, $html_attr );
+ );
}
/**
@@ -680,7 +725,7 @@ class GeneratePress_Hero {
',
- esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
+ esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
esc_url( wp_get_attachment_url( $options['navigation_logo'] ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
@@ -706,7 +751,7 @@ class GeneratePress_Hero {
',
- esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ),
+ esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
esc_url( wp_get_attachment_url( $options['mobile_logo'] ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) )
@@ -753,7 +798,7 @@ class GeneratePress_Hero {
*
* @since 1.7
*
- * @param $classes Existing classes.
+ * @param array $classes Existing classes.
* @return array New classes.
*/
public static function site_header_classes( $classes ) {
@@ -771,27 +816,27 @@ class GeneratePress_Hero {
public static function remove_template_elements() {
$options = self::get_options();
- if ( strpos( $options[ 'content' ], '{{post_title}}' ) !== false ) {
+ if ( strpos( $options['content'], '{{post_title}}' ) !== false ) {
add_filter( 'generate_show_title', '__return_false' );
remove_action( 'generate_archive_title', 'generate_archive_title' );
add_filter( 'post_class', array( self::$hero, 'remove_hentry' ) );
}
- if ( strpos( $options[ 'content' ], '{{post_date}}' ) !== false ) {
+ if ( strpos( $options['content'], '{{post_date}}' ) !== false ) {
add_filter( 'generate_post_date', '__return_false' );
add_filter( 'post_class', array( self::$hero, 'remove_hentry' ) );
}
- if ( strpos( $options[ 'content' ], '{{post_author}}' ) !== false ) {
+ if ( strpos( $options['content'], '{{post_author}}' ) !== false ) {
add_filter( 'generate_post_author', '__return_false' );
add_filter( 'post_class', array( self::$hero, 'remove_hentry' ) );
}
- if ( strpos( $options[ 'content' ], '{{post_terms.category}}' ) !== false ) {
+ if ( strpos( $options['content'], '{{post_terms.category}}' ) !== false ) {
add_filter( 'generate_show_categories', '__return_false' );
}
- if ( strpos( $options[ 'content' ], '{{post_terms.post_tag}}' ) !== false ) {
+ if ( strpos( $options['content'], '{{post_terms.post_tag}}' ) !== false ) {
add_filter( 'generate_show_tags', '__return_false' );
}
}
@@ -801,7 +846,7 @@ class GeneratePress_Hero {
*
* @since 1.7
*
- * @param $content The content to check.
+ * @param string $content The content to check.
* @return mixed The content with the template tags replaced.
*/
public static function template_tags( $content ) {
@@ -831,7 +876,8 @@ class GeneratePress_Hero {
$time_string = '