Skip to content
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
2 changes: 1 addition & 1 deletion assets/js/minified/customize-controls.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/minified/sidebar-controls.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions assets/js/unminified/customize-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@

api.control('blog_show_excerpt', function (control) {
const visibility = function () {
const displayContentSetting = api('display_content');
if ('grid' === setting.get()) {
control.container.slideDown(180);
displayContentSetting.set('excerpt');
} else {
control.container.slideUp(180);
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/unminified/plugins.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! WPZOOM
* inspiro - v2.1.9
* inspiro - v2.1.10
* Author website: https://wpzoom.com/
* This file is automatically created! Do not edit this file directly! */
/*!
Expand Down
2 changes: 1 addition & 1 deletion assets/js/unminified/scripts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! WPZOOM
* inspiro - v2.1.9
* inspiro - v2.1.10
* Author website: https://wpzoom.com/
* This file is automatically created! Do not edit this file directly! */
/* global jQuery */
Expand Down
4 changes: 2 additions & 2 deletions assets/js/unminified/sidebar-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

var editPost = useDispatch("core/editor").editPost;
var isTitleHidden = postMeta
? !!postMeta["_inspiro_hide_title"]
? !!postMeta["inspiro_hide_title"]
: false;

// Apply class to the editor body so CSS can dim the title
Expand All @@ -42,7 +42,7 @@
editPost({
meta: {
...postMeta,
_inspiro_hide_title: value,
inspiro_hide_title: value,
},
});
},
Expand Down
4 changes: 2 additions & 2 deletions inc/classes/class-inspiro-enqueue-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct() {
* Registers custom meta field for the 'page' post type.
*/
public function register_pages_settings_meta() {
register_post_meta( 'page', '_inspiro_hide_title', array(
register_post_meta( 'page', 'inspiro_hide_title', array(
'type' => 'boolean',
'single' => true,
'show_in_rest' => true,
Expand All @@ -57,7 +57,7 @@ public function register_pages_settings_meta() {
*/
public function add_hide_title_class( $classes ) {

if ( is_page() && get_post_meta( get_the_ID(), '_inspiro_hide_title', true ) ) {
if ( is_page() && get_post_meta( get_the_ID(), 'inspiro_hide_title', true ) ) {
$classes[] = 'inspiro-hide-page-title';
}

Expand Down
30 changes: 30 additions & 0 deletions inc/classes/class-inspiro-theme-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ public function migrate_customizer_settings() {
global $_wp_default_headers;

show_message( $this->strings['migrate_customizer_settings'] );

$this->sync_blog_configs_for_premium_theme();

$customizer_data = Inspiro_Customizer::$customizer_data;
$theme_mods = get_theme_mods();
Expand Down Expand Up @@ -756,6 +758,34 @@ public function migrate_customizer_settings() {
}
}


public function sync_blog_configs_for_premium_theme()
{
$layout = get_theme_mod('blog_layout', 'list');
$display_content = get_theme_mod('display_content', 'excerpt');
$blog_show_excerpt = get_theme_mod('blog_show_excerpt', true);
$display_featured_image = get_theme_mod('display_featured_image', true);

update_option('wpzoom_post_view_blog', ('grid' === $layout) ? '3-columns' : 'big-image');

$content_mapping = [
'excerpt' => 'Excerpt',
'full-content' => 'Full Content',
'none' => 'None'
];


if($layout === 'grid' && !$blog_show_excerpt){
$display_content = 'None';
} else {
$display_content = isset($content_mapping[$display_content]) ? $content_mapping[$display_content] : 'Excerpt';
}

set_theme_mod('display_content', $display_content);
update_option('wpzoom_display_content', $display_content);
update_option('wpzoom_single_post_header_image', $display_featured_image ? 'on' : 'off');
}

/**
* Convert custom header media to custom post type slider
* This is necessary because premium version use slider items in header section on homepage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ public function register_configuration( $wp_customize ) {
);
}
}
new Inspiro_Blog_Layout_Config();
new Inspiro_Blog_Layout_Config();
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static function config() {
'priority' => 6,
'label' => esc_html__( 'Content to Display in Archive Pages', 'inspiro' ),
'section' => 'blog_page_section',
'type' => 'radio',
'type' => 'select',
'choices' => array(
'excerpt' => esc_html__( 'Excerpt', 'inspiro' ),
'full-content' => esc_html__( 'Full Content', 'inspiro' ),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! WPZOOM
* inspiro - v2.1.9
* inspiro - v2.1.10
* Author website: https://wpzoom.com/
* This file is automatically created! Do not edit this file directly! */
/* global jQuery, inspiroCustomControl, InspiroFontFamilies */
Expand Down
Loading