Skip to content

Commit

Permalink
Merge pull request #467 from publishpress/feature/release-2.8.0
Browse files Browse the repository at this point in the history
Feature/release 2.8.0
  • Loading branch information
olatechpro authored Mar 15, 2022
2 parents d5c8827 + 6908470 commit 4e6f7d3
Show file tree
Hide file tree
Showing 45 changed files with 2,190 additions and 1,113 deletions.
257 changes: 135 additions & 122 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/series-overview.css

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

1 change: 1 addition & 0 deletions css/themes/twentynineteen.css

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

1 change: 1 addition & 0 deletions css/themes/twentytwenty.css

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

1 change: 1 addition & 0 deletions css/themes/twentytwentyone.css

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

4 changes: 2 additions & 2 deletions inc/templates/taxonomy-series.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
$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">
<section id="series-primary" class="site-content">
<div id="series-content" role="main">

<header class="page-header">
<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
Expand Down
24 changes: 15 additions & 9 deletions inc/utility-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,15 @@ function ppseries_settings_template_tabbed_callback(){
//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 (!get_option('pp_series_2_7_1_upgraded')) {
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);
update_option('pp_series_2_7_1_upgraded', true);
}

if (!get_option('pp_series_2_7_5_upgraded')) {
Expand All @@ -101,6 +94,19 @@ function pp_series_upgrade_function()
}
update_option('pp_series_2_7_5_upgraded', true);
}

if (!get_option('pp_series_2_8_0_upgraded')) {
$settings = get_option('org_series_options');
$settings = apply_filters('org_series_settings', $settings);
//add new series settings only if not fresh installation
if ($settings) {
$settings['metabox_show_post_title_in_widget'] = 0;
$settings['metabox_show_series_part'] = 0;
$settings['metabox_show_add_new'] = 0;
update_option('org_series_options', $settings);
}
update_option('pp_series_2_8_0_upgraded', true);
}


}
Expand Down
65 changes: 53 additions & 12 deletions includes-core/PPSeriesCoreAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@

class PPSeriesCoreAdmin {
function __construct() {

if ( current_user_can( 'manage_options' ) )
{
if (is_admin())
{
require_once SERIES_PATH . '/vendor/publishpress/wordpress-version-notices/includes.php';
add_filter(
\PPVersionNotices\Module\TopNotice\Module::SETTINGS_FILTER,
function ($settings) {
if (current_user_can('manage_publishpress_series')) {
if (is_admin()) {
require_once SERIES_PATH . '/vendor/publishpress/wordpress-version-notices/includes.php';
add_filter(
\PPVersionNotices\Module\TopNotice\Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-series'] = [
'message' => 'You\'re using PublishPress Series Free. The Pro version has more features and support. %sUpgrade to Pro%s',
'link' => 'https://publishpress.com/links/series-banner',
Expand All @@ -24,14 +21,58 @@ function ($settings) {

return $settings;
}
);

);
add_filter(
\PPVersionNotices\Module\MenuLink\Module::SETTINGS_FILTER,
function ($settings) {
$settings['publishpress-taxopress'] = [
'parent' => 'orgseries_options_page',
'label' => 'Upgrade to Pro',
'link' => 'https://publishpress.com/links/series-banner',
];

return $settings;
});
}
}

}
add_action('publishpress_series_admin_menu_page', [$this, 'publishpress_series_admin_menu_page']);
}

public function publishpress_series_admin_menu_page(){

add_submenu_page(
'orgseries_options_page',
esc_html__('Publish Series', 'organize-series'),
esc_html__('Publish Series', 'organize-series'),
'manage_publishpress_series',
'pp-series-pro-placeholders-publish-series',
[$this, 'placeholderPagePublishSeries'],
12
);

add_submenu_page(
'orgseries_options_page',
esc_html__('Series Group', 'organize-series'),
esc_html__('Series Group', 'organize-series'),
'manage_publishpress_series',
'pp-series-pro-placeholders-series-group',
[$this, 'placeholderPageSeriesGroup'],
12
);

}

public function placeholderPagePublishSeries(){
wp_register_style('pps-pro-placeholder-css', SERIES_PATH_URL . 'includes-core/pro-placeholder/assets/css/placeholder.css', [], ORG_SERIES_VERSION);
wp_enqueue_style( 'pps-pro-placeholder-css' );
include_once __DIR__ . '/pro-placeholder/views/publish-series-placeholder.php';
}

public function placeholderPageSeriesGroup(){
wp_register_style('pps-pro-placeholder-css', SERIES_PATH_URL . 'includes-core/pro-placeholder/assets/css/placeholder.css', [], ORG_SERIES_VERSION);
wp_enqueue_style( 'pps-pro-placeholder-css' );
include_once __DIR__ . '/pro-placeholder/views/series-group-placeholder.php';
}

}
124 changes: 124 additions & 0 deletions includes-core/pro-placeholder/assets/css/placeholder.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@

/* Placeholder screens */
.pps-elemnt-blur {
filter: blur(2px);
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner img,
div.pp-series-menus-wrapper-promo input.ppc-admin-menu-submit,
div.pp-series-menus-wrapper-promo select.ppc-admin-menu-role,
div.pp-series-menus-wrapper-promo input.ppc-nav-menu-submit,
div.pp-series-menus-wrapper-promo select.ppc-nav-menu-role {
filter: blur(2px);
}

#pp-series-menu-wrapper {
border: none;
box-shadow: none;
background: none;
}

#pp-series-menu-wrapper div.pp-series-menus-promo {
height: 600px;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner {
position: relative;
width: 100%;
height: 100%;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner img {
position: absolute;
width: 100%;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner img.pp-series-mobile {
display: none !important;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner img.pp-series-desktop {
display: block !important;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content {
position: absolute;
top: calc(50% - 100px);
left: calc(50% - 225px);
text-align: center;
background: #655897;
padding: 20px 20px 35px;
border-radius: 6px;
width: 450px;
box-sizing: border-box;
box-shadow: 0 0 25px #ccc;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content p {
line-height: 1.4em;
font-size: 16px;
margin-bottom: 20px;
margin-top: 0;
color: #fff;
padding: 0;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content p:last-of-type {
margin-bottom: 0;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content a {
font-size: 17px;
background: #FCB223;
color: #000;
font-weight: normal;
text-decoration: none;
padding: 9px 12px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
box-sizing: border-box;
border: 1px solid #fca871;
break-inside: avoid;
white-space: nowrap;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content a:hover,
#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content a:focus,
#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content a:active {
background: #fcca46;
color: #000;
}

#pp-series-menu-wrapper div.pp-series-menus-promo-nav {
height: 370px;
}

@media (max-width: 979px) {

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner img.pp-series-mobile {
display: block !important;
}

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner img.pp-series-desktop {
display: none !important;
}

#pp-series-menu-wrapper div.pp-series-menus-promo {
height: 750px;
}
}

@media (max-width: 768px) {

#pp-series-menu-wrapper div.pp-series-menus-promo .pp-series-menus-promo-inner .pp-series-menus-promo-content {
top: calc(50% - 100px);
left: calc(50% - 150px);
padding: 20px 20px 35px;
width: 300px;
}

#pp-series-menu-wrapper div.pp-series-menus-promo {
height: 450px;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4e6f7d3

Please sign in to comment.