Merge branch 'develop' into feature/blocks

This commit is contained in:
Robin Cornett
2019-06-23 14:34:05 -04:00
6 changed files with 70 additions and 9 deletions
+14 -3
View File
@@ -46,7 +46,7 @@ __Display Featured Image for Genesis__ has some styling built in but I have inte
* `.featured` is appended to the large image output directly above the post/page content.
## Requirements
* WordPress 4.4, tested up to 5.2
* WordPress 4.8, tested up to 5.2
* the Genesis Framework
## Installation
@@ -98,6 +98,15 @@ Yes and no. Technically, it does, even older (XHTML) themes. However, depending
As of version 3.1.0, you can choose to display even banner images completely with WordPress' native responsive images and CSS. No JavaScript required. Just visit the settings page (the Banner Output tab) and check the "Disable JavaScript" option. If you have previously used the banner (backstretch) featured image, you may notice that the output is slightly different, but it should be very close to the same, and easier to override with pure CSS if you need to.
### I switched to the scriptless banner image option and the output is more than a little different. What happened?
Generally, the banner images will display more or less the same whether you choose to use the JavaScript version or not. Where you may experience a significant difference is if you have the following setup:
* your theme CSS includes a max-height for the `.big-leader` element which is significantly different than the screen height (at least sometimes)
* your plugin settings leave the max-height for the banner image empty
The scriptless banner image position will ignore the parent container max-height. If you set the Maximum Height in the plugin, the new rule is added to the `.big-leader__image` instead of the `.big-leader` container. So if your theme is set up this way but you want to switch to the scriptless banner image, you can either enter the max-height number on the plugin settings options, or you can add the same max-height rule to your CSS, but on the `.big-leader__image` element in addition to the `.big-leader`. The plugin will add the rule to both elements if you use the setting.
### Can I add a Display Featured Image widget to my post or page content?
Yes. As of version 3.0.0, shortcodes for each widget have been added to the plugin. Shortcodes include:
@@ -202,13 +211,15 @@ _Note:_ __Display Featured Image for Genesis__ determines the size of your banne
If you need to control the size of the banner Featured Image output with more attention to the user's screen size, you will want to consider a CSS approach instead. You can use the plugin's Maximum Height setting, which will affect all screen sizes, or add something like this to your theme's stylesheet, or the additional CSS panel in the Customizer:
```css
.big-leader {
.big-leader,
.big-leader__image {
max-height: 700px;
}
@media only screen and (max-width: 800px) {
.big-leader {
.big-leader,
.big-leader__image {
max-height: 300px;
}
}
@@ -301,7 +301,6 @@ class Display_Featured_Image_Genesis_Common {
return $attachment_url;
}
_deprecated_function( __FUNCTION__, '3.1.0' );
$attachment_id = false;
// if we're running 4.0 or later, we can do this all using a new core function.
@@ -277,6 +277,7 @@ class Display_Featured_Image_Genesis_Description {
global $wp_embed;
$original = $content;
$content = trim( $content );
$content = wp_kses_post( $content );
$content = wptexturize( $content );
$content = wpautop( $content );
$content = shortcode_unautop( $content );
@@ -260,8 +260,9 @@ class Display_Featured_Image_Genesis_Output {
$exclude_front = is_front_page() && $setting['exclude_front'];
$post_type = get_post_type();
$skip_singular = is_singular() && isset( $setting['skip'][ $post_type ] ) && $setting['skip'][ $post_type ] ? true : false;
$post_meta = is_singular() && 1 === (int) get_post_meta( get_the_ID(), '_displayfeaturedimagegenesis_disable', true );
if ( $this->get_skipped_posttypes() || $skip_singular || $exclude_front || 1 === (int) get_post_meta( get_the_ID(), '_displayfeaturedimagegenesis_disable', true ) ) {
if ( $this->get_skipped_posttypes() || $skip_singular || $exclude_front || $post_meta ) {
$disable = true;
}
@@ -471,4 +472,41 @@ class Display_Featured_Image_Genesis_Output {
return $key ? $this->setting[ $key ] : $this->setting;
}
/**
* Remove Genesis titles/descriptions
* Deprecated in 2.4.0 as function was moved to the descriptions class instead.
*
* @since 2.3.1
*/
public function remove_title_descriptions() {
$description = $this->get_description_class();
_deprecated_function( __FUNCTION__, '3.1.0', '$description->remove_title_descriptions' );
$description->remove_title_descriptions();
}
/**
* Do title and description together (for excerpt output)
* Deprecated in 2.4.0 as function was moved to the descriptions class instead.
*
* @since 2.3.1
*/
public function do_title_descriptions() {
$description = $this->get_description_class();
_deprecated_function( __FUNCTION__, '3.1.0', '$description->do_title_descriptions' );
$description->do_title_descriptions();
}
/**
* Separate archive titles from descriptions. Titles show in leader image
* area; descriptions show before loop.
* Deprecated in 2.4.0 as function was moved to the descriptions class instead.
*
* @since 1.3.0
*/
public function add_descriptions() {
$description = $this->get_description_class();
_deprecated_function( __FUNCTION__, '3.1.0', '$description->add_descriptions' );
$description->add_descriptions();
}
}
@@ -75,7 +75,7 @@ class Display_Featured_Image_Genesis_Settings_Validate {
switch ( $field['type'] ) {
case 'number':
if ( 'max_height' === $field['id'] && empty( $new_value ) ) {
continue;
break;
}
$new_value = $this->check_value( $new_value, $this->setting[ $field['id'] ], $field['min'], $field['max'] );
break;
+15 -3
View File
@@ -6,6 +6,7 @@ Tags: banner, featured image, featured images, genesis, studiopress, post thumbn
Requires at least: 4.8
Tested up to: 5.2
Stable tag: 3.1.0
Requires PHP: 5.6
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@@ -69,6 +70,15 @@ Yes and no. Technically, it does, even older (XHTML) themes. However, depending
As of version 3.1.0, you can choose to display even banner images completely with WordPress' native responsive images and CSS. No JavaScript required. Just visit the settings page (the Banner Output tab) and check the "Disable JavaScript" option. If you have previously used the banner (backstretch) featured image, you may notice that the output is slightly different, but it should be very close to the same, and easier to override with pure CSS if you need to.
= I switched to the scriptless banner image option and the output is more than a little different. What happened? =
Generally, the banner images will display more or less the same whether you choose to use the JavaScript version or not. Where you may experience a significant difference is if you have the following setup:
* your theme CSS includes a max-height for the `.big-leader` element which is significantly different than the screen height (at least sometimes)
* your plugin settings leave the max-height for the banner image empty
The scriptless banner image position will ignore the parent container max-height. If you set the Maximum Height in the plugin, the new rule is added to the `.big-leader__image` instead of the `.big-leader` container. So if your theme is set up this way but you want to switch to the scriptless banner image, you can either enter the max-height number on the plugin settings options, or you can add the same max-height rule to your CSS, but on the `.big-leader__image` element in addition to the `.big-leader`. The plugin will add the rule to both elements if you use the setting.
= Can I add a Display Featured Image widget to my post or page content? =
Yes. As of version 3.0.0, shortcodes for each widget have been added to the plugin. Shortcodes include:
@@ -164,13 +174,15 @@ _Note:_ __Display Featured Image for Genesis__ determines the size of your banne
If you need to control the size of the banner Featured Image output with more attention to the user's screen size, you will want to consider a CSS approach instead. You can use the plugin's Maximum Height setting, which will affect all screen sizes, or add something like this to your theme's stylesheet, or the additional CSS panel in the Customizer:
.big-leader {
.big-leader,
.big-leader__image {
max-height: 700px;
}
@media only screen and (max-width: 800px) {
.big-leader {
.big-leader,
.big-leader__image {
max-height: 300px;
}
}
@@ -204,7 +216,7 @@ Similar hooks:
== Upgrade Notice ==
3.1.0: new scriptless image option, improved/simplified styling
3.1.0: new scriptless image option, improved/simplified styling. Significant changes in code organization!
== Changelog ==