Skip to content

Commit

Permalink
Merge pull request #344 from publishpress/feature/release-2.7.1
Browse files Browse the repository at this point in the history
Feature/release 2.7.1
  • Loading branch information
olatechpro authored Dec 9, 2021
2 parents da068a1 + 30e726d commit ac17a3b
Show file tree
Hide file tree
Showing 23 changed files with 4,791 additions and 549 deletions.
12 changes: 6 additions & 6 deletions composer.lock

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

1 change: 1 addition & 0 deletions css/series-overview.css

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

78 changes: 78 additions & 0 deletions inc/templates/taxonomy-series.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php
/**
* The template for series taxonomy
*
* You can customize this template by havinga copy of this file in root child theme's folder
*
* @package PublishPress
*/

get_header();

$description = get_the_archive_description();

// CSS wrapper class for the design
$series_options = get_option('org_series_options');
$series_layout_class = '';
$series_layout_class .= isset($series_options['series_overview_page_layout']) ? 'pps-layout-' . $series_options['series_overview_page_layout'] : 'pps-layout-default';
$series_layout_class .= isset($series_options['series_overview_page_columns']) ? ' pps-columns-' . $series_options['series_overview_page_columns'] : '';
?>
<section id="primary" class="site-content">
<div id="content" role="main">

<header class="page-header">
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
<?php if ( $description ) : ?>
<div class="archive-description"><?php echo wp_kses_post( wpautop( $description ) ); ?></div>
<?php endif; ?>
</header><!-- .page-header -->

<?php if ( have_posts() ) : ?>

<div id="pps-taxonomy-series-overview">
<div class="<?php echo $series_layout_class ?>">
<?php while ( have_posts() ) : ?>
<?php the_post(); ?>
<article class="pps-taxonomy-series__post<?php echo !has_post_thumbnail() ? ' pps-taxonomy-series__no-image' : '' ?>">

<?php if ( has_post_thumbnail() ) { ?>
<div class="pps-taxonomy-series__thumbnail">
<?php the_post_thumbnail(); ?>
</div><!-- .pps-taxonomy-series__thumbnail -->
<?php } ?>

<div class="pps-taxonomy-series__wrapper">
<?php
the_title(
sprintf( '<h2 class="pps-taxonomy-series__title"><a href="%s">', esc_url( get_permalink() ) ),
'</a></h2>'
);
?>
<div class="pps-taxonomy-series__content">
<?php the_excerpt(); ?>
</div>
</div><!-- .pps-taxonomy-series__content -->

</article><!-- .pps-taxonomy-series__post -->
<?php endwhile; ?>
</div>

<div class="pps-taxonomy-series__pagination">
<?php the_posts_pagination(); ?>
</div><!-- .pps-taxonomy-series__pagination -->

</div><!-- #pps-taxonomy-series-overview -->

<?php else : ?>
<p><?php esc_html_e( 'Sorry, no results found.', 'organize-series' ); ?></p>
<?php endif; ?>

</div><!-- #content -->
</section><!-- #primary -->

<?php
if(pp_series_locate_template( array( 'sidebar.php' ) )){
get_sidebar();
}
get_footer();
?>
56 changes: 56 additions & 0 deletions inc/utility-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,60 @@ function ppseries_settings_template_tabbed_callback(){
}
}

if (!function_exists('pp_series_upgrade_function')) {
//activation functions/codes
function pp_series_upgrade_function()
{
$version = get_option('pp_series_version');

if ( !$version || $version < '2.7.1') {
/**
* add newly introduced manage_publishpress_series for administrator
*#https://github.com/publishpress/publishpress-series/issues/313
**/
// Init roles
if ( function_exists( 'get_role' ) ) {
$role = get_role( 'administrator' );
if ( null !== $role && ! $role->has_cap( 'manage_publishpress_series' ) ) {
$role->add_cap( 'manage_publishpress_series' );
}
}
update_option('pp_series_version', ORG_SERIES_VERSION);
}

}
}

if (!function_exists('pp_series_locate_template')) {
/**
* Check if template exist in theme/child theme
*
* We wouldn't use wordpress locate_template()
* as it support theme compact which load
* default template for files like sidebar.php
* even if it doesn't exist in theme
*
* @param array $template
* @return void
*/
function pp_series_locate_template($template_names)
{
$located = false;
foreach ( (array) $template_names as $template_name ) {
if ( ! $template_name ) {
continue;
}
if ( file_exists( STYLESHEETPATH . '/' . $template_name ) ) {
$located = STYLESHEETPATH . '/' . $template_name;
break;
} elseif ( file_exists( TEMPLATEPATH . '/' . $template_name ) ) {
$located = TEMPLATEPATH . '/' . $template_name;
break;
}
}

return $located;

}
}
?>
2 changes: 1 addition & 1 deletion includes-core/PPSeriesCoreAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ function ($settings) {

}

}
}
8 changes: 8 additions & 0 deletions includes-core/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
if (!function_exists('pp_series_core_activation')) {
//activation functions/codes
function pp_series_core_activation()
{
pp_series_upgrade_function();
}
}
40 changes: 23 additions & 17 deletions js/orgseries_options.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
jQuery(document).ready(function($) {
//Thickbox
$(document).on('click','input[name="option_reset"]', function(){
tb_show('Are you sure you want to Reset?','TB_inline?height=155&amp;width=300&amp;inlineId=TBcontent');
return false;
});

$(document).on('click','input[name="option_reset"]', function(){
tb_show('Are you sure you want to Reset?','TB_inline?height=155&amp;width=300&amp;inlineId=TBcontent');
return false;
});
$('input#TBcancel').click(function(){
tb_remove();
});

$('input#TBcancel').click(function(){
tb_remove();
});
$('input#TBsubmit').click(function(){
$('input.reset_option', '#series_options' ).val('1');
document.series_options.submit();
});

$('input#TBsubmit').click(function(){
$('input.reset_option', '#series_options' ).val('1');
document.series_options.submit();
});
});

jQuery(document).ready(function($) {
$('#custom_css').click(function(e) {
var is_checked = $('input#custom_css').is(':checked');

if (is_checked) {
$("input[class='css_style']").attr('disabled', false);
}

if (!is_checked) {
$("input[class='css_style']").attr('disabled', true);
}
});
});

// Toggle a columns setting based on layout value
$('#series_overview_page_layout').change(function(){
if($(this).val() == 'grid'){
$('.ppseries-settings-table').find('tr.pps-row-columns').show();
} else {
$('.ppseries-settings-table').find('tr.pps-row-columns').hide();
}
});
});
Binary file modified languages/organize-series-en_US.mo
Binary file not shown.
Loading

0 comments on commit ac17a3b

Please sign in to comment.