mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
Update for PHP8, version bump to 3.2.4
This commit is contained in:
@@ -12,7 +12,10 @@
|
||||
* Plugin Name: Display Featured Image for Genesis
|
||||
* Plugin URI: https://github.com/robincornett/display-featured-image-genesis/
|
||||
* Description: This plugin works within the Genesis Framework, to display featured images in beautiful and dynamic ways.
|
||||
* Version: 3.2.2
|
||||
* Version: 3.2.3
|
||||
* Requires at least: 5.2
|
||||
* Requires PHP: 7.4
|
||||
* Tested up to: 6.4
|
||||
* Author: Robin Cornett
|
||||
* Author URI: https://robincornett.com
|
||||
* Text Domain: display-featured-image-genesis
|
||||
|
||||
@@ -97,7 +97,6 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
$new_columns['featured_image'] = __( 'Image', 'display-featured-image-genesis' );
|
||||
|
||||
return array_merge( $new_columns, $columns );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +118,7 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
return;
|
||||
}
|
||||
|
||||
$taxonomy = filter_input( INPUT_POST, 'taxonomy', FILTER_SANITIZE_STRING );
|
||||
$taxonomy = filter_input( INPUT_POST, 'taxonomy', FILTER_SANITIZE_SPECIAL_CHARS );
|
||||
$taxonomy = ! is_null( $taxonomy ) ? $taxonomy : get_current_screen()->taxonomy;
|
||||
$args = array(
|
||||
'image_id' => $image_id,
|
||||
@@ -128,7 +127,6 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
);
|
||||
|
||||
echo wp_kses_post( $this->admin_featured_image( $args ) );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,7 +154,6 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
);
|
||||
|
||||
echo wp_kses_post( $this->admin_featured_image( $args ) );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +196,6 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
);
|
||||
|
||||
return $this->admin_featured_image( $args );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@ class Display_Featured_Image_Genesis_Common {
|
||||
* @var string
|
||||
* @since 1.4.3
|
||||
*/
|
||||
public $version = '3.2.2';
|
||||
public $version = '3.2.3';
|
||||
|
||||
/**
|
||||
* @var $instance
|
||||
|
||||
@@ -1,311 +1,311 @@
|
||||
<?php
|
||||
/**
|
||||
* Display Featured Image for Genesis
|
||||
*
|
||||
* @package DisplayFeaturedImageGenesis
|
||||
* @author Robin Cornett <hello@robincornett.com>
|
||||
* @link https://github.com/robincornett/display-featured-image-genesis/
|
||||
* @copyright 2014-2020 Robin Cornett
|
||||
* @license GPL-2.0+
|
||||
*/
|
||||
|
||||
/**
|
||||
* Main plugin class.
|
||||
*
|
||||
* @package DisplayFeaturedImageGenesis
|
||||
*/
|
||||
class Display_Featured_Image_Genesis {
|
||||
|
||||
/**
|
||||
* Admin area class: handles columns.
|
||||
* @var Display_Featured_Image_Genesis_Admin $admin
|
||||
*/
|
||||
protected $admin;
|
||||
|
||||
/**
|
||||
* Adds new author meta.
|
||||
* @var Display_Featured_Image_Genesis_Author $author
|
||||
*/
|
||||
protected $author;
|
||||
|
||||
/**
|
||||
* @var $customizer Display_Featured_Image_Genesis_Customizer
|
||||
*/
|
||||
protected $customizer;
|
||||
|
||||
/**
|
||||
* All archive description functions.
|
||||
* @var Display_Featured_Image_Genesis_Description $description
|
||||
*/
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* Handles all image output functionality
|
||||
* @var Display_Featured_Image_Genesis_Output $output
|
||||
*/
|
||||
protected $output;
|
||||
|
||||
/**
|
||||
* Updates metabox on post edit page
|
||||
* @var Display_Featured_Image_Genesis_Post_Meta $post_meta
|
||||
*/
|
||||
protected $post_meta;
|
||||
|
||||
/**
|
||||
* Handles RSS feed output
|
||||
* @var Display_Featured_Image_Genesis_RSS $rss
|
||||
*/
|
||||
protected $rss;
|
||||
|
||||
/**
|
||||
* Sets up settings page for the plugin.
|
||||
* @var Display_Featured_Image_Genesis_Settings $settings
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Handles term meta.
|
||||
* @var Display_Featured_Image_Genesis_Taxonomies $taxonomies
|
||||
*/
|
||||
protected $taxonomies;
|
||||
|
||||
/**
|
||||
* Register widgets and related shortcodes.
|
||||
*
|
||||
* @var \DisplayFeaturedImageGenesisWidgets
|
||||
*/
|
||||
protected $widgets;
|
||||
|
||||
/**
|
||||
* Display_Featured_Image_Genesis constructor.
|
||||
*
|
||||
* @param $admin
|
||||
* @param $author
|
||||
* @param $customizer
|
||||
* @param $output
|
||||
* @param $post_meta
|
||||
* @param $rss
|
||||
* @param $settings
|
||||
* @param $taxonomies
|
||||
* @param $widgets
|
||||
*/
|
||||
public function __construct( $admin, $author, $customizer, $output, $post_meta, $rss, $settings, $taxonomies, $widgets ) {
|
||||
$this->admin = $admin;
|
||||
$this->author = $author;
|
||||
$this->customizer = $customizer;
|
||||
$this->output = $output;
|
||||
$this->post_meta = $post_meta;
|
||||
$this->rss = $rss;
|
||||
$this->settings = $settings;
|
||||
$this->taxonomies = $taxonomies;
|
||||
$this->widgets = $widgets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main plugin function. Starts up all the things.
|
||||
*/
|
||||
public function run() {
|
||||
if ( 'genesis' !== basename( get_template_directory() ) ) {
|
||||
add_action( 'admin_init', array( $this, 'deactivate' ) );
|
||||
return;
|
||||
}
|
||||
|
||||
require_once plugin_dir_path( __FILE__ ) . 'helper-functions.php';
|
||||
|
||||
// Plugin setup
|
||||
add_action( 'after_setup_theme', array( $this, 'add_plugin_supports' ) );
|
||||
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
||||
add_filter( 'plugin_action_links_' . DISPLAYFEATUREDIMAGEGENESIS_BASENAME, array( $this, 'add_settings_link' ) );
|
||||
add_action( 'init', array( $this, 'check_settings' ) );
|
||||
|
||||
// Admin
|
||||
add_action( 'admin_init', array( $this->admin, 'set_up_columns' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||
|
||||
// Widgets
|
||||
add_action( 'widgets_init', array( $this->widgets, 'register_widgets' ) );
|
||||
add_action( 'widgets_init', array( $this->widgets, 'register_shortcodes' ) );
|
||||
add_action( 'init', array( $this->widgets, 'register_blocks' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this->widgets, 'enqueue_scripts' ) );
|
||||
|
||||
// Taxonomies, Authors
|
||||
add_filter( 'displayfeaturedimagegenesis_get_taxonomies', array( $this->taxonomies, 'remove_post_status_terms' ) );
|
||||
add_action( 'admin_init', array( $this->taxonomies, 'set_taxonomy_meta' ) );
|
||||
add_action( 'admin_init', array( $this->author, 'set_author_meta' ) );
|
||||
|
||||
// Post Meta
|
||||
add_action( 'add_meta_boxes', array( $this->post_meta, 'add_metabox' ), 10, 2 );
|
||||
add_filter( 'admin_post_thumbnail_html', array( $this->post_meta, 'meta_box' ), 10, 2 );
|
||||
add_action( 'save_post', array( $this->post_meta, 'save_meta' ) );
|
||||
|
||||
// Settings
|
||||
add_action( 'admin_menu', array( $this->settings, 'do_submenu_page' ) );
|
||||
add_filter( 'displayfeaturedimagegenesis_get_setting', array( $this->settings, 'get_display_setting' ) );
|
||||
|
||||
// Customizer
|
||||
add_action( 'customize_register', array( $this->customizer, 'customizer' ) );
|
||||
|
||||
// Front End Output
|
||||
add_action( 'get_header', array( $this->output, 'manage_output' ) );
|
||||
add_filter( 'genesis_get_image_default_args', array( $this->output, 'change_thumbnail_fallback' ) );
|
||||
|
||||
// RSS
|
||||
add_action( 'template_redirect', array( $this->rss, 'maybe_do_feed' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* deactivates the plugin if Genesis isn't running
|
||||
*
|
||||
* @since 1.1.2
|
||||
*
|
||||
*/
|
||||
public function deactivate() {
|
||||
deactivate_plugins( DISPLAYFEATUREDIMAGEGENESIS_BASENAME );
|
||||
add_action( 'admin_notices', array( $this, 'error_message' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Error message if we're not using the Genesis Framework.
|
||||
*
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public function error_message() {
|
||||
|
||||
$error = sprintf( __( 'Sorry, Display Featured Image for Genesis works only with the Genesis Framework. It has been deactivated.', 'display-featured-image-genesis' ) );
|
||||
|
||||
if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
|
||||
$error = $error . sprintf(
|
||||
/* translators: placeholder is the user's PHP version. */
|
||||
__( ' But since we\'re talking anyway, did you know that your server is running PHP version %1$s, which is outdated? You should ask your host to update that for you.', 'display-featured-image-genesis' ),
|
||||
PHP_VERSION
|
||||
);
|
||||
}
|
||||
|
||||
echo '<div class="error"><p>' . esc_attr( $error ) . '</p></div>';
|
||||
|
||||
if ( isset( $_GET['activate'] ) ) {
|
||||
unset( $_GET['activate'] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register a custom image size for banners, and add excerpt support for pages if needed.
|
||||
* @since 1.3.0
|
||||
*
|
||||
* If the Core image size has not been registered (pre-5.3), register it. The plugin is
|
||||
* transitioning to using the new 2048x2048 image size.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function add_plugin_supports() {
|
||||
|
||||
if ( ! has_image_size( '2048x2048' ) ) {
|
||||
$args = apply_filters(
|
||||
'displayfeaturedimagegenesis_custom_image_size',
|
||||
array(
|
||||
'width' => 2048,
|
||||
'height' => 2048,
|
||||
'crop' => false,
|
||||
)
|
||||
);
|
||||
add_image_size( '2048x2048', (int) $args['width'], (int) $args['height'], (bool) $args['crop'] );
|
||||
}
|
||||
|
||||
$move_excerpts = displayfeaturedimagegenesis_get_setting( 'move_excerpts' );
|
||||
if ( $move_excerpts ) {
|
||||
add_post_type_support( 'page', 'excerpt' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up text domain for translations
|
||||
*
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public function load_textdomain() {
|
||||
load_plugin_textdomain( 'display-featured-image-genesis' );
|
||||
}
|
||||
|
||||
/**
|
||||
* enqueue admin scripts
|
||||
*
|
||||
* @since 1.2.1
|
||||
*/
|
||||
public function enqueue_scripts() {
|
||||
|
||||
$version = displayfeaturedimagegenesis_get()->version;
|
||||
$minify = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
wp_register_script( 'displayfeaturedimage-upload', plugins_url( "/includes/js/settings-upload{$minify}.js", dirname( __FILE__ ) ), array( 'jquery', 'media-upload', 'thickbox' ), $version, true );
|
||||
wp_register_script( 'widget_selector', plugins_url( "/includes/js/widget-selector{$minify}.js", dirname( __FILE__ ) ), array( 'jquery' ), $version, true );
|
||||
|
||||
$screen = get_current_screen();
|
||||
$screen_ids = array(
|
||||
'appearance_page_displayfeaturedimagegenesis',
|
||||
'profile',
|
||||
'user-edit',
|
||||
);
|
||||
|
||||
if ( in_array( $screen->id, $screen_ids, true ) || ! empty( $screen->taxonomy ) ) {
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script( 'displayfeaturedimage-upload' );
|
||||
wp_localize_script(
|
||||
'displayfeaturedimage-upload',
|
||||
'DisplayFeaturedImageGenesis',
|
||||
array(
|
||||
'text' => __( 'Select Image', 'display-featured-image-genesis' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add link to plugin settings page in plugin table
|
||||
* @param $links array link to settings page
|
||||
* @return array
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
public function add_settings_link( $links ) {
|
||||
$links[] = sprintf( '<a href="%s">%s</a>', esc_url( admin_url( 'themes.php?page=displayfeaturedimagegenesis' ) ), esc_attr__( 'Settings', 'display-featured-image-genesis' ) );
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the plugin setting and maybe update it to use the new image size,
|
||||
* which is registered in Core in WP5.3.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function check_settings() {
|
||||
|
||||
$setting = displayfeaturedimagegenesis_get_setting();
|
||||
if ( empty( $setting ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$new_setting = array();
|
||||
if ( 'displayfeaturedimage_backstretch' === $setting['image_size'] ) {
|
||||
$new_setting['image_size'] = '2048x2048';
|
||||
}
|
||||
|
||||
if ( $new_setting ) {
|
||||
$this->update_settings(
|
||||
$new_setting,
|
||||
$setting
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an array of new settings, merges with the current setting, and updates the setting.
|
||||
*
|
||||
* @param array $new
|
||||
* @param array $old_setting
|
||||
* @return boolean
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function update_settings( $new = array(), $old_setting ) {
|
||||
return update_option( 'displayfeaturedimagegenesis', wp_parse_args( $new, $old_setting ) );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* Display Featured Image for Genesis
|
||||
*
|
||||
* @package DisplayFeaturedImageGenesis
|
||||
* @author Robin Cornett <hello@robincornett.com>
|
||||
* @link https://github.com/robincornett/display-featured-image-genesis/
|
||||
* @copyright 2014-2020 Robin Cornett
|
||||
* @license GPL-2.0+
|
||||
*/
|
||||
|
||||
/**
|
||||
* Main plugin class.
|
||||
*
|
||||
* @package DisplayFeaturedImageGenesis
|
||||
*/
|
||||
class Display_Featured_Image_Genesis {
|
||||
|
||||
/**
|
||||
* Admin area class: handles columns.
|
||||
* @var Display_Featured_Image_Genesis_Admin $admin
|
||||
*/
|
||||
protected $admin;
|
||||
|
||||
/**
|
||||
* Adds new author meta.
|
||||
* @var Display_Featured_Image_Genesis_Author $author
|
||||
*/
|
||||
protected $author;
|
||||
|
||||
/**
|
||||
* @var $customizer Display_Featured_Image_Genesis_Customizer
|
||||
*/
|
||||
protected $customizer;
|
||||
|
||||
/**
|
||||
* All archive description functions.
|
||||
* @var Display_Featured_Image_Genesis_Description $description
|
||||
*/
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* Handles all image output functionality
|
||||
* @var Display_Featured_Image_Genesis_Output $output
|
||||
*/
|
||||
protected $output;
|
||||
|
||||
/**
|
||||
* Updates metabox on post edit page
|
||||
* @var Display_Featured_Image_Genesis_Post_Meta $post_meta
|
||||
*/
|
||||
protected $post_meta;
|
||||
|
||||
/**
|
||||
* Handles RSS feed output
|
||||
* @var Display_Featured_Image_Genesis_RSS $rss
|
||||
*/
|
||||
protected $rss;
|
||||
|
||||
/**
|
||||
* Sets up settings page for the plugin.
|
||||
* @var Display_Featured_Image_Genesis_Settings $settings
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Handles term meta.
|
||||
* @var Display_Featured_Image_Genesis_Taxonomies $taxonomies
|
||||
*/
|
||||
protected $taxonomies;
|
||||
|
||||
/**
|
||||
* Register widgets and related shortcodes.
|
||||
*
|
||||
* @var \DisplayFeaturedImageGenesisWidgets
|
||||
*/
|
||||
protected $widgets;
|
||||
|
||||
/**
|
||||
* Display_Featured_Image_Genesis constructor.
|
||||
*
|
||||
* @param $admin
|
||||
* @param $author
|
||||
* @param $customizer
|
||||
* @param $output
|
||||
* @param $post_meta
|
||||
* @param $rss
|
||||
* @param $settings
|
||||
* @param $taxonomies
|
||||
* @param $widgets
|
||||
*/
|
||||
public function __construct( $admin, $author, $customizer, $output, $post_meta, $rss, $settings, $taxonomies, $widgets ) {
|
||||
$this->admin = $admin;
|
||||
$this->author = $author;
|
||||
$this->customizer = $customizer;
|
||||
$this->output = $output;
|
||||
$this->post_meta = $post_meta;
|
||||
$this->rss = $rss;
|
||||
$this->settings = $settings;
|
||||
$this->taxonomies = $taxonomies;
|
||||
$this->widgets = $widgets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main plugin function. Starts up all the things.
|
||||
*/
|
||||
public function run() {
|
||||
if ( 'genesis' !== basename( get_template_directory() ) ) {
|
||||
add_action( 'admin_init', array( $this, 'deactivate' ) );
|
||||
return;
|
||||
}
|
||||
|
||||
require_once plugin_dir_path( __FILE__ ) . 'helper-functions.php';
|
||||
|
||||
// Plugin setup
|
||||
add_action( 'after_setup_theme', array( $this, 'add_plugin_supports' ) );
|
||||
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
||||
add_filter( 'plugin_action_links_' . DISPLAYFEATUREDIMAGEGENESIS_BASENAME, array( $this, 'add_settings_link' ) );
|
||||
add_action( 'init', array( $this, 'check_settings' ) );
|
||||
|
||||
// Admin
|
||||
add_action( 'admin_init', array( $this->admin, 'set_up_columns' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||
|
||||
// Widgets
|
||||
add_action( 'widgets_init', array( $this->widgets, 'register_widgets' ) );
|
||||
add_action( 'widgets_init', array( $this->widgets, 'register_shortcodes' ) );
|
||||
add_action( 'init', array( $this->widgets, 'register_blocks' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this->widgets, 'enqueue_scripts' ) );
|
||||
|
||||
// Taxonomies, Authors
|
||||
add_filter( 'displayfeaturedimagegenesis_get_taxonomies', array( $this->taxonomies, 'remove_post_status_terms' ) );
|
||||
add_action( 'admin_init', array( $this->taxonomies, 'set_taxonomy_meta' ) );
|
||||
add_action( 'admin_init', array( $this->author, 'set_author_meta' ) );
|
||||
|
||||
// Post Meta
|
||||
add_action( 'add_meta_boxes', array( $this->post_meta, 'add_metabox' ), 10, 2 );
|
||||
add_filter( 'admin_post_thumbnail_html', array( $this->post_meta, 'meta_box' ), 10, 2 );
|
||||
add_action( 'save_post', array( $this->post_meta, 'save_meta' ) );
|
||||
|
||||
// Settings
|
||||
add_action( 'admin_menu', array( $this->settings, 'do_submenu_page' ) );
|
||||
add_filter( 'displayfeaturedimagegenesis_get_setting', array( $this->settings, 'get_display_setting' ) );
|
||||
|
||||
// Customizer
|
||||
add_action( 'customize_register', array( $this->customizer, 'customizer' ) );
|
||||
|
||||
// Front End Output
|
||||
add_action( 'get_header', array( $this->output, 'manage_output' ) );
|
||||
add_filter( 'genesis_get_image_default_args', array( $this->output, 'change_thumbnail_fallback' ) );
|
||||
|
||||
// RSS
|
||||
add_action( 'template_redirect', array( $this->rss, 'maybe_do_feed' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* deactivates the plugin if Genesis isn't running
|
||||
*
|
||||
* @since 1.1.2
|
||||
*
|
||||
*/
|
||||
public function deactivate() {
|
||||
deactivate_plugins( DISPLAYFEATUREDIMAGEGENESIS_BASENAME );
|
||||
add_action( 'admin_notices', array( $this, 'error_message' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Error message if we're not using the Genesis Framework.
|
||||
*
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public function error_message() {
|
||||
|
||||
$error = sprintf( __( 'Sorry, Display Featured Image for Genesis works only with the Genesis Framework. It has been deactivated.', 'display-featured-image-genesis' ) );
|
||||
|
||||
if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
|
||||
$error = $error . sprintf(
|
||||
/* translators: placeholder is the user's PHP version. */
|
||||
__( ' But since we\'re talking anyway, did you know that your server is running PHP version %1$s, which is outdated? You should ask your host to update that for you.', 'display-featured-image-genesis' ),
|
||||
PHP_VERSION
|
||||
);
|
||||
}
|
||||
|
||||
echo '<div class="error"><p>' . esc_attr( $error ) . '</p></div>';
|
||||
|
||||
if ( isset( $_GET['activate'] ) ) {
|
||||
unset( $_GET['activate'] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register a custom image size for banners, and add excerpt support for pages if needed.
|
||||
* @since 1.3.0
|
||||
*
|
||||
* If the Core image size has not been registered (pre-5.3), register it. The plugin is
|
||||
* transitioning to using the new 2048x2048 image size.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function add_plugin_supports() {
|
||||
|
||||
if ( ! has_image_size( '2048x2048' ) ) {
|
||||
$args = apply_filters(
|
||||
'displayfeaturedimagegenesis_custom_image_size',
|
||||
array(
|
||||
'width' => 2048,
|
||||
'height' => 2048,
|
||||
'crop' => false,
|
||||
)
|
||||
);
|
||||
add_image_size( '2048x2048', (int) $args['width'], (int) $args['height'], (bool) $args['crop'] );
|
||||
}
|
||||
|
||||
$move_excerpts = displayfeaturedimagegenesis_get_setting( 'move_excerpts' );
|
||||
if ( $move_excerpts ) {
|
||||
add_post_type_support( 'page', 'excerpt' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up text domain for translations
|
||||
*
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public function load_textdomain() {
|
||||
load_plugin_textdomain( 'display-featured-image-genesis' );
|
||||
}
|
||||
|
||||
/**
|
||||
* enqueue admin scripts
|
||||
*
|
||||
* @since 1.2.1
|
||||
*/
|
||||
public function enqueue_scripts() {
|
||||
|
||||
$version = displayfeaturedimagegenesis_get()->version;
|
||||
$minify = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
wp_register_script( 'displayfeaturedimage-upload', plugins_url( "/includes/js/settings-upload{$minify}.js", dirname( __FILE__ ) ), array( 'jquery', 'media-upload', 'thickbox' ), $version, true );
|
||||
wp_register_script( 'widget_selector', plugins_url( "/includes/js/widget-selector{$minify}.js", dirname( __FILE__ ) ), array( 'jquery' ), $version, true );
|
||||
|
||||
$screen = get_current_screen();
|
||||
$screen_ids = array(
|
||||
'appearance_page_displayfeaturedimagegenesis',
|
||||
'profile',
|
||||
'user-edit',
|
||||
);
|
||||
|
||||
if ( in_array( $screen->id, $screen_ids, true ) || ! empty( $screen->taxonomy ) ) {
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script( 'displayfeaturedimage-upload' );
|
||||
wp_localize_script(
|
||||
'displayfeaturedimage-upload',
|
||||
'DisplayFeaturedImageGenesis',
|
||||
array(
|
||||
'text' => __( 'Select Image', 'display-featured-image-genesis' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add link to plugin settings page in plugin table
|
||||
* @param $links array link to settings page
|
||||
* @return array
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
public function add_settings_link( $links ) {
|
||||
$links[] = sprintf( '<a href="%s">%s</a>', esc_url( admin_url( 'themes.php?page=displayfeaturedimagegenesis' ) ), esc_attr__( 'Settings', 'display-featured-image-genesis' ) );
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the plugin setting and maybe update it to use the new image size,
|
||||
* which is registered in Core in WP5.3.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public function check_settings() {
|
||||
|
||||
$setting = displayfeaturedimagegenesis_get_setting();
|
||||
if ( empty( $setting ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$new_setting = array();
|
||||
if ( 'displayfeaturedimage_backstretch' === $setting['image_size'] ) {
|
||||
$new_setting['image_size'] = '2048x2048';
|
||||
}
|
||||
|
||||
if ( $new_setting ) {
|
||||
$this->update_settings(
|
||||
$new_setting,
|
||||
$setting
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an array of new settings, merges with the current setting, and updates the setting.
|
||||
*
|
||||
* @param array $new
|
||||
* @param array $old_setting
|
||||
* @return boolean
|
||||
* @since 3.2.0
|
||||
*/
|
||||
private function update_settings( $new_setting = array(), $old_setting = array() ) {
|
||||
return update_option( 'displayfeaturedimagegenesis', wp_parse_args( $new_setting, $old_setting ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
div[class^="wp-block-displayfeaturedimagegenesis"]{overflow:auto}div[class^="wp-block-displayfeaturedimagegenesis"]:before{position:absolute;top:0;right:0;bottom:0;left:0;content:' ';background-color:rgba(255,255,255,0)}.displayfeaturedimagegenesis-placeholder{text-align:center;background:#eee;color:#111;padding:18px}
|
||||
div[class^=wp-block-displayfeaturedimagegenesis]{overflow:auto}div[class^=wp-block-displayfeaturedimagegenesis]:before{position:absolute;top:0;right:0;bottom:0;left:0;content:" ";background-color:rgba(255,255,255,0)}.displayfeaturedimagegenesis-placeholder{text-align:center;background:#eee;color:#111;padding:18px}
|
||||
@@ -1 +1 @@
|
||||
.has-leader .site-inner{margin-top:0}.big-leader{overflow:hidden;height:100vh;position:relative}.big-leader .wrap{position:absolute;right:0;bottom:0;left:0;width:100%;z-index:1}.big-leader__image{display:block;height:100vh;max-width:none;-o-object-fit:cover;object-fit:cover;width:100vw}.big-leader .featured-image-overlay{color:#fff;text-align:center}.big-leader .excerpt,.big-leader .archive-description{margin-bottom:24px;padding:24px;background:rgba(255,255,255,.85)}.big-leader p{margin-top:18px;margin-bottom:0}.home .big-leader p{margin-top:0}.home .big-leader p:last-child{margin-bottom:0}.big-leader .excerpt .entry-title,.big-leader .archive-description .archive-title{margin-bottom:0}@keyframes dfig-fadein{from{opacity:0}to{opacity:1}}.backstretch.no-js{max-height:600px}img.featured{max-width:100%}
|
||||
.has-leader .site-inner{margin-top:0}.big-leader{overflow:hidden;max-height:100vh;position:relative}.big-leader .wrap{position:absolute;right:0;bottom:0;left:0;width:100%;z-index:1}.big-leader__image{display:block;height:100vh;max-width:none;object-fit:cover;width:100vw}.big-leader .featured-image-overlay{color:#fff;text-align:center}.big-leader .excerpt,.big-leader .archive-description{margin-bottom:24px;padding:24px;background:rgba(255,255,255,.85)}.big-leader p{margin-top:18px;margin-bottom:0}.home .big-leader p{margin-top:0}.home .big-leader p:last-child{margin-bottom:0}.big-leader .excerpt .entry-title,.big-leader .archive-description .archive-title{margin-bottom:0}@keyframes dfig-fadein{from{opacity:0}to{opacity:1}}.backstretch.no-js{max-height:600px}img.featured{max-width:100%}
|
||||
@@ -1,380 +1,380 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class Display_Featured_Image_Genesis_Helper
|
||||
* @package DisplayFeaturedImageGenesis
|
||||
* @copyright 2017-2020 Robin Cornett
|
||||
*/
|
||||
class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisGetSetting {
|
||||
|
||||
/**
|
||||
* Base id/slug for the settings page.
|
||||
* @var string $page
|
||||
*/
|
||||
protected $page = 'displayfeaturedimagegenesis';
|
||||
|
||||
/**
|
||||
* The image settings class.
|
||||
* @var $images \DisplayFeaturedImageGenesisSettingsImages
|
||||
*/
|
||||
private $images;
|
||||
|
||||
/**
|
||||
* Generic function to add settings sections
|
||||
*
|
||||
* @since 2.4.0
|
||||
*
|
||||
* @param $sections
|
||||
*/
|
||||
protected function add_sections( $sections ) {
|
||||
|
||||
foreach ( $sections as $section ) {
|
||||
add_settings_section(
|
||||
$this->page . '_' . $section['id'],
|
||||
$section['title'],
|
||||
array( $this, 'section_description' ),
|
||||
$this->page . '_' . $section['tab']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic function to add settings fields
|
||||
*
|
||||
* @param $fields
|
||||
* @param array $sections registered sections
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
protected function add_fields( $fields, $sections ) {
|
||||
foreach ( $fields as $field ) {
|
||||
add_settings_field(
|
||||
$field['id'],
|
||||
sprintf( '<label for="%s-%s">%s</label>', $this->page, $field['id'], $field['title'] ),
|
||||
array( $this, 'do_field' ),
|
||||
$this->page . '_' . $sections[ $field['section'] ]['tab'],
|
||||
$this->page . '_' . $sections[ $field['section'] ]['id'],
|
||||
$field
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic field method.
|
||||
*
|
||||
* @param $field
|
||||
*/
|
||||
public function do_field( $field ) {
|
||||
$callback = $this->get_callback( $field );
|
||||
if ( is_callable( $callback ) ) {
|
||||
call_user_func( $callback, $field );
|
||||
}
|
||||
if ( ! empty( $field['description'] ) ) {
|
||||
$this->do_description( $field );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the correct method to output the field.
|
||||
*
|
||||
* @param $field
|
||||
*
|
||||
* @return array|bool
|
||||
* @since 3.1.0
|
||||
*/
|
||||
private function get_callback( $field ) {
|
||||
$callback = false;
|
||||
if ( ! empty( $field['type'] ) ) {
|
||||
$callback = "do_{$field['type']}";
|
||||
} elseif ( ! empty( $field['callback'] ) ) {
|
||||
$callback = $field['callback'];
|
||||
}
|
||||
|
||||
return $callback ? array( $this, $callback ) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set which tab is considered active.
|
||||
* @return string
|
||||
* @since 2.5.0
|
||||
*/
|
||||
protected function get_active_tab() {
|
||||
$tab = filter_input( INPUT_GET, 'tab', FILTER_SANITIZE_STRING );
|
||||
|
||||
return $tab ? $tab : 'main';
|
||||
}
|
||||
|
||||
/**
|
||||
* Echoes out the section description.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param $section
|
||||
*/
|
||||
public function section_description( $section ) {
|
||||
$id = str_replace( "{$this->page}_", '', $section['id'] );
|
||||
$method = "{$id}_section_description";
|
||||
if ( method_exists( $this, $method ) ) {
|
||||
echo wp_kses_post( wpautop( $this->$method() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic callback to create a number field setting.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_number( $args ) {
|
||||
printf(
|
||||
'<input type="number" step="1" min="%1$s" max="%2$s" id="%3$s" name="%5$s" value="%4$s" class="small-text" />%6$s',
|
||||
(int) $args['min'],
|
||||
(int) $args['max'],
|
||||
esc_attr( $this->get_field_id( $args ) ),
|
||||
esc_attr( $this->get_field_value( $args ) ),
|
||||
esc_attr( $this->get_field_name( $args ) ),
|
||||
esc_attr( $args['label'] )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* generic checkbox function (for all checkbox settings)
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_checkbox( $args ) {
|
||||
$name = $this->get_field_name( $args );
|
||||
$value = $this->get_field_value( $args );
|
||||
printf( '<input type="hidden" name="%s" value="0" />', esc_attr( $name ) );
|
||||
printf(
|
||||
'<label for="%1$s"><input type="checkbox" name="%4$s" id="%1$s" value="1" %2$s class="code" />%3$s</label>',
|
||||
esc_attr( $this->get_field_id( $args ) ),
|
||||
checked( 1, esc_attr( $value ), false ),
|
||||
esc_attr( $args['label'] ),
|
||||
esc_attr( $name )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a checkbox array.
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_checkbox_array( $args ) {
|
||||
echo '<fieldset>';
|
||||
$name = $this->get_field_name( $args );
|
||||
$id = $this->get_field_id( $args );
|
||||
$value = $this->get_field_value( $args );
|
||||
foreach ( $args['options'] as $choice => $label ) {
|
||||
$check = isset( $value[ $choice ] ) ? $value[ $choice ] : 0;
|
||||
printf(
|
||||
'<input type="hidden" name="%s[%s]" value="0" />',
|
||||
esc_attr( $name ),
|
||||
esc_attr( $choice )
|
||||
);
|
||||
printf(
|
||||
'<label for="%5$s-%1$s" style="margin-right:12px !important;"><input type="checkbox" name="%4$s[%1$s]" id="%5$s-%1$s" value="1"%2$s class="code" aria-labelledby="%5$s" />%3$s</label>',
|
||||
esc_attr( $choice ),
|
||||
checked( 1, $check, false ),
|
||||
esc_html( $label ),
|
||||
esc_attr( $name ),
|
||||
esc_attr( $id )
|
||||
);
|
||||
}
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
/**
|
||||
* radio buttons
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_radio( $args ) {
|
||||
echo '<fieldset>';
|
||||
$name = $this->get_field_name( $args );
|
||||
$id = $this->get_field_id( $args );
|
||||
$value = $this->get_field_value( $args );
|
||||
printf( '<legend class="screen-reader-text">%s</legend>', esc_html( $args['legend'] ) );
|
||||
foreach ( $args['choices'] as $choice => $label ) {
|
||||
printf(
|
||||
'<label for="%1$s-%2$s" style="margin-right:12px !important;"><input type="radio" id="%1$s-%2$s" name="%5$s" value="%2$s"%3$s />%4$s</label> ',
|
||||
esc_attr( $id ),
|
||||
esc_attr( $choice ),
|
||||
checked( $choice, $value, false ),
|
||||
esc_attr( $label ),
|
||||
esc_attr( $name )
|
||||
);
|
||||
}
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a select field.
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_select( $args ) {
|
||||
$value = $this->get_field_value( $args );
|
||||
printf(
|
||||
'<select id="%1$s" name="%2$s">',
|
||||
esc_attr( $this->get_field_id( $args ) ),
|
||||
esc_attr( $this->get_field_name( $args ) )
|
||||
);
|
||||
foreach ( (array) $args['choices'] as $option => $label ) {
|
||||
printf(
|
||||
'<option value="%s" %s>%s</option>',
|
||||
esc_attr( $option ),
|
||||
selected( $option, $value, false ),
|
||||
esc_attr( $label )
|
||||
);
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe instantiate the image settings class and do the image field.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
protected function do_image( $args ) {
|
||||
$images = $this->get_images_class();
|
||||
$images->do_image( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic callback to display a field description.
|
||||
*
|
||||
* @param $args array
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
protected function do_description( $args ) {
|
||||
$description = isset( $args['description'] ) ? $args['description'] : false;
|
||||
$function = $args['id'] . '_description';
|
||||
if ( method_exists( $this, $function ) ) {
|
||||
$description = $this->$function();
|
||||
}
|
||||
if ( ! $description ) {
|
||||
return;
|
||||
}
|
||||
printf( '<p class="description">%s</p>', wp_kses_post( $description ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all public content types, not including built in.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @return array
|
||||
*/
|
||||
protected function get_content_types() {
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'_builtin' => false,
|
||||
'has_archive' => true,
|
||||
);
|
||||
$output = 'names';
|
||||
|
||||
return get_post_types( $args, $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all public content types, including built in.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @return array
|
||||
*/
|
||||
protected function get_content_types_built_in() {
|
||||
$built_in = array( 'post', 'page' );
|
||||
$post_types = $this->get_content_types();
|
||||
|
||||
return array_merge( $built_in, $post_types );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current field name.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_field_name( $args ) {
|
||||
return isset( $args['key'] ) && $args['key'] ? $this->page . '[' . $args['key'] . '][' . $args['setting'] . ']' : $this->page . '[' . $args['id'] . ']';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current field id.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public function get_field_id( $args ) {
|
||||
return isset( $args['key'] ) && $args['key'] ? $this->page . '-' . $args['key'] . '-' . $args['setting'] : $this->page . '-' . $args['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current field value.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @return mixed
|
||||
* @internal param $setting
|
||||
*
|
||||
*/
|
||||
public function get_field_value( $args ) {
|
||||
if ( isset( $args['key'] ) && $args['key'] ) {
|
||||
$value = isset( $this->setting[ $args['key'] ][ $args['setting'] ] ) ? $this->setting[ $args['key'] ][ $args['setting'] ] : 0;
|
||||
} else {
|
||||
$value = isset( $this->setting[ $args['id'] ] ) ? $this->setting[ $args['id'] ] : '';
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the images settings class.
|
||||
* @return \DisplayFeaturedImageGenesisSettingsImages
|
||||
* @since 3.1.0
|
||||
*/
|
||||
protected function get_images_class() {
|
||||
if ( isset( $this->images ) ) {
|
||||
return $this->images;
|
||||
}
|
||||
|
||||
include_once 'class-displayfeaturedimagegenesis-settings-images.php';
|
||||
$this->images = new DisplayFeaturedImageGenesisSettingsImages( $this->setting );
|
||||
|
||||
return $this->images;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the user has permission to save the information from the submenu
|
||||
* page.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $action The name of the action specified on the submenu page
|
||||
* @param string $nonce The nonce specified on the submenu page
|
||||
*
|
||||
* @return bool True if the user has permission to save; false, otherwise.
|
||||
* @author Tom McFarlin (https://tommcfarlin.com/save-wordpress-submenu-page-options/)
|
||||
*/
|
||||
protected function user_can_save( $action, $nonce ) {
|
||||
$is_nonce_set = isset( $_POST[ $nonce ] );
|
||||
$is_valid_nonce = false;
|
||||
|
||||
if ( $is_nonce_set ) {
|
||||
$is_valid_nonce = wp_verify_nonce( $_POST[ $nonce ], $action );
|
||||
}
|
||||
|
||||
return ( $is_nonce_set && $is_valid_nonce );
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class Display_Featured_Image_Genesis_Helper
|
||||
* @package DisplayFeaturedImageGenesis
|
||||
* @copyright 2017-2020 Robin Cornett
|
||||
*/
|
||||
class Display_Featured_Image_Genesis_Helper extends DisplayFeaturedImageGenesisGetSetting {
|
||||
|
||||
/**
|
||||
* Base id/slug for the settings page.
|
||||
* @var string $page
|
||||
*/
|
||||
protected $page = 'displayfeaturedimagegenesis';
|
||||
|
||||
/**
|
||||
* The image settings class.
|
||||
* @var $images \DisplayFeaturedImageGenesisSettingsImages
|
||||
*/
|
||||
private $images;
|
||||
|
||||
/**
|
||||
* Generic function to add settings sections
|
||||
*
|
||||
* @since 2.4.0
|
||||
*
|
||||
* @param $sections
|
||||
*/
|
||||
protected function add_sections( $sections ) {
|
||||
|
||||
foreach ( $sections as $section ) {
|
||||
add_settings_section(
|
||||
$this->page . '_' . $section['id'],
|
||||
$section['title'],
|
||||
array( $this, 'section_description' ),
|
||||
$this->page . '_' . $section['tab']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic function to add settings fields
|
||||
*
|
||||
* @param $fields
|
||||
* @param array $sections registered sections
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
protected function add_fields( $fields, $sections ) {
|
||||
foreach ( $fields as $field ) {
|
||||
add_settings_field(
|
||||
$field['id'],
|
||||
sprintf( '<label for="%s-%s">%s</label>', $this->page, $field['id'], $field['title'] ),
|
||||
array( $this, 'do_field' ),
|
||||
$this->page . '_' . $sections[ $field['section'] ]['tab'],
|
||||
$this->page . '_' . $sections[ $field['section'] ]['id'],
|
||||
$field
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic field method.
|
||||
*
|
||||
* @param $field
|
||||
*/
|
||||
public function do_field( $field ) {
|
||||
$callback = $this->get_callback( $field );
|
||||
if ( is_callable( $callback ) ) {
|
||||
call_user_func( $callback, $field );
|
||||
}
|
||||
if ( ! empty( $field['description'] ) ) {
|
||||
$this->do_description( $field );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the correct method to output the field.
|
||||
*
|
||||
* @param $field
|
||||
*
|
||||
* @return array|bool
|
||||
* @since 3.1.0
|
||||
*/
|
||||
private function get_callback( $field ) {
|
||||
$callback = false;
|
||||
if ( ! empty( $field['type'] ) ) {
|
||||
$callback = "do_{$field['type']}";
|
||||
} elseif ( ! empty( $field['callback'] ) ) {
|
||||
$callback = $field['callback'];
|
||||
}
|
||||
|
||||
return $callback ? array( $this, $callback ) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set which tab is considered active.
|
||||
* @return string
|
||||
* @since 2.5.0
|
||||
*/
|
||||
protected function get_active_tab() {
|
||||
$tab = filter_input( INPUT_GET, 'tab', FILTER_SANITIZE_SPECIAL_CHARS );
|
||||
|
||||
return $tab ? $tab : 'main';
|
||||
}
|
||||
|
||||
/**
|
||||
* Echoes out the section description.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param $section
|
||||
*/
|
||||
public function section_description( $section ) {
|
||||
$id = str_replace( "{$this->page}_", '', $section['id'] );
|
||||
$method = "{$id}_section_description";
|
||||
if ( method_exists( $this, $method ) ) {
|
||||
echo wp_kses_post( wpautop( $this->$method() ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic callback to create a number field setting.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_number( $args ) {
|
||||
printf(
|
||||
'<input type="number" step="1" min="%1$s" max="%2$s" id="%3$s" name="%5$s" value="%4$s" class="small-text" />%6$s',
|
||||
(int) $args['min'],
|
||||
(int) $args['max'],
|
||||
esc_attr( $this->get_field_id( $args ) ),
|
||||
esc_attr( $this->get_field_value( $args ) ),
|
||||
esc_attr( $this->get_field_name( $args ) ),
|
||||
esc_attr( $args['label'] )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* generic checkbox function (for all checkbox settings)
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_checkbox( $args ) {
|
||||
$name = $this->get_field_name( $args );
|
||||
$value = $this->get_field_value( $args );
|
||||
printf( '<input type="hidden" name="%s" value="0" />', esc_attr( $name ) );
|
||||
printf(
|
||||
'<label for="%1$s"><input type="checkbox" name="%4$s" id="%1$s" value="1" %2$s class="code" />%3$s</label>',
|
||||
esc_attr( $this->get_field_id( $args ) ),
|
||||
checked( 1, esc_attr( $value ), false ),
|
||||
esc_attr( $args['label'] ),
|
||||
esc_attr( $name )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a checkbox array.
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_checkbox_array( $args ) {
|
||||
echo '<fieldset>';
|
||||
$name = $this->get_field_name( $args );
|
||||
$id = $this->get_field_id( $args );
|
||||
$value = $this->get_field_value( $args );
|
||||
foreach ( $args['options'] as $choice => $label ) {
|
||||
$check = isset( $value[ $choice ] ) ? $value[ $choice ] : 0;
|
||||
printf(
|
||||
'<input type="hidden" name="%s[%s]" value="0" />',
|
||||
esc_attr( $name ),
|
||||
esc_attr( $choice )
|
||||
);
|
||||
printf(
|
||||
'<label for="%5$s-%1$s" style="margin-right:12px !important;"><input type="checkbox" name="%4$s[%1$s]" id="%5$s-%1$s" value="1"%2$s class="code" aria-labelledby="%5$s" />%3$s</label>',
|
||||
esc_attr( $choice ),
|
||||
checked( 1, $check, false ),
|
||||
esc_html( $label ),
|
||||
esc_attr( $name ),
|
||||
esc_attr( $id )
|
||||
);
|
||||
}
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
/**
|
||||
* radio buttons
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_radio( $args ) {
|
||||
echo '<fieldset>';
|
||||
$name = $this->get_field_name( $args );
|
||||
$id = $this->get_field_id( $args );
|
||||
$value = $this->get_field_value( $args );
|
||||
printf( '<legend class="screen-reader-text">%s</legend>', esc_html( $args['legend'] ) );
|
||||
foreach ( $args['choices'] as $choice => $label ) {
|
||||
printf(
|
||||
'<label for="%1$s-%2$s" style="margin-right:12px !important;"><input type="radio" id="%1$s-%2$s" name="%5$s" value="%2$s"%3$s />%4$s</label> ',
|
||||
esc_attr( $id ),
|
||||
esc_attr( $choice ),
|
||||
checked( $choice, $value, false ),
|
||||
esc_attr( $label ),
|
||||
esc_attr( $name )
|
||||
);
|
||||
}
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a select field.
|
||||
*
|
||||
* @param $args
|
||||
*/
|
||||
public function do_select( $args ) {
|
||||
$value = $this->get_field_value( $args );
|
||||
printf(
|
||||
'<select id="%1$s" name="%2$s">',
|
||||
esc_attr( $this->get_field_id( $args ) ),
|
||||
esc_attr( $this->get_field_name( $args ) )
|
||||
);
|
||||
foreach ( (array) $args['choices'] as $option => $label ) {
|
||||
printf(
|
||||
'<option value="%s" %s>%s</option>',
|
||||
esc_attr( $option ),
|
||||
selected( $option, $value, false ),
|
||||
esc_attr( $label )
|
||||
);
|
||||
}
|
||||
echo '</select>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe instantiate the image settings class and do the image field.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
protected function do_image( $args ) {
|
||||
$images = $this->get_images_class();
|
||||
$images->do_image( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic callback to display a field description.
|
||||
*
|
||||
* @param $args array
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
protected function do_description( $args ) {
|
||||
$description = isset( $args['description'] ) ? $args['description'] : false;
|
||||
$function = $args['id'] . '_description';
|
||||
if ( method_exists( $this, $function ) ) {
|
||||
$description = $this->$function();
|
||||
}
|
||||
if ( ! $description ) {
|
||||
return;
|
||||
}
|
||||
printf( '<p class="description">%s</p>', wp_kses_post( $description ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all public content types, not including built in.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @return array
|
||||
*/
|
||||
protected function get_content_types() {
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'_builtin' => false,
|
||||
'has_archive' => true,
|
||||
);
|
||||
$output = 'names';
|
||||
|
||||
return get_post_types( $args, $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all public content types, including built in.
|
||||
*
|
||||
* @since 2.5.0
|
||||
* @return array
|
||||
*/
|
||||
protected function get_content_types_built_in() {
|
||||
$built_in = array( 'post', 'page' );
|
||||
$post_types = $this->get_content_types();
|
||||
|
||||
return array_merge( $built_in, $post_types );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current field name.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_field_name( $args ) {
|
||||
return isset( $args['key'] ) && $args['key'] ? $this->page . '[' . $args['key'] . '][' . $args['setting'] . ']' : $this->page . '[' . $args['id'] . ']';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current field id.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public function get_field_id( $args ) {
|
||||
return isset( $args['key'] ) && $args['key'] ? $this->page . '-' . $args['key'] . '-' . $args['setting'] : $this->page . '-' . $args['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current field value.
|
||||
*
|
||||
* @param $args
|
||||
*
|
||||
* @return mixed
|
||||
* @internal param $setting
|
||||
*
|
||||
*/
|
||||
public function get_field_value( $args ) {
|
||||
if ( isset( $args['key'] ) && $args['key'] ) {
|
||||
$value = isset( $this->setting[ $args['key'] ][ $args['setting'] ] ) ? $this->setting[ $args['key'] ][ $args['setting'] ] : 0;
|
||||
} else {
|
||||
$value = isset( $this->setting[ $args['id'] ] ) ? $this->setting[ $args['id'] ] : '';
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the images settings class.
|
||||
* @return \DisplayFeaturedImageGenesisSettingsImages
|
||||
* @since 3.1.0
|
||||
*/
|
||||
protected function get_images_class() {
|
||||
if ( isset( $this->images ) ) {
|
||||
return $this->images;
|
||||
}
|
||||
|
||||
include_once 'class-displayfeaturedimagegenesis-settings-images.php';
|
||||
$this->images = new DisplayFeaturedImageGenesisSettingsImages( $this->setting );
|
||||
|
||||
return $this->images;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the user has permission to save the information from the submenu
|
||||
* page.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @access protected
|
||||
*
|
||||
* @param string $action The name of the action specified on the submenu page
|
||||
* @param string $nonce The nonce specified on the submenu page
|
||||
*
|
||||
* @return bool True if the user has permission to save; false, otherwise.
|
||||
* @author Tom McFarlin (https://tommcfarlin.com/save-wordpress-submenu-page-options/)
|
||||
*/
|
||||
protected function user_can_save( $action, $nonce ) {
|
||||
$is_nonce_set = isset( $_POST[ $nonce ] );
|
||||
$is_valid_nonce = false;
|
||||
|
||||
if ( $is_nonce_set ) {
|
||||
$is_valid_nonce = wp_verify_nonce( $_POST[ $nonce ], $action );
|
||||
}
|
||||
|
||||
return ( $is_nonce_set && $is_valid_nonce );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,192 +1,193 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class DisplayFeaturedImageGenesisWidgetsForm
|
||||
*/
|
||||
class DisplayFeaturedImageGenesisWidgetsForm {
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
protected $parent;
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
public $instance;
|
||||
|
||||
/**
|
||||
* DisplayFeaturedImageGenesisWidgets constructor.
|
||||
*
|
||||
* @param $parent
|
||||
* @param $instance
|
||||
*/
|
||||
public function __construct( $parent, $instance ) {
|
||||
$this->parent = $parent;
|
||||
$this->instance = $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the public registered post types on the site.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_post_types() {
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'_builtin' => false,
|
||||
'has_archive' => true,
|
||||
);
|
||||
$output = 'objects';
|
||||
$post_types = get_post_types( $args, $output );
|
||||
|
||||
$options = array(
|
||||
'' => '--',
|
||||
'post' => __( 'Posts', 'display-featured-image-genesis' ),
|
||||
);
|
||||
foreach ( $post_types as $post_type ) {
|
||||
$options[ $post_type->name ] = $post_type->label;
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get_image_size() {
|
||||
$sizes = genesis_get_image_sizes();
|
||||
$options = array();
|
||||
foreach ( (array) $sizes as $name => $size ) {
|
||||
$options[ $name ] = sprintf( '%s ( %s x %s )', esc_html( $name ), (int) $size['width'], (int) $size['height'] );
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get_image_alignment() {
|
||||
return array(
|
||||
'alignnone' => __( 'None', 'display-featured-image-genesis' ),
|
||||
'alignleft' => __( 'Left', 'display-featured-image-genesis' ),
|
||||
'alignright' => __( 'Right', 'display-featured-image-genesis' ),
|
||||
'aligncenter' => __( 'Center', 'display-featured-image-genesis' ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $instance
|
||||
* @param bool $ajax
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_term_lists( $instance, $ajax = false ) {
|
||||
$args = array(
|
||||
'orderby' => 'name',
|
||||
'order' => 'ASC',
|
||||
'hide_empty' => false,
|
||||
);
|
||||
$taxonomy = $ajax ? filter_input( INPUT_POST, 'taxonomy', FILTER_SANITIZE_STRING ) : $instance['taxonomy'];
|
||||
$terms = get_terms( $taxonomy, $args );
|
||||
$options[''] = '--';
|
||||
foreach ( $terms as $term ) {
|
||||
if ( is_object( $term ) ) {
|
||||
$options[ $term->term_id ] = $term->name;
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the callback to populate the custom term dropdown. The
|
||||
* selected post type is provided in $_POST['taxonomy'], and the
|
||||
* calling script expects a JSON array of term objects.
|
||||
*/
|
||||
public function term_action_callback() {
|
||||
|
||||
$list = $this->get_term_lists( array(), true );
|
||||
|
||||
// And emit it
|
||||
echo wp_json_encode( $list );
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build boxes with fields.
|
||||
*
|
||||
* @param $boxes
|
||||
* @param string $class
|
||||
*/
|
||||
public function do_boxes( $boxes, $class = '' ) {
|
||||
foreach ( $boxes as $box => $value ) {
|
||||
if ( ! $value ) {
|
||||
continue;
|
||||
}
|
||||
$box_class = ! $class ? 'genesis-widget-column-box' : 'genesis-widget-column-box ' . $class;
|
||||
printf( '<div class="%s">', esc_attr( $box_class ) );
|
||||
echo wp_kses_post( wpautop( $this->box_description( $box ) ) );
|
||||
$this->do_fields( $this->instance, $value );
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a description to a widget settings box.
|
||||
*
|
||||
* @param $box
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function box_description( $box ) {
|
||||
$method = "describe_{$box}";
|
||||
|
||||
return method_exists( $this, $method ) ? $this->$method() : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Cycle through the fields for a given box, pick the appropriate method, and go.
|
||||
*
|
||||
* @param $instance
|
||||
* @param $fields
|
||||
*/
|
||||
public function do_fields( $instance, $fields ) {
|
||||
foreach ( $fields as $field ) {
|
||||
$args = $field['args'];
|
||||
include $this->path( $field['method'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic function to build a text input for the widget form.
|
||||
*
|
||||
* @param $instance
|
||||
* @param $args
|
||||
*/
|
||||
public function do_text( $instance, $args ) {
|
||||
include $this->path( 'text' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic function to build a select input for the widget form.
|
||||
*
|
||||
* @param $instance
|
||||
* @param $args
|
||||
*/
|
||||
public function do_select( $instance, $args ) {
|
||||
include $this->path( 'select' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get path for included files.
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function path( $file ) {
|
||||
return trailingslashit( plugin_dir_path( __FILE__ ) . 'admin' ) . $file . '.php';
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class DisplayFeaturedImageGenesisWidgetsForm
|
||||
*/
|
||||
class DisplayFeaturedImageGenesisWidgetsForm {
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
protected $parent;
|
||||
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
public $instance;
|
||||
|
||||
/**
|
||||
* DisplayFeaturedImageGenesisWidgets constructor.
|
||||
*
|
||||
* @param $parent
|
||||
* @param $instance
|
||||
*/
|
||||
public function __construct( $parent, $instance ) {
|
||||
$this->parent = $parent;
|
||||
$this->instance = $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the public registered post types on the site.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_post_types() {
|
||||
$args = array(
|
||||
'public' => true,
|
||||
'_builtin' => false,
|
||||
'has_archive' => true,
|
||||
);
|
||||
$output = 'objects';
|
||||
$post_types = get_post_types( $args, $output );
|
||||
|
||||
$options = array(
|
||||
'' => '--',
|
||||
'post' => __( 'Posts', 'display-featured-image-genesis' ),
|
||||
);
|
||||
foreach ( $post_types as $post_type ) {
|
||||
$options[ $post_type->name ] = $post_type->label;
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get_image_size() {
|
||||
$sizes = genesis_get_image_sizes();
|
||||
$options = array();
|
||||
foreach ( (array) $sizes as $name => $size ) {
|
||||
$options[ $name ] = sprintf( '%s ( %s x %s )', esc_html( $name ), (int) $size['width'], (int) $size['height'] );
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get_image_alignment() {
|
||||
return array(
|
||||
'alignnone' => __( 'None', 'display-featured-image-genesis' ),
|
||||
'alignleft' => __( 'Left', 'display-featured-image-genesis' ),
|
||||
'alignright' => __( 'Right', 'display-featured-image-genesis' ),
|
||||
'aligncenter' => __( 'Center', 'display-featured-image-genesis' ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $instance
|
||||
* @param bool $ajax
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get_term_lists( $instance, $ajax = false ) {
|
||||
$taxonomy = $ajax ? filter_input( INPUT_POST, 'taxonomy', FILTER_SANITIZE_SPECIAL_CHARS ) : $instance['taxonomy'];
|
||||
$args = array(
|
||||
'taxonomy' => $taxonomy,
|
||||
'orderby' => 'name',
|
||||
'order' => 'ASC',
|
||||
'hide_empty' => false,
|
||||
);
|
||||
$terms = get_terms( $args );
|
||||
$options[''] = '--';
|
||||
foreach ( $terms as $term ) {
|
||||
if ( is_object( $term ) ) {
|
||||
$options[ $term->term_id ] = $term->name;
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the callback to populate the custom term dropdown. The
|
||||
* selected post type is provided in $_POST['taxonomy'], and the
|
||||
* calling script expects a JSON array of term objects.
|
||||
*/
|
||||
public function term_action_callback() {
|
||||
|
||||
$list = $this->get_term_lists( array(), true );
|
||||
|
||||
// And emit it
|
||||
echo wp_json_encode( $list );
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build boxes with fields.
|
||||
*
|
||||
* @param $boxes
|
||||
* @param string $class
|
||||
*/
|
||||
public function do_boxes( $boxes, $class = '' ) {
|
||||
foreach ( $boxes as $box => $value ) {
|
||||
if ( ! $value ) {
|
||||
continue;
|
||||
}
|
||||
$box_class = ! $class ? 'genesis-widget-column-box' : 'genesis-widget-column-box ' . $class;
|
||||
printf( '<div class="%s">', esc_attr( $box_class ) );
|
||||
echo wp_kses_post( wpautop( $this->box_description( $box ) ) );
|
||||
$this->do_fields( $this->instance, $value );
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a description to a widget settings box.
|
||||
*
|
||||
* @param $box
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function box_description( $box ) {
|
||||
$method = "describe_{$box}";
|
||||
|
||||
return method_exists( $this, $method ) ? $this->$method() : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Cycle through the fields for a given box, pick the appropriate method, and go.
|
||||
*
|
||||
* @param $instance
|
||||
* @param $fields
|
||||
*/
|
||||
public function do_fields( $instance, $fields ) {
|
||||
foreach ( $fields as $field ) {
|
||||
$args = $field['args'];
|
||||
include $this->path( $field['method'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic function to build a text input for the widget form.
|
||||
*
|
||||
* @param $instance
|
||||
* @param $args
|
||||
*/
|
||||
public function do_text( $instance, $args ) {
|
||||
include $this->path( 'text' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic function to build a select input for the widget form.
|
||||
*
|
||||
* @param $instance
|
||||
* @param $args
|
||||
*/
|
||||
public function do_select( $instance, $args ) {
|
||||
include $this->path( 'select' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get path for included files.
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function path( $file ) {
|
||||
return trailingslashit( plugin_dir_path( __FILE__ ) . 'admin' ) . $file . '.php';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,41 @@
|
||||
# Copyright (C) 2020 Display Featured Image for Genesis
|
||||
# This file is distributed under the same license as the Display Featured Image for Genesis package.
|
||||
# Copyright (C) 2023 Robin Cornett
|
||||
# This file is distributed under the GPL-2.0+.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Display Featured Image for Genesis\n"
|
||||
"Project-Id-Version: Display Featured Image for Genesis 3.2.3\n"
|
||||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/display-featured-image-genesis\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"POT-Creation-Date: 2023-11-11T17:12:49+00:00\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"X-Generator: WP-CLI 2.8.1\n"
|
||||
"X-Domain: display-featured-image-genesis\n"
|
||||
|
||||
#. Plugin Name of the plugin
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:61
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:22
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:23
|
||||
msgid "Display Featured Image for Genesis"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin
|
||||
msgid "https://github.com/robincornett/display-featured-image-genesis/"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin
|
||||
msgid "This plugin works within the Genesis Framework, to display featured images in beautiful and dynamic ways."
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin
|
||||
msgid "Robin Cornett"
|
||||
msgstr ""
|
||||
|
||||
#. Author URI of the plugin
|
||||
msgid "https://robincornett.com"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class-displayfeaturedimagegenesis-admin.php:97
|
||||
msgid "Image"
|
||||
@@ -21,7 +50,8 @@ msgstr ""
|
||||
msgid " But since we're talking anyway, did you know that your server is running PHP version %1$s, which is outdated? You should ask your host to update that for you."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class-displayfeaturedimagegenesis.php:256, includes/settings/class-displayfeaturedimagegenesis-settings-images.php:164
|
||||
#: includes/class-displayfeaturedimagegenesis.php:256
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings-images.php:164
|
||||
msgid "Select Image"
|
||||
msgstr ""
|
||||
|
||||
@@ -29,7 +59,12 @@ msgstr ""
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: includes/meta/class-displayfeaturedimagegenesis-author.php:46, includes/meta/class-displayfeaturedimagegenesis-taxonomies.php:101, includes/meta/class-displayfeaturedimagegenesis-taxonomies.php:185, includes/widgets/fields/blocks.php:9, includes/widgets/fields/blocks.php:19, includes/widgets/fields/blocks.php:29
|
||||
#: includes/meta/class-displayfeaturedimagegenesis-author.php:46
|
||||
#: includes/meta/class-displayfeaturedimagegenesis-taxonomies.php:101
|
||||
#: includes/meta/class-displayfeaturedimagegenesis-taxonomies.php:185
|
||||
#: includes/widgets/fields/blocks.php:9
|
||||
#: includes/widgets/fields/blocks.php:19
|
||||
#: includes/widgets/fields/blocks.php:29
|
||||
msgid "Featured Image"
|
||||
msgstr ""
|
||||
|
||||
@@ -37,7 +72,8 @@ msgstr ""
|
||||
msgid "Upload an image to use as your author page featured image."
|
||||
msgstr ""
|
||||
|
||||
#: includes/meta/class-displayfeaturedimagegenesis-author.php:74, includes/settings/class-displayfeaturedimagegenesis-settings.php:272
|
||||
#: includes/meta/class-displayfeaturedimagegenesis-author.php:74
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:272
|
||||
msgid "Something unexpected happened. Please try again."
|
||||
msgstr ""
|
||||
|
||||
@@ -82,15 +118,12 @@ msgstr ""
|
||||
msgid "You may set a featured image for your terms. This image will be used on the term archive page, and as a fallback image on a single post page if it does not have a featured image of its own."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:61, includes/settings/class-displayfeaturedimagegenesis-settings.php:22, includes/settings/class-displayfeaturedimagegenesis-settings.php:23
|
||||
msgid "Display Featured Image for Genesis"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:62
|
||||
msgid "Only general settings are available in the Customizer; more can be found on the Display Featured Image for Genesis settings page."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:69, includes/settings/tabs.php:6
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:69
|
||||
#: includes/settings/tabs.php:6
|
||||
msgid "Main"
|
||||
msgstr ""
|
||||
|
||||
@@ -98,7 +131,8 @@ msgstr ""
|
||||
msgid "Backstretch Output"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:79, includes/settings/tabs.php:14
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:79
|
||||
#: includes/settings/tabs.php:14
|
||||
msgid "Content Types"
|
||||
msgstr ""
|
||||
|
||||
@@ -106,7 +140,8 @@ msgstr ""
|
||||
msgid "Optional: set a custom image for search results and 404 (no results found) pages, as well as content types."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:85, includes/settings/tabs.php:18
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-customizer.php:85
|
||||
#: includes/settings/tabs.php:18
|
||||
msgid "Advanced"
|
||||
msgstr ""
|
||||
|
||||
@@ -114,7 +149,8 @@ msgstr ""
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:47, includes/settings/fields-style.php:13
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:47
|
||||
#: includes/settings/fields-style.php:13
|
||||
msgid "Height"
|
||||
msgstr ""
|
||||
|
||||
@@ -122,7 +158,8 @@ msgstr ""
|
||||
msgid "Centering"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:57, includes/settings/fields-style.php:49
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:57
|
||||
#: includes/settings/fields-style.php:49
|
||||
msgid "Fade"
|
||||
msgstr ""
|
||||
|
||||
@@ -130,7 +167,8 @@ msgstr ""
|
||||
msgid "Special Pages"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:72, includes/settings/fields-cpt.php:6
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:72
|
||||
#: includes/settings/fields-cpt.php:6
|
||||
msgid "Skip Content Types"
|
||||
msgstr ""
|
||||
|
||||
@@ -142,15 +180,18 @@ msgstr ""
|
||||
msgid "Custom Content Types"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:94, includes/settings/sections.php:6
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:94
|
||||
#: includes/settings/sections.php:6
|
||||
msgid "Optional Sitewide Settings"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:99, includes/settings/sections.php:11
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:99
|
||||
#: includes/settings/sections.php:11
|
||||
msgid "Optional Archive Settings"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:104, includes/settings/sections.php:16
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:104
|
||||
#: includes/settings/sections.php:16
|
||||
msgid "Optional Default Image"
|
||||
msgstr ""
|
||||
|
||||
@@ -178,7 +219,8 @@ msgstr ""
|
||||
msgid "If you choose \"Always Use Default\", your default image will be used site wide, no matter what content types/posts/etc. have featured images set."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:150, includes/settings/fields-main.php:39
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:150
|
||||
#: includes/settings/fields-main.php:39
|
||||
msgid "Skip Front Page"
|
||||
msgstr ""
|
||||
|
||||
@@ -186,7 +228,8 @@ msgstr ""
|
||||
msgid "If you set a Default Featured Image, it will show on every post/page of your site. This may not be desirable on child themes with a front page constructed with widgets, so you can select this option to prevent the Featured Image from showing on the front page. Checking this will prevent the Featured Image from showing on the Front Page, even if you have set an image for that page individually."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:162, includes/settings/fields-main.php:46
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:162
|
||||
#: includes/settings/fields-main.php:46
|
||||
msgid "Do Not Move Titles"
|
||||
msgstr ""
|
||||
|
||||
@@ -222,7 +265,8 @@ msgstr ""
|
||||
msgid "If your RSS feed is set to Full Text, the Featured Image will be added to the entry content. If it is set to Summary, the Featured Image will be added to the excerpt instead."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:211, includes/settings/fields-main.php:74
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:211
|
||||
#: includes/settings/fields-main.php:74
|
||||
msgid "Archive Thumbnails"
|
||||
msgstr ""
|
||||
|
||||
@@ -274,7 +318,8 @@ msgstr ""
|
||||
msgid "By default, the banner image takes 750 milliseconds to fade in once the image has loaded into the browser. You can make the image fade in more quickly or slowly, as you prefer."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:289, includes/settings/fields-main.php:26
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:289
|
||||
#: includes/settings/fields-main.php:26
|
||||
msgid "Preferred Image Size"
|
||||
msgstr ""
|
||||
|
||||
@@ -282,7 +327,8 @@ msgstr ""
|
||||
msgid "Set the default image size you would like to use sitewide. This can be overridden per content type, or on an individual post."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:301, includes/settings/fields-style.php:6
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-helptabs.php:301
|
||||
#: includes/settings/fields-style.php:6
|
||||
msgid "Disable JavaScript"
|
||||
msgstr ""
|
||||
|
||||
@@ -348,7 +394,8 @@ msgstr ""
|
||||
|
||||
#. translators: the placeholder is the name of the featured image; eg. default, search, or the name of a content type.
|
||||
#. translators: the user display name
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings-validate-image.php:72, includes/settings/class-displayfeaturedimagegenesis-settings-validate-image.php:89
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings-validate-image.php:72
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings-validate-image.php:89
|
||||
msgid " The %s Featured Image has been reset to the last valid setting."
|
||||
msgstr ""
|
||||
|
||||
@@ -376,7 +423,8 @@ msgstr ""
|
||||
msgid "Optionally, change the hook location and priority of the featured image output. Use with caution. Note: this will change the hook/priority of the featured image sitewide. If you need to make changes based on content type, check the readme for code examples."
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:210, includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:75
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:210
|
||||
#: includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:75
|
||||
msgid "Center"
|
||||
msgstr ""
|
||||
|
||||
@@ -384,11 +432,14 @@ msgstr ""
|
||||
msgid "Do Not Center"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:244, includes/settings/fields-advanced.php:11
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:244
|
||||
#: includes/settings/fields-advanced.php:11
|
||||
msgid "(default)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:249, includes/settings/class-displayfeaturedimagegenesis-settings.php:250, includes/settings/class-displayfeaturedimagegenesis-settings.php:251
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:249
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:250
|
||||
#: includes/settings/class-displayfeaturedimagegenesis-settings.php:251
|
||||
msgid "(HTML5 themes)"
|
||||
msgstr ""
|
||||
|
||||
@@ -465,7 +516,8 @@ msgstr ""
|
||||
msgid "Banner (default)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/settings/fields-main.php:32, includes/widgets/fields/author-gravatar.php:13
|
||||
#: includes/settings/fields-main.php:32
|
||||
#: includes/widgets/fields/author-gravatar.php:13
|
||||
msgid "Large"
|
||||
msgstr ""
|
||||
|
||||
@@ -585,15 +637,21 @@ msgstr ""
|
||||
msgid "Posts"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:72, includes/widgets/fields/author-archive.php:9, includes/widgets/fields/author-description.php:14, includes/widgets/fields/author-gravatar.php:49, includes/widgets/fields/text.php:25
|
||||
#: includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:72
|
||||
#: includes/widgets/fields/author-archive.php:9
|
||||
#: includes/widgets/fields/author-description.php:14
|
||||
#: includes/widgets/fields/author-gravatar.php:49
|
||||
#: includes/widgets/fields/text.php:25
|
||||
msgid "None"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:73, includes/widgets/fields/author-gravatar.php:50
|
||||
#: includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:73
|
||||
#: includes/widgets/fields/author-gravatar.php:50
|
||||
msgid "Left"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:74, includes/widgets/fields/author-gravatar.php:51
|
||||
#: includes/widgets/class-displayfeaturedimagegenesis-widgets-form.php:74
|
||||
#: includes/widgets/fields/author-gravatar.php:51
|
||||
msgid "Right"
|
||||
msgstr ""
|
||||
|
||||
@@ -625,11 +683,14 @@ msgstr ""
|
||||
msgid "Displays user profile block with Gravatar"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/displayfeaturedimagegenesis-author-widget.php:31, includes/widgets/fields/blocks.php:15
|
||||
#: includes/widgets/displayfeaturedimagegenesis-author-widget.php:31
|
||||
#: includes/widgets/fields/blocks.php:15
|
||||
msgid "Display Featured Author Profile"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/displayfeaturedimagegenesis-author-widget.php:121, includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php:136, includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php:138
|
||||
#: includes/widgets/displayfeaturedimagegenesis-author-widget.php:121
|
||||
#: includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php:136
|
||||
#: includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php:138
|
||||
msgid "Title:"
|
||||
msgstr ""
|
||||
|
||||
@@ -637,7 +698,8 @@ msgstr ""
|
||||
msgid "Displays a post type archive with its featured image"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php:40, includes/widgets/fields/blocks.php:25
|
||||
#: includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php:40
|
||||
#: includes/widgets/fields/blocks.php:25
|
||||
msgid "Display Featured Post Type Archive Image"
|
||||
msgstr ""
|
||||
|
||||
@@ -649,11 +711,13 @@ msgstr ""
|
||||
msgid "Displays a term with its featured image"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php:40, includes/widgets/fields/blocks.php:5
|
||||
#: includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php:40
|
||||
#: includes/widgets/fields/blocks.php:5
|
||||
msgid "Display Featured Term Image"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php:150, includes/widgets/fields/blocks.php:8
|
||||
#: includes/widgets/displayfeaturedimagegenesis-taxonomy-widget.php:150
|
||||
#: includes/widgets/fields/blocks.php:8
|
||||
msgid "Term"
|
||||
msgstr ""
|
||||
|
||||
@@ -697,7 +761,8 @@ msgstr ""
|
||||
msgid "Author Bio (from profile)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/fields/author-description.php:16, includes/widgets/fields/text.php:27
|
||||
#: includes/widgets/fields/author-description.php:16
|
||||
#: includes/widgets/fields/text.php:27
|
||||
msgid "Custom Text (below)"
|
||||
msgstr ""
|
||||
|
||||
@@ -733,7 +798,8 @@ msgstr ""
|
||||
msgid "Show the user's featured image."
|
||||
msgstr ""
|
||||
|
||||
#: includes/widgets/fields/author-image.php:18, includes/widgets/fields/image.php:18
|
||||
#: includes/widgets/fields/author-image.php:18
|
||||
#: includes/widgets/fields/image.php:18
|
||||
msgid "Image Size:"
|
||||
msgstr ""
|
||||
|
||||
|
||||
Generated
+15452
File diff suppressed because it is too large
Load Diff
+12
-9
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "display-featured-image-genesis",
|
||||
"description": "Display Featured Image for Genesis",
|
||||
"version": "3.2.2",
|
||||
"version": "3.2.3",
|
||||
"private": true,
|
||||
"license": "GPL-2.0+",
|
||||
"devDependencies": {
|
||||
"autoprefixer": "10.4.13",
|
||||
"autoprefixer": "10.4.16",
|
||||
"browser-sync": "2.27.11",
|
||||
"css-mqpacker": "7.0.0",
|
||||
"del": "7.0.0",
|
||||
"del": "7.1.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-chmod": "3.0.0",
|
||||
"gulp-chmod": "4.0.0",
|
||||
"gulp-notify": "4.0.0",
|
||||
"gulp-postcss": "9.0.1",
|
||||
"gulp-rename": "2.0.0",
|
||||
@@ -20,22 +20,25 @@
|
||||
"gulp-wp-pot": "^2.3.2",
|
||||
"gulp-zip": "5.1.0",
|
||||
"perfectionist": "^2.4.0",
|
||||
"postcss": "^8.4.4",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-import": "15.1.0",
|
||||
"sass": "^1.41.1"
|
||||
"sass": "^1.69.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/browserslist-config": "5.7.0",
|
||||
"@wordpress/browserslist-config": "5.28.0",
|
||||
"glob-parent": ">=5.1.2",
|
||||
"gulp-sass-unicode": "^1.0.5",
|
||||
"gulp-svg-sprites": "^4.1.2",
|
||||
"normalize.css": "8.0.1",
|
||||
"trim-newlines": ">=3.0.1",
|
||||
"set-value": ">=4.0.1",
|
||||
"axios": ">=0.24.0",
|
||||
"axios": "1.6.1",
|
||||
"nth-check": ">=2.0.1"
|
||||
},
|
||||
"browserslist": [
|
||||
"extends @wordpress/browserslist-config"
|
||||
]
|
||||
],
|
||||
"scripts": {
|
||||
"translate": "wp i18n make-pot . languages/display-featured-image-genesis.pot --exclude=node_modules --domain=display-featured-image-genesis"
|
||||
}
|
||||
}
|
||||
|
||||
+8
-5
@@ -3,10 +3,10 @@
|
||||
Contributors: littler.chicken
|
||||
Donate link: https://robincornett.com/donate/
|
||||
Tags: banner, featured image, featured images, genesis, studiopress, post thumbnails, featured image rss, rss
|
||||
Requires at least: 5.0
|
||||
Tested up to: 5.8
|
||||
Stable tag: 3.2.2
|
||||
Requires PHP: 5.6
|
||||
Requires at least: 5.2
|
||||
Tested up to: 6.4
|
||||
Stable tag: 3.2.3
|
||||
Requires PHP: 7.4
|
||||
License: GPL-2.0+
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
|
||||
@@ -218,10 +218,13 @@ Similar hooks:
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
3.2.0: featured image widgets are now available as blocks; banner image size has been changed due to WordPress 5.3 changes
|
||||
3.2.3: updated for PHP 8 compatibility
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 3.2.3 =
|
||||
* updated: PHP 8 compatibility
|
||||
|
||||
= 3.2.2 =
|
||||
* added: support for webp images
|
||||
* fixed: user's custom column filter
|
||||
|
||||
@@ -1,71 +1,71 @@
|
||||
.has-leader .site-inner {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.big-leader {
|
||||
overflow: hidden;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
|
||||
.wrap {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&__image {
|
||||
display: block;
|
||||
height: 100vh;
|
||||
max-width: none;
|
||||
object-fit: cover;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.featured-image-overlay {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.excerpt,
|
||||
.archive-description {
|
||||
margin-bottom: 24px;
|
||||
padding: 24px;
|
||||
background: rgba(255,255,255,0.85);
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 18px;
|
||||
margin-bottom: 0;
|
||||
|
||||
.home & {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
.home & {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.excerpt .entry-title,
|
||||
.archive-description .archive-title {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes dfig-fadein {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.backstretch.no-js {
|
||||
max-height: 600px;
|
||||
}
|
||||
|
||||
img.featured {
|
||||
max-width: 100%;
|
||||
}
|
||||
.has-leader .site-inner {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.big-leader {
|
||||
overflow: hidden;
|
||||
max-height: 100vh;
|
||||
position: relative;
|
||||
|
||||
.wrap {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&__image {
|
||||
display: block;
|
||||
height: 100vh;
|
||||
max-width: none;
|
||||
object-fit: cover;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.featured-image-overlay {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.excerpt,
|
||||
.archive-description {
|
||||
margin-bottom: 24px;
|
||||
padding: 24px;
|
||||
background: rgba(255,255,255,0.85);
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 18px;
|
||||
margin-bottom: 0;
|
||||
|
||||
.home & {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
.home & {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.excerpt .entry-title,
|
||||
.archive-description .archive-title {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes dfig-fadein {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.backstretch.no-js {
|
||||
max-height: 600px;
|
||||
}
|
||||
|
||||
img.featured {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user