Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Redux Changelog

## 4.1.27
* Fixed: Image select not selecting default value.
* Modified: #209 - Link color field overridden by theme. Added 'important' arg to the output array to fix. See sample config.
* Fixed: #208 - Same config not setting footer background in Twenty-twenty theme due to incorrect class.
* Fixed: #207 - Radio field not displaying text after save/refresh when displaying WordPress data.
* Modified: #210 - Donation text removed.
* Fixed: #206 - Link color CSS compiling incorrectly due to late escaping.

## 4.1.26
* Added: Menu accent introduced in WordPress 5.7.
* Updated: ACE Editor 1.4.12.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reduxframework/redux-framework-4",
"version": "4.1.26",
"version": "4.1.27",
"authors": [
{
"name": "Redux.io",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "gulpfile.js",
"name": "redux",
"author": "Redux.io + Dōvy Paukstys",
"version": "4.1.26",
"version": "4.1.27",
"license": "GPL-3.0-or-later",
"repository": {
"type": "git",
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: gutenberg, blocks, gutenberg blocks, editor, block, page builder, block ed
Requires at least: 4.0
Requires PHP: 7.1
Tested up to: 5.7.2
Stable tag: 4.1.26
Stable tag: 4.1.27
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Expand Down Expand Up @@ -154,6 +154,14 @@ If you want, you can use the [Gutenberg](https://wordpress.org/plugins/gutenberg

== Changelog ==

== 4.1.27 ==
* Fixed: Image select not selecting default value.
* Modified: #209 - Link color field overridden by theme. Added 'important' arg to the output array to fix. See sample config.
* Fixed: #208 - Same config not setting footer background in Twenty-twenty theme due to incorrect class.
* Fixed: #207 - Radio field not displaying text after save/refresh when displaying WordPress data.
* Modified: #210 - Donation text removed.
* Fixed: #206 - Link color CSS compiling incorrectly due to late escaping.

== 4.1.26 ==
* Added: Menu accent introduced in WordPress 5.7.
* Updated: ACE Editor 1.4.12.
Expand Down
2 changes: 1 addition & 1 deletion redux-core/assets/css/redux-fields.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion redux-core/assets/css/redux-fields.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion redux-core/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

require_once dirname( __FILE__ ) . '/class-redux-core.php';

Redux_Core::$version = '4.1.26';
Redux_Core::$version = '4.1.27';
Redux_Core::$redux_path = dirname( __FILE__ );
Redux_Core::instance();

Expand Down
4 changes: 2 additions & 2 deletions redux-core/inc/classes/class-redux-cdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private static function enqueue( $handle, $src_cdn, $deps, $ver, $footer_or_medi
* @param mixed $footer_or_media True or 'all'.
* @param bool $is_script Script or style.
*/
private static function cdn( bool $register, string $handle,string $src_cdn,array $deps,string $ver,?string $footer_or_media,bool $is_script ) {
private static function cdn( bool $register, string $handle, string $src_cdn, array $deps, string $ver, $footer_or_media, bool $is_script ) {
$tran_key = '_style_cdn_is_up';
if ( $is_script ) {
$tran_key = '_script_cdn_is_up';
Expand Down Expand Up @@ -167,7 +167,7 @@ private static function cdn( bool $register, string $handle,string $src_cdn,arra
* @param mixed $footer_or_media True or 'all'.
* @param bool $is_script Script or style.
*/
private static function vendor_plugin( bool $register, string $handle, string $src_cdn, array $deps, string $ver, ?string $footer_or_media, bool $is_script ) {
private static function vendor_plugin( bool $register, string $handle, string $src_cdn, array $deps, string $ver, $footer_or_media, bool $is_script ) {
if ( class_exists( 'Redux_VendorURL' ) ) {
$src = Redux_VendorURL::get_url( $handle );

Expand Down
7 changes: 7 additions & 0 deletions redux-core/inc/classes/class-redux-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ public function output( $style = '' ) {
$this->field['compiler'] = array( $this->field['compiler'] );
}

if ( isset( $this->field['compiler']['important'] ) ) {
if ( $this->field['compiler']['important'] ) {
$style = str_replace( ';', ' !important;', $style );
}
unset( $this->field['compiler']['important'] );
}

if ( ! empty( $this->field['compiler'] ) && is_array( $this->field['compiler'] ) ) {
$keys = implode( ',', $this->field['compiler'] );
$this->parent->compilerCSS .= $keys . '{' . $style . '}';
Expand Down
2 changes: 1 addition & 1 deletion redux-core/inc/classes/class-redux-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ public static function google_fonts_array( $download = false ) {

if ( ! file_exists( $path ) || ( file_exists( $path ) && $download && self::google_fonts_update_needed() ) ) {
if ( $download ) {
$url = 'http://api.redux.io/gfonts';
$url = apply_filter( 'redux/typography/google_fonts/url', 'https://api.redux.io/gfonts' );

$request = wp_remote_get(
$url,
Expand Down
5 changes: 3 additions & 2 deletions redux-core/inc/classes/class-redux-wordpress-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ public function __construct( $parent = null ) {
*
* @param bool $type Type.
* @param array $args Args.
* @param array $opt_name Opt name.
* @param string|int $current_value Current value.
* @param bool $ajax Tells if this is a AJAX call.
*
* @return array|mixed|string
*/
public function get( $type = false, $args = array(), $current_value = '', $ajax = false ) {
public function get( $type = false, $args = array(), $opt_name = '', $current_value = '', $ajax = false ) {
$opt_name = $this->opt_name;

// We don't want to run this, it's not a string value. Send it back!
Expand Down Expand Up @@ -155,7 +156,7 @@ public function get( $type = false, $args = array(), $current_value = '', $ajax
*
* @return array
*/
private function process_results( $results = array(), $id_key = '', $name_key = '', $add_key = true, $secondary_key = 'slug' ) {
private function process_results( array $results = array(), $id_key = '', $name_key = '', bool $add_key = true, $secondary_key = 'slug' ): array {
$data = array();
if ( ! empty( $results ) && ! is_a( $results, 'WP_Error' ) ) {
foreach ( $results as $k => $v ) {
Expand Down
13 changes: 9 additions & 4 deletions redux-core/inc/fields/image_select/class-redux-image-select.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ public function render() {

$the_value = $k;

$selected = ( '' !== checked( $this->value, $the_value, false ) ) ? ' redux-image-select-selected' : '';

if ( ! empty( $this->field['tiles'] ) && true === $this->field['tiles'] ) {
$the_value = $v['img'];
}

$selected = ( '' !== checked( $this->value, $the_value, false ) ) ? ' redux-image-select-selected' : '';

$presets = '';
$is_preset = false;

Expand Down Expand Up @@ -201,7 +201,7 @@ public function enqueue() {
*
* @param string $data css string.
*
* @return string|void
* @return string
*/
public function css_style( $data ) {
$css = '';
Expand All @@ -212,7 +212,12 @@ public function css_style( $data ) {
if ( ! empty( $data ) && ! is_array( $data ) ) {
switch ( $mode ) {
case 'background-image':
$img = isset( $this->field['options'][ $data ]['img'] ) ? $this->field['options'][ $data ]['img'] : '';
if ( $this->field['tiles'] ) {
$img = $data;
} else {
$img = $this->field['options'][ $data ]['img'] ?? '';
}

if ( '' !== $img ) {
$output = "background-image: url('" . esc_url( $img ) . "');";
}
Expand Down
16 changes: 15 additions & 1 deletion redux-core/inc/fields/link_color/class-redux-link-color.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ public function output( $style = '' ) {
if ( ! empty( $this->field['output'] ) && is_array( $this->field['output'] ) ) {
$style_string = '';

if ( isset( $this->field['output']['important'] ) ) {
if ( $this->field['output']['important'] ) {
$style = str_replace( ';', ' !important;', $style );
}
unset( $this->field['output']['important'] );
}

foreach ( $style as $key => $value ) {
if ( is_numeric( $key ) ) {
$style_string .= implode( ',', $this->field['output'] ) . '{' . $value . '}';
Expand Down Expand Up @@ -316,6 +323,13 @@ public function output( $style = '' ) {
if ( ! empty( $this->field['compiler'] ) && is_array( $this->field['compiler'] ) ) {
$style_string = '';

if ( isset( $this->field['compiler']['important'] ) ) {
if ( $this->field['compiler']['important'] ) {
$style = str_replace( ';', ' !important;', $style );
}
unset( $this->field['compiler']['important'] );
}

foreach ( $style as $key => $value ) {
if ( is_numeric( $key ) ) {
$style_string .= implode( ',', $this->field['compiler'] ) . '{' . $value . '}';
Expand All @@ -333,7 +347,7 @@ public function output( $style = '' ) {
}
}
}
$this->parent->compilerCSS .= esc_attr( $style_string );
$this->parent->compilerCSS .= $style_string;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions redux-core/inc/fields/radio/class-redux-radio.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public function render() {
foreach ( $this->field['options'] as $k => $v ) {
echo '<li>';
echo '<label for="' . esc_attr( $this->field['id'] . '_' . array_search( $k, array_keys( $this->field['options'] ), true ) ) . '">';
echo '<input
type="radio"
class="radio ' . esc_attr( $this->field['class'] ) . '"
id="' . esc_attr( $this->field['id'] . '_' . array_search( $k, array_keys( $this->field['options'] ), true ) ) . '"
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '"
echo '<input
type="radio"
class="radio ' . esc_attr( $this->field['class'] ) . '"
id="' . esc_attr( $this->field['id'] . '_' . array_search( $k, array_keys( $this->field['options'] ), true ) ) . '"
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '"
value="' . esc_attr( $k ) . '" ' . checked( $this->value, $k, false ) . '/>';

echo ' <span>' . esc_html( $v ) . '</span>';
Expand Down
2 changes: 1 addition & 1 deletion redux-framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Description: Build better sites in WordPress fast
* Author: Redux.io + Dovy Paukstys
* Author URI: http://redux.io
* Version: 4.1.26
* Version: 4.1.27
* Text Domain: redux-framework
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
Expand Down
2 changes: 1 addition & 1 deletion sample/sections/color-selection/color.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'subtitle' => esc_html__( 'Pick a background color for the footer (default: #dd9933).', 'your-textdomain-here' ),
'default' => '#dd9933',
'validate' => 'color',
'output' => array( '.footer' ),
'output' => array( '.footer footer #site-footer' ),
),
),
)
Expand Down
5 changes: 4 additions & 1 deletion sample/sections/color-selection/link-color.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
'hover' => '#bbb',
'active' => '#ccc',
),
'output' => 'a',
'output' => array(
'a',
'important' => true,
),

// phpcs:ignore Squiz.PHP.CommentedOutCode
// 'regular' => false, // Disable Regular Color.
Expand Down