diff --git a/addons/grouping/bootstrap.php b/addons/grouping/bootstrap.php new file mode 100644 index 00000000..f8d09952 --- /dev/null +++ b/addons/grouping/bootstrap.php @@ -0,0 +1,17 @@ +=5.6", + "composer/installers": "v1.0.6" + }, + "autoload": { + "psr-4": {"OrganizeSeries\\GroupingAddon\\": "src/"} + } +} diff --git a/addons/grouping/composer.lock b/addons/grouping/composer.lock new file mode 100644 index 00000000..792be788 --- /dev/null +++ b/addons/grouping/composer.lock @@ -0,0 +1,98 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "e9b3436036ef0e93945c8c39e35e0299", + "packages": [ + { + "name": "composer/installers", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "b3bd071ea114a57212c75aa6a2eef5cfe0cc798f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/b3bd071ea114a57212c75aa6a2eef5cfe0cc798f", + "reference": "b3bd071ea114a57212c75aa6a2eef5cfe0cc798f", + "shasum": "" + }, + "replace": { + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "3.7.*" + }, + "type": "composer-installer", + "extra": { + "class": "Composer\\Installers\\Installer", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Composer\\Installers\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama", + "role": "Developer" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "http://composer.github.com/installers/", + "keywords": [ + "TYPO3 CMS", + "TYPO3 Flow", + "TYPO3 Neos", + "agl", + "cakephp", + "codeigniter", + "drupal", + "fuelphp", + "installer", + "joomla", + "kohana", + "laravel", + "li3", + "lithium", + "mako", + "modulework", + "phpbb", + "ppi", + "silverstripe", + "symfony", + "wordpress", + "zend" + ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/master" + }, + "time": "2013-08-20T04:37:09+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.6" + }, + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/addons/grouping/info.json b/addons/grouping/info.json new file mode 100644 index 00000000..0325835f --- /dev/null +++ b/addons/grouping/info.json @@ -0,0 +1 @@ +{"versionFile":"organize-series-grouping.php","slug":"organize-series-grouping","textDomain":"organize-series-grouping","name":"PublishPress Series Grouping","releaseFilesRemove":["src\/tests\/**","src\/acceptance_tests\/**","src\/docs\/**","src\/info.json","src\/readme.txt","src\/wp-assets\/**","src\/.travis.yml","src\/ISSUE_TEMPLATE.md","src\/PULL_REQUEST_TEMPLATE.md","src\/assets\/src\/**"],"wpOrgRelease":"2.2.6"} \ No newline at end of file diff --git a/addons/grouping/js/series-groups.js b/addons/grouping/js/series-groups.js new file mode 100644 index 00000000..eacf2bbf --- /dev/null +++ b/addons/grouping/js/series-groups.js @@ -0,0 +1,47 @@ +jQuery(document).ready(function($) { + $('#the-list').on('click', '.editinline', function() { + var id, type, editRowData, rowData, group_check, group_text; + var r_id = inlineEditTax.getId(this); + type = $('#the-list').attr('data-wp-lists').substr(5); + rowData = $('#inline_group_'+r_id); + id = $('series_group_id', rowData).text(); + $('#hidden_group_id', 'div.inline_edit_group_old').remove(); + $('div.inline_edit_group_old').attr('class', 'inline_edit_group_'); + $('div.inline_edit_group_').attr('class', 'inline_edit_group_'+id); + editRowData = $('.inline_edit_group_'+id); + /*editRow = $('#inline-edit').clone(true);*/ + + if ( type == 'tag' ) { + group_check = $('.group_inline_edit', rowData).text(); + group_text = $('.group_inline_name', rowData).text(); + + if ( group_check === '' ) { + group_check = -1; + } + + $('.group_inline_edit', rowData).each(function() { + if ( term_ids = $(this).text() ) + { + taxname = 'category'; + + $('ul.'+taxname+'-checklist :checkbox', editRowData).val(term_ids.split(',')); + + } + }); + + } + + $('span.catshow').click(function() { + $(this).hide().next().show().parent().next().addClass("cat-hover"); + }); + + $('span.cathide').click(function() { + $(this).hide().prev().show().parent().next().removeClass("cat-hover"); + }); + $(editRowData).attr('class', 'inline_edit_group_old'); + }); + + var series_filter = $('#series_group_filter'); + + $('.col-wrap', '#col-right').prepend(series_filter); +}); \ No newline at end of file diff --git a/addons/grouping/legacy-includes.php b/addons/grouping/legacy-includes.php new file mode 100644 index 00000000..e6fd11fb --- /dev/null +++ b/addons/grouping/legacy-includes.php @@ -0,0 +1,650 @@ +series_load_theme_css(); + } + return $template; +} + +function orgseries_upgrade_check() { + global $orgseries_groups_ver; + //below is where I will indicate any upgrade routines that need to be run + $version_check = get_option('orgseries_grouping_version'); + if ( !$version_check ) { //this may be the first time orgseries is used + if ( $is_imported = get_option('orgseries_grouping_import_completed') ) // we know a version 1.5 and earlier was previously installed (before we saved version numbers) - update needed + upgrade_orgseries_grouping_from_one_five(); + add_option('orgseries_grouping_version', $orgseries_groups_ver); + add_option('orgser_grp_upgrade_'.$orgseries_groups_ver); + return; + } + + orgseries_grouping_upgrade($orgseries_groups_ver, $version_check); + + update_option('orgseries_grouping_version', $orgseries_groups_ver); +} + +/* +* +* This is the function for doing any upgrades necessary +*/ + +function orgseries_grouping_upgrade($this_version, $old_version) { + global $wpdb; + + if ( $old_version == '1.6' ) { + //let's fix up any potential errors in the database from a bad 1.5-1.6 import + //First up is a fix for object_id == 0; + $object_id = 0; + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d", $object_id) ); + + //next up is reset the term_counts for all series_groups so they are correct. + $args = array( + 'hide_empty' => false, + 'fields' => 'ids' + ); + + $groups = get_series_groups($args); + $groups = array_map('intval', $groups); + $groups = implode(', ',$groups); + $query = "SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id IN ( $groups ) AND taxonomy = 'series_group'"; + $terms = $wpdb->get_results( $query ); + while ( $group = array_shift($terms) ) + $_groups[] = $group->term_taxonomy_id; + $series_groups = $_groups; + update_series_group_count($series_groups, 'series_group'); + exit; + return true; + } + return true; +} + +function upgrade_orgseries_grouping_from_one_five() { + //if ( !taxonomy_exists('series_group') ) + //orgseries_grouping_taxonomy(); + + //let's get all the existing Series Categories in the old category system + $args = array( + 'hide_empty' => false, + 'fields' => 'ids', + 'taxonomy' => 'category' + ); + + + $old_groups = get_old_series_groups($args); //list of category ids that are groups + + $args_b = array( + 'include' => $old_groups, + 'hide_empty' => false + ); + + $_old_groups = get_terms('category', $args_b); //need to do this in order to get the description field. + + $args_c = array( + 'hide_empty' => false, + 'taxonomy' => 'category' + ); + + //let's set up the new groups in the new taxonomy system + if ( empty($_old_groups) ) return; + foreach ( $_old_groups as $new_group ) { + wp_insert_term( + $new_group->name, + 'series_group', + array( + 'description' => $new_group->description, + 'slug' => $new_group->slug + ) + ); + + //let's get the series from the old groups, add to the new taxonomy, and then remove them from the old groups. We'll leave the old groups (categories) in case there are regular posts added to them. + $get_series = get_series_in_group($new_group->term_id, $args_c); + $ser_term_id = (int) $new_group->term_id; + + if ( empty($get_series) ) continue; + foreach ( $get_series as $serial ) { + $id = orgseries_group_id($serial); + + $post_arr = array( + 'ID' => $id, + 'post_status' => 'publish', + ); + wp_update_post($post_arr); + wp_set_object_terms($id, $ser_term_id, 'series_group', true); + } + } + + $group_ids = get_objects_in_term( $old_groups, 'category', array( 'hide_empty' => false)); + + if ( empty($group_ids) ) return; + foreach ($group_ids as $p_id) { + wp_delete_object_term_relationships($p_id,'category'); + } +} + +function orgseries_grouping_posttype() { + global $checkpage, $_GET; + $args = array( + 'description' => 'Used for associating Series with series categoriess', + 'public' => false, + 'public_queryable' => true, + 'taxonomies' => array('category', 'series_group'), + 'rewrite' => array('slug' => 'seriesgroup') + ); + + register_post_type('series_grouping', $args); + + if ( 'edit-tags.php' == $checkpage && ( isset($_GET['taxonomy']) && ppseries_get_series_slug() == $_GET['taxonomy'] ) ) { + require_once(ABSPATH.'wp-admin/includes/meta-boxes.php'); + add_action('quick_edit_custom_box', 'orgseries_group_inline_edit', 9,3); + + } + +} + +function orgseries_grouping_taxonomy() { + $permalink_slug = 'series_group'; + $object_type = array('series_grouping'); + $capabilities = array( + 'manage_terms' => 'manage_series', + 'edit_terms' => 'manage_series', + 'delete_terms' => 'manage_series', + 'assign_terms' => 'manage_series' + ); + $labels = array( + 'name' => _x('Series Categories', 'taxonomy general name', 'organize-series'), + 'singular_name' => _x('Series Category', 'taxonomy singular name', 'organize-series'), + 'search_items' => __('Search Series Categories', 'organize-series'), + 'popular_items' => __('Popular Series Categories', 'organize-series'), + 'all_items' => __('All Series Categories', 'organize-series'), + 'edit_item' => __('Edit Series Category', 'organize-series'), + 'update_item' => __('Update Series Category', 'organize-series'), + 'add_new_item' => __('Add New Series Category', 'organize-series'), + 'new_item_name' => __('New Series Category', 'organize-series'), + 'menu_name' => __('Series Categories', 'organize-series') + ); + $args = array( + 'update_count_callback' => 'update_series_group_count', + 'labels' => $labels, + 'rewrite' => array( 'slug' => $permalink_slug, 'with_front' => true ), + 'show_ui' => true, + 'public' => true, + 'capabilities' => $capabilities, + 'query_var' => 'series_group', + 'hierarchical' => true + ); + register_taxonomy( 'series_group', $object_type, $args ); +} + +function update_series_group_count($terms, $taxonomy) { + global $wpdb; + if ( !is_array($terms) ) $terms = (array) $terms; + $terms = array_map('intval', $terms); + $taxonomy = 'series_group'; + foreach ( (array) $terms as $term) { + $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term) ); + $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); + } + + clean_term_cache($terms, '', false); + return true; +} + + +function orgseries_grouping_import_existing_series() { + //do a check to see if there are existing series and NO existing posts in the 'series_grouping' post_type. If this is the case then we need to do the import. If not, then we break out. + if ( !($is_imported = get_option('orgseries_grouping_import_completed')) ) { + $series = get_terms( ppseries_get_series_slug(), array('hide_empty'=>false, 'fields' => 'ids') ); + + foreach ( $series as $this_series ) { + $post_args = array( + 'post_type' => 'series_grouping', + 'to_ping' => 0, + 'post_title' => 'series_grouping_'.$this_series, + 'post_name' => 'series_grouping_'.$this_series + ); + wp_insert_post($post_args); + } + add_option('orgseries_grouping_import_completed','1'); + + } +} + +function orgseries_groups_admin_menu() { + add_submenu_page( 'edit.php', 'Series Categories', 'Series Categories', 'manage_series', 'edit-tags.php?taxonomy=series_group'); +} + +function orgseries_group_add_queryvars($qvs) { + $qvs[] = 'series_group'; + return $qvs; +} + +function orgseries_group_parsequery() { + global $wp_query; + if ( isset($wp_query->query_vars['series_group']) ) { + $wp_query->is_series_group = true; + } else { + $wp_query->is_series_group = false; + } +} + +function orgseries_group_where($where) { + global $wpdb, $wp_query; + if ( $wp_query->is_series_group && is_admin() ) { + $series_group = $wp_query->query_vars['series_group']; + $series_array = get_series_in_group($series_group); + $series_string = implode(",", $series); + $where .= " AND t.term_id IN ({$series_string})"; + } + return $where; +} + +function orgseries_manage_grouping_filter_setup() { + global $_GET, $wp_version; + if ( !empty($_GET['ser_grp']) && is_admin() && $wp_version >= 3.1 ) { + add_filter('get_terms_args', 'orgseries_grp_term_filter', 10, 2); + } +} + +function orgseries_grp_term_filter($args, $taxonomies) { + global $_GET; + if ( in_array(ppseries_get_series_slug(), $taxonomies) ) { + $group_id = (int) $_GET['ser_grp']; + $series_array = get_series_in_group($group_id); + $args['include'] = $series_array; + } + return $args; +} + +function orgseries_manage_grouping_columns() { + global $wp_version; + //hook into manage-series-groups page + add_filter('manage_edit-series_group_columns', 'series_grouping_columns', 10); + add_filter('manage_series_group_custom_column', 'series_grouping_columns_inside',1,3); + add_filter('manage_edit-series_group_sortable_columns', 'series_group_sortable_columns'); + if ($wp_version >= '3.1') + add_action('after-series-table', 'select_series_group_filter'); +} + +function orgseries_grouping_settings_setup() { + //add_settings_field('series_grouping_delete_settings','Series Categories Addon Settings','series_grouping_delete_output', 'orgseries_options_page','series_uninstall_settings'); + register_setting('orgseries_options', 'org_series_options'); + add_filter('orgseries_options', 'series_grouping_options_validate', 10, 2); +} + +function series_grouping_options_validate($newinput, $input) { + $newinput['kill_grouping_on_delete'] = ( isset($input['kill_grouping_on_delete']) && $input['kill_grouping_on_delete'] == 1 ? 1 : 0 ); + return $newinput; +} + +function series_grouping_delete_output() { + global $orgseries; + $org_opt = $orgseries->settings; + $org_name = 'org_series_options'; + $k_on_delete = is_array($org_opt) && isset($org_opt['kill_grouping_on_delete']) ? $org_opt['kill_grouping_on_delete'] : 0; + ?> + + + + + + + + 'View all Series Categories', + 'selected' => $group_id, + 'taxonomy' => 'series_group', + 'name' => 'ser_grp', + 'hide_empty' => false + ); + ?> +
+
+ + + +
+
+ = '3.1' ) + $g_link = ''.$count.''; + else + $g_link = $count; + $column_return = '

'.$g_link.'

'; + } + return $column_return; +} + +function manage_series_grouping_columns($columns) { + global $pagenow; + $columns['group'] = __('Series Categories', 'organize-series'); + return $columns; +} + +function manage_series_grouping_columns_inside($content, $column_name, $id) { + $column_return = $content; + if ($column_name == 'group') { + $group_id = orgseries_group_id($id); + + $column_return .= '
'; + + if ( $groups = wp_get_object_terms($group_id, 'series_group') ) { + foreach ( $groups as $group ) { + $column_return .= '
'.$group->name . '
'; + $cat_id[] = $group->term_id; + $cat_name[] = $group->name; + } + $category_ids = implode(",",$cat_id); + $category_names = implode(",",$cat_name); + $column_return .= ''; + } else { + $column_return .= '—'; + $column_return .= ''; + } + $column_return .= '
'; + } + return $column_return; +} + +function add_orgseries_group_fields($taxonomy) { + $empty = ''; + $empty = (object) $empty; + $empty->ID = ''; + $box['args'] = array( + 'taxonomy' => 'series_group' + ); + ?> +
+
+
+
+

+
+ +
+ +
+
+
+
+ term_id; + $groupID = orgseries_group_id($series_ID); + $post_arr = array( 'ID' => $groupID, 'post_type' => 'series_grouping' ); + $groups = wp_get_object_terms(array($groupID), 'series_group', array('fields' => 'ids')); + + ?> + + + +
+
+
+
+
+
+
    +
  • +
+
+
    + $groups, 'taxonomy' => 'series_group' )); ?> +
+
+
+
+ +
+
+
+
+ + + +
+ + + + +
+ + +
    + 'series_group')) ?> +
+
+
+ 'series_grouping', + 'to_ping' => 0, + 'post_title' => 'series_grouping_'.$series_id, + 'post_name' => 'series_grouping_'.$series_id + ); + $group_id = wp_insert_post($post_arr); + if ( !empty($tax_input['series_group']) ) + wp_set_object_terms($group_id, $terms, 'series_group', true); + return $group_id; +} + +function wp_update_series_group($series_id, $taxonomy_id) { + global $_POST; + + extract($_POST, EXTR_SKIP); + + $tax_input['series_group'] = !isset( $tax_input['series_group'] ) ? array() : $tax_input['series_group']; + + $terms = os_stringarray_to_intarray((array) $tax_input['series_group']); + $id = orgseries_group_id($series_id); + wp_set_object_terms($id, $terms, 'series_group'); + return $id; +} + +function wp_delete_series_group($series_id, $taxonomy_id) { + global $_POST; + extract($_POST, EXTR_SKIP); + $id = orgseries_group_id( (int) $series_id ); + wp_delete_post($id,true); + //TODO check, do we need wp_delete_post_term_relationship here? +} + +function orgseries_group_id($series_id) { + $post_title = 'series_grouping_'.$series_id; + $query = array( 'post_status' => array( 'draft', 'publish' ), 'name' => $post_title, 'post_type' => 'series_grouping'); + $series_posts = get_posts( $query ); + $series_post = reset( $series_posts ); + $group_id = $series_post instanceof WP_Post ? $series_post->ID : 0; + if ( $series_id && ! $group_id ) { + //looks like the series didn't get added as a custom post for some reason. Let's fix that + return wp_insert_series_group($series_id, ''); + } + return $group_id; +} + +function orgseries_get_seriesid_from_group($group_id) { + $grouppost = get_post($group_id); + if (!$grouppost || $grouppost->post_type != 'series_grouping' ) return false; + $series_name = $grouppost->post_name; + $series_id = ltrim($series_name, 'series_grouping_'); + $series_id = (int) $series_id; + return $series_id; +} + +//INCLUDE TEMPLATE TAGS FILE// +require_once(plugin_dir_path(__FILE__) . '/orgseries-grouping-template-tags.php'); + +//helper functions +function os_stringarray_to_intarray($array) { + function to_int(&$val, $key) { + $val = (int) $val; + } + + array_walk($array, 'to_int'); + + return $array; +} + + + +/** + * Shortcode to get the author box + * + * @param array $attributes + * + * @return string + */ +function publishpress_series_groups($attributes) +{ + + return get_series_group_list([], [], false); +} \ No newline at end of file diff --git a/addons/grouping/organize-series-grouping.php b/addons/grouping/organize-series-grouping.php new file mode 100644 index 00000000..7713ba24 --- /dev/null +++ b/addons/grouping/organize-series-grouping.php @@ -0,0 +1,11 @@ + 'term_id', + 'order' => 'ASC', + 'exclude' => array(), + 'include' => array(), + 'number' => '', + 'fields' => 'all', + 'number' => '', + 'offset' => '', + 'exclusions' => '', + 'exclude_tree' => array(), + 'limit' => '', + 'parent' => '', + 'hierarchical' => true, + 'child_of' => 0, + 'pad_counts' => false, + 'hide_empty' => true, + 'taxonomy' => 'series_group' + ); + + $args = wp_parse_args( $args, $defaults ); + $args['number'] = absint( $args['number'] ); + $args['offset'] = absint( $args['offset'] ); + + if ( '' !== $args['parent'] ) { + $args['child_of'] = 0; + $args['hierarchical'] = false; + $args['pad_counts'] = false; + } + + extract($args, EXTR_SKIP); + + if ( $child_of ) { + $hierarchy = _get_term_hierarchy('series_group'); + if ( !isset($hierarchy[$parent]) ) + return $empty_array; + } + + + $_orderby = strtolower($orderby); + if ( empty($_orderby) || 'id' == $_orderby ) + $orderby = 'seriest.term_id'; + elseif ( 'name' == $_orderby ) + $orderby = 'seriest.name'; + elseif ( 'slug' == $_orderby ) + $orderby = 'seriest.slug'; + elseif ( 'term_id' == $_orderby ) + $orderby = 'seriest.term_id'; + + if ( !empty($orderby) ) + $orderby = "ORDER BY $orderby"; + else + $order = ''; + + $where = ''; + $inclusions = ''; + + if ( !empty($include) ) { + $exclude = ''; + $exclude_tree = ''; + $ingroups = wp_parse_id_list($include); + + foreach ( $ingroups as $ingroup ) { + if ( empty($inclusions) ) + $inclusions = ' AND ( seriest.term_id = ' . intval($ingroup) . ' '; + else + $inclusions .= ' OR seriest.term_id = ' . intval($ingroup) . ' '; + } + } + + if ( !empty($inclusions) ) + $inclusions .= ')'; + $where .= $inclusions; + + $exclusions = ''; + if ( !empty( $exclude_tree ) ) { + $excluded_trunks = wp_parse_id_list($exclude_tree); + foreach ( $excluded_trunks as $extrunk ) { + $excluded_children = (array) get_terms('series_group', array('child_of' => intval($extrunk), 'fields' => 'ids')); + $excluded_children[] = $extrunk; + foreach ( $excluded_children as $exgroup) { + if ( empty($exclusions) ) + $exclusions = ' AND ( seriest.term_id <> ' . intval($exgroup) . ' '; + else + $exclusions .= ' AND seriest.term_id <> ' . intval($exgroup) . ' '; + } + } + } + + if ( !empty($exclude) ) { + $exgroups = wp_parse_id_list($exclude); + foreach ( $exgroups as $exgroup ) { + if ( empty($exclusions) ) + $exclusions = ' AND ( seriest.term_id <> ' . intval($exgroup) . ' '; + else + $exclusions .= ' AND seriest.term_id <> ' . intval($exgroup) . ' '; + } + } + + $where .= $exclusions; + + if ( '' !== $parent ) { + $parent = (int) $parent; + $where .= " AND seriesttt.parent = '$parent'"; + } + + if ( $hide_empty && !$hierarchical ) { + $where .= ' AND seriesttt.count != 0'; + } + + //don't limit the query results when we have to descend the family tree + if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' === $parent ) { + if ( $offset ) + $limit = 'LIMIT ' . $offset . ',' . $number; + else + $limit = 'LIMIT ' . $number; + } else { + $limit = ''; + } + + $selects = array(); + switch ( $fields ) { + case 'all': + $selects = array('seriest.*', 'seriesttt.*'); + break; + case 'ids': + $selects = array('seriest.term_id'); + break; + case 'id=>parent': + $selects = array('seriest.term_id', seriesttt.parent, 'seriesttt.count'); + break; + case 'names': + $selects = array('seriest.term_id', 'seriest.name'); + break; + case 'slugs': + $selects = array('seriest.term_id', 'seriest.slug'); + break; + case 'count': + $orderby = ''; + $order = ''; + $selects = array('COUNT(*)'); + } + + $select_this = implode(', ', $selects); + + $join = ''; + + //OLD QUERY -> $query = "SELECT DISTINCT $select_this FROM $wpdb->term_relationships seriestt INNER JOIN $wpdb->posts seriesp ON seriestt.object_id = seriesp.ID INNER JOIN $wpdb->term_taxonomy seriesttt ON seriesttt.term_taxonomy_id = seriestt.term_taxonomy_id INNER JOIN $wpdb->terms seriest ON seriesttt.term_id = seriest.term_id WHERE seriesp.post_type = 'series_grouping' AND seriesttt.taxonomy = '$taxonomy' $where $orderby $order $limit"; + + $query = $wpdb->prepare( "SELECT DISTINCT $select_this FROM $wpdb->terms AS seriest INNER JOIN $wpdb->term_taxonomy AS seriesttt ON seriesttt.term_id = seriest.term_id $join WHERE seriesttt.taxonomy = '%s' $where $orderby $order $limit", $taxonomy ); + + if ( 'count' == $fields ) { + $group_count = $wpdb->get_var($query); + return $group_count; + } + + $series_groups = $wpdb->get_results($query); + + + if ( $child_of ) { + $children = _get_term_hierarchy('series_group'); + if ( ! empty($children) ) + $series_groups = &_get_term_children($child_of, $series_groups, 'series_group'); + } + + //Update term counts to include children. + if ( $pad_counts && 'all' == $fields ) + _pad_term_counts($series_groups, 'series_group'); + + //Make sure we show empty groups that have children. + if ( $hierarchical && $hide_empty && is_array($series_groups) ) { + foreach ($series_groups as $k => $group ) { + if ( ! $group->count ) { + $children = _get_term_children($group->term_id, $series_groups, 'series_group'); + if ( is_array($children) ) + foreach ( $children as $child ) + if ( $child->count ) + continue 2; + + // It really is empty + unset($series_groups[$k]); + } + } + } + reset ( $series_groups ); + + $_groups = array(); + + if ( 'id=>parent' == $fields ) { + while ($group = array_shift($series_groups) ) + $_groups[$group->term_id] = $group->parent; + $series_groups = $_groups; + } elseif ( 'ids' == $fields ) { + while ( $group = array_shift($series_groups) ) + $_groups[] = $group->term_id; + $series_groups = $_groups; + } elseif ( 'names' == $fields ) { + while ( $group = array_shift($series_groups) ) + $_groups[] = $group->name; + $series_groups = $_groups; + } elseif ( 'slugs' == $fields ) { + while ( $group = array_shift($series_groups) ) + $_groups[] = $group->slug; + $series_groups = $_groups; + } + + if ( 0 < $number && intval(@count($series_groups)) > $number ) + $series_groups = array_slice($series_groups, $offset, $number); + + return $series_groups; +} + +/* +* get_series_group_list() - used to output an unordered list containing a group title followed by the list of series in that group. If no group_id is included then the function will return all the groups with the series in each group. If group_id(s) are included then the groups requested will be returned. Can also choose to "exclude" certain groups from the list. This function uses the utility functions found on this page. +* @param $group_id can be just a string|int containing the id of one group that you want to return the list for OR it can be an array with four paramaters: include (array, comma, or space deliminated list of group_ids to include), exclude (array, comma, or space deliminated list of group_ids to exclude), orderby (id=default, name, or slug), and order (asc=default/desc) +* @param $args (optional) you can indicate how you want the series list in each group to be returned. For a list of what args you can include see the "get_terms()" function found in /wp-includes/taxonomy.php. +* @param bool (true|false) - true will echo the results, false will return the results. default is true. +* +* @return string if false or echo string if true. +*/ +function get_series_group_list( $group_id = array(), $args = array(), $echo = true ) { + + if ( !empty($group_id) ) { + if ( !is_array($group_id) ) { + $group_id = (int) $group_id; + $group_id = array( 'include' => $group_id ); + } else { + $group_id = array( 'include' => $group_id ); + } + } + + $groups = get_series_groups( $group_id ); + $group_out = ''; + + foreach ( $groups as $group ) { + $group_out .= '

'.$group->name.'

'; + $group_out .= ''; + } + + if ( $echo ) + echo $group_out; + else + return $group_out; +} + +/** +* DEPECRATED FUNCTIONS +* This section contains functions no longer active but still required for upgrade purposes. +**/ +function get_old_series_groups( $args = array() ) { + global $wpdb; + + $defaults = array ( + 'orderby' => 'term_id', + 'order' => 'ASC', + 'exclude' => array(), + 'include' => array(), + 'number' => '', + 'fields' => 'all', + 'number' => '', + 'offset' => '', + 'exclusions' => '', + 'limit' => '', + 'hide_empty' => true, + 'taxonomy' => 'series_group' + ); + + $args = wp_parse_args( $args, $defaults ); + $args['number'] = absint( $args['number'] ); + $args['offset'] = absint( $args['offset'] ); + + extract($args, EXTR_SKIP); + + $_orderby = strtolower($orderby); + if ( empty($_orderby) || 'id' == $_orderby ) + $orderby = 'seriest.term_id'; + elseif ( 'name' == $_orderby ) + $orderby = 'seriest.name'; + elseif ( 'slug' == $_orderby ) + $orderby = 'seriest.slug'; + elseif ( 'term_id' == $_orderby ) + $orderby = 'seriest.term_id'; + + if ( !empty($orderby) ) + $orderby = "ORDER BY $orderby"; + else + $order = ''; + + $where = ''; + $inclusions = ''; + + if ( !empty($include) ) { + $exclude = ''; + $ingroups = wp_parse_id_list($include); + + foreach ( $ingroups as $ingroup ) { + if ( empty($inclusions) ) + $inclusions = ' AND ( seriest.term_id = ' . intval($ingroup) . ' '; + else + $inclusions .= ' OR seriest.term_id = ' . intval($ingroup) . ' '; + } + } + + if ( !empty($inclusions) ) + $inclusions .= ')'; + $where .= $inclusions; + + if ( !empty($exclude) ) { + $exgroups = wp_parse_id_list($exclude); + foreach ( $exgroups as $exgroup ) { + if ( empty($exclusions) ) + $exclusions = ' AND ( seriest.term_id <> ' . intval($exgroup) . ' '; + else + $exclusions .= ' AND seriest.term_id <> ' . intval($exgroup) . ' '; + } + } + + $where .= $exclusions; + + if ( ! empty($number ) ) { + if ( $offset ) + $limit = 'LIMIT ' . $offset . ',' . $number; + else + $limit = 'LIMIT ' . $number; + } + + if ( $hide_empty ) { + $where .= ' AND seriesttt.count != 0'; + } + + $selects = array(); + switch ( $fields ) { + case 'all': + $selects = array('seriest.term_id', 'seriest.name', 'seriest.slug'); + break; + case 'ids': + $selects = array('seriest.term_id'); + break; + case 'names': + $selects = array('seriest.term_id', 'seriest.name'); + break; + case 'slugs': + $selects = array('seriest.term_id', 'seriest.slug'); + break; + case 'count': + $orderby = ''; + $order = ''; + $selects = array('COUNT(*)'); + } + + $select_this = implode(', ', $selects); + + $query = $wpdb->prepare( "SELECT DISTINCT $select_this FROM $wpdb->term_relationships seriestt INNER JOIN $wpdb->posts seriesp ON seriestt.object_id = seriesp.ID INNER JOIN $wpdb->term_taxonomy seriesttt ON seriesttt.term_taxonomy_id = seriestt.term_taxonomy_id INNER JOIN $wpdb->terms seriest ON seriesttt.term_id = seriest.term_id WHERE seriesp.post_type = 'series_grouping' AND seriesttt.taxonomy = '%s' $where $orderby $order $limit", $taxonomy ); + + if ( 'count' == $fields ) { + $group_count = $wpdb->get_var($query); + return $group_count; + } + + $series_groups = $wpdb->get_results($query); + + $_groups = array(); + + if ( 'ids' == $fields ) { + while ( $group = array_shift($series_groups) ) + $_groups[] = $group->term_id; + $series_groups = $_groups; + } elseif ( 'names' == $fields ) { + while ( $group = array_shift($series_groups) ) + $_groups[] = $group->name; + $series_groups = $_groups; + } elseif ( 'slugs' == $fields ) { + while ( $group = array_shift($series_groups) ) + $_groups[] = $group->slug; + $series_groups = $_groups; + } + + if ( 0 < $number && intval(@count($series_groups)) > $number ) + $series_groups = array_slice($series_groups, $offset, $number); + + return $series_groups; + +} +?> diff --git a/addons/grouping/orgseries-grouping.css b/addons/grouping/orgseries-grouping.css new file mode 100644 index 00000000..ba4ff1fa --- /dev/null +++ b/addons/grouping/orgseries-grouping.css @@ -0,0 +1,16 @@ +.inner-sidebar #side-sortables { + width: 100%; +} + +.inner-sidebar { + position: relative; + top: -220px; + right: 40px; + float: right; + width: 315px; +} + +.series-group { + margin: 3px; + padding: 3px; +} diff --git a/addons/grouping/readme.txt b/addons/grouping/readme.txt new file mode 100644 index 00000000..e152b325 --- /dev/null +++ b/addons/grouping/readme.txt @@ -0,0 +1,26 @@ +=== PublishPress Series Addon - Grouping === +Contributors: nerrad +Tags: series, groups +Requires at least: 3.7 +Tested up to: 4.8 +Stable tag: 2.2.3 +License: GPLv2 +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +This addon gives you the ability to group series together by category. + +== Description == +One of the common case uses I've heard from people requesting this feature is the following: Say you are using your blog to write a book over a bunch of posts. The posts in each series are chapters in a book (chapter 1 is a post in a book). This way people can easily navigate through the different chapters. What if, however, the book is actually part of a series of books. In this case you'd want a way to present the Books as a part of a group. Aha! This is where PublishPress Series Grouping would come in to solve the problem. + +== Installation == +This add-on requires PublishPress Series Core to be installed and active. + +1. MAKE SURE YOU BACKUP YOUR WORDPRESS DATABASE (that\'s all in caps for a reason - nothing *should* go wrong but it\'s a good precaution nevertheless!!) +1. Download the File (or use the built-in updater provided by WordPress) +1. Extract to a folder in `../wp-content/plugins/`. The add-on folder can be named whatever you want but the default is \"organize-series-grouping\". The final structure would be something like this: `../wp-content/plugins/organize-series-grouping/--and all the plugin files/folders--` +1. Activate the plugin on your WordPress plugins page. + +You can do the above or just use the new plugin install integrated in WordPress. + +== Changelog == +All change-log information for the plugin can be found at https://organizeseries.com/changelogs \ No newline at end of file diff --git a/addons/grouping/theme/primary/taxonomy-series_group.php b/addons/grouping/theme/primary/taxonomy-series_group.php new file mode 100644 index 00000000..ada6e43e --- /dev/null +++ b/addons/grouping/theme/primary/taxonomy-series_group.php @@ -0,0 +1,50 @@ + +
+
+ + +
> +
+ term_id); //gets the series data for the displayed group. + $series_args = array( + 'include' => $get_series, + 'number' => '', + 'order' => 'ASC', + 'hide_empty' => true + ); + wp_serieslist_display(false, $series_args); //this is an organize-series template tag. List of series is output according to the serieslist_display template in series options. + ?> +
+
+
+
+ \ No newline at end of file diff --git a/addons/grouping/theme/twenty-ten/groups-template.php b/addons/grouping/theme/twenty-ten/groups-template.php new file mode 100644 index 00000000..6af90cc7 --- /dev/null +++ b/addons/grouping/theme/twenty-ten/groups-template.php @@ -0,0 +1,90 @@ + + +
+
+ +
> + 'DESC', + 'orderby' => 'term_id', + 'hide_empty' => false, + 'hierarchical' => true + ); + + //series listing args + $get_series_args = array( + 'hide_empty' => 1, + ); + + $groups = get_series_groups( $args ); //get series groups + + foreach ( $groups as $group ) { + + //does the group have children? If so, then let's get cracking... + + $c_groups = _get_term_children($group->term_id, $groups, 'series_group'); + + if ( $c_groups ) { + ?> +
+

name ?>

+ + + +
+

name; ?>

+ + term_id, $get_series_args); //gets the series data for the displayed group. + + $series_args = array( + 'include' => $get_series, + 'order' => 'DESC' + ); + wp_serieslist_display(false, $series_args); //this is an organize-series template tag. List of series is output according to the serieslist_display template in series options. + ?> +
+ + +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/addons/grouping/uninstall.php b/addons/grouping/uninstall.php new file mode 100644 index 00000000..73cdbf52 --- /dev/null +++ b/addons/grouping/uninstall.php @@ -0,0 +1,16 @@ +settings; +$delete_grouping = $settings['kill_grouping_on_delete']; + +if ( $delete_grouping == 1 ) { + $type = 'series_grouping'; + $query = "SELECT ID from $wpdb->posts WHERE post_type = '$type'"; + $series_grouping_posts = $wpdb->get_results($query); + foreach ( $series_grouping_posts as $series ) { + wp_delete_post($series->ID,true); + } + delete_option('orgseries_grouping_import_completed'); //so if reactivated later it will work! + delete_option('orgseries_grouping_version'); //remove ALL traces! +} +?> \ No newline at end of file diff --git a/addons/publisher/css/series_im_sort_articles.css b/addons/publisher/css/series_im_sort_articles.css index 199d390b..e790148e 100644 --- a/addons/publisher/css/series_im_sort_articles.css +++ b/addons/publisher/css/series_im_sort_articles.css @@ -1,7 +1,3 @@ -.pp-series-publisher-wrap .tablenav.top { - display: none; -} - .pp-series-publisher-wrap .inner-sidebar #side-sortables { width: 300px; } diff --git a/addons/publisher/series-part-post-table.php b/addons/publisher/series-part-post-table.php index b15419f8..a63cf133 100644 --- a/addons/publisher/series-part-post-table.php +++ b/addons/publisher/series-part-post-table.php @@ -172,6 +172,15 @@ protected function column_default($item, $column_name) return !empty($item->$column_name) ? $item->$column_name : '—'; } + /** + * Message to be displayed when there are no items + * + * @since 3.1.0 + */ + public function no_items() { + _e( 'There are no posts in this series.', 'organize-series' ); + } + /** * The checkbox column * diff --git a/addons/publisher/series-publish-post-table.php b/addons/publisher/series-publish-post-table.php index 041f22e0..cd43ed51 100644 --- a/addons/publisher/series-publish-post-table.php +++ b/addons/publisher/series-publish-post-table.php @@ -37,6 +37,15 @@ protected function get_table_classes() return parent::get_table_classes(); } + /** + * Message to be displayed when there are no items + * + * @since 3.1.0 + */ + public function no_items() { + _e( 'There are no unpublished posts in this series.', 'organize-series' ); + } + /** * Show single row item * @@ -65,6 +74,7 @@ public function get_columns() 'categories' => esc_html__('Categories', 'organize-series'), 'tags' => esc_html__('Tags', 'organize-series'), 'post_status' => esc_html__('Status', 'organize-series'), + 'series_part' => esc_html__('Order', 'organize-series'), 'series_preview' => esc_html__('Preview', 'organize-series'), ]; @@ -78,10 +88,13 @@ public function get_table_data(){ $series_posts = []; if ($series_id) { + $per_page = $this->get_items_per_page('pp_series_publisher_per_page', 20); + $current_page = $this->get_pagenum(); + $arg = array( 'post_status' => ['future', 'draft', 'pending'], - 'posts_per_page' => -1, - 'no_found_rows' => true, + 'paged' => $current_page, + 'posts_per_page' => $per_page, 'tax_query' => array( 'relation' => 'AND', array( @@ -90,14 +103,145 @@ public function get_table_data(){ 'terms' => array($series_id) ) ), + 'meta_query' => array( + "relation" => "or", + 'part_field_sort_value' => array( + 'key' => $meta_key, + 'type'=> 'NUMERIC' + ), + 'part_field_sort' => array( + 'key' => $meta_key, + 'compare' => 'NOT EXISTS', + 'type'=> 'NUMERIC' + ), + ), + 'orderby' => array( + 'part_field_sort' => 'ASC' + ), ); + + /** + * Handle category filter + */ + if ((!empty($_REQUEST['cat'])) && $category = sanitize_text_field($_REQUEST['cat'])) { + $arg['tax_query'][] = [ + 'taxonomy' => 'category', + 'field' => 'slug', + 'terms' => array($category) + ]; + } + + /** + * Handle search + */ + if ((!empty($_REQUEST['s'])) && $search = sanitize_text_field($_REQUEST['s'])) { + $arg['s'] = $search; + } + $series_query = new WP_Query($arg); - $series_posts = $series_query->posts; + + return ['posts'=> $series_query->posts, 'counts'=> $series_query->found_posts]; } return $series_posts; } + /** + * Returns the count of records in the database. + * + * @return null|string + */ + public static function record_count() + { + return $this->get_table_data()['counts']; + } + + + /** + * Add custom filter to tablenav + * + * @param string $which + */ + protected function extra_tablenav( $which ) { + + if ( 'top' === $which ) { + + $selected_category = (!empty($_REQUEST['cat'])) ? sanitize_text_field($_REQUEST['cat']) : ''; + ?> +
+ __( 'All Categories', 'organize-series' ), + 'orderby' => 'name', + 'order' => 'ASC', + 'hide_empty' => false, + 'hide_if_empty' => true, + 'selected' => $selected_category, + 'hierarchical' => true, + 'name' => 'cat', + 'taxonomy' => 'category', + 'value_field' => 'slug', + ) + ); + + submit_button( __( 'Filter', 'organize-series' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); + ?> +
+ has_items()) { + return; + } + + $input_id = $input_id . '-search-input'; + + if (!empty($_REQUEST['orderby'])) { + echo ''; + } + if (!empty($_REQUEST['order'])) { + echo ''; + } + if (!empty($_REQUEST['page'])) { + echo ''; + } + if (!empty($_REQUEST['action'])) { + echo ''; + } + if (!empty($_REQUEST['series_ID'])) { + echo ''; + } + if (!empty($_REQUEST['cat'])) { + echo ''; + } + + if (!empty($_REQUEST['s'])) { + echo ''; + } + + echo ''; + ?> + + ID, SERIES_PART_KEY, true); + + if(empty(trim($series_part))){ + $series_part_output = esc_html__('(Currently has no Part number)', 'organize-series'); + }else{ + $series_part_output = $series_part; + } + + return $series_part_output; + } + /** * The title column * @@ -294,42 +459,30 @@ protected function get_bulk_actions() */ public function prepare_items() { + /** * First, lets decide how many records per page to show */ - $per_page = $this->get_items_per_page(str_replace('-', '_', $this->screen->id . '_per_page'), 999); - + $per_page = $this->get_items_per_page('pp_series_publisher_per_page', 20); /** * Fetch the data */ - $data = $this->get_table_data(); - - /** - * Pagination. - */ + $results = $this->get_table_data(); + $data = $results['posts']; + $total_items = $results['counts']; $current_page = $this->get_pagenum(); - $total_items = count($data); - - - /** - * The WP_List_Table class does not handle pagination for us, so we need - * to ensure that the data is trimmed to only the current page. We can use - * array_slice() to - */ - $data = array_slice($data, (($current_page - 1) * $per_page), $per_page); /** * Now we can add the data to the items property, where it can be used by the rest of the class. */ $this->items = $data; - /** * We also have to register our pagination options & calculations. */ $this->set_pagination_args([ 'total_items' => $total_items, //calculate the total number of items - 'per_page' => $per_page, //determine how many items to show on a page + 'per_page' => $per_page, //determine how many items to show on a page 'total_pages' => ceil($total_items / $per_page) //calculate the total number of pages ]); } diff --git a/addons/publisher/series_im_admin_main.php b/addons/publisher/series_im_admin_main.php index 84e53dfb..c6ef6290 100644 --- a/addons/publisher/series_im_admin_main.php +++ b/addons/publisher/series_im_admin_main.php @@ -4,87 +4,23 @@ - - - - - - - - - + + + + + - 'publish', - 'paged' => 1, - 'posts_per_page' => 1, - 'tax_query' => array( - 'relation' => 'AND', - array( - 'taxonomy' => ppseries_get_series_slug(), - 'field' => 'id', - 'terms' => array($ser->term_id) - ) - ), - ); - $series_posts = new WP_Query($series_posts_arg); - $published_posts_counts = $series_posts->found_posts; - - //count unpublished posts - $series_posts_arg = array( - 'post_status' => ['draft', 'pending'], - 'paged' => 1, - 'posts_per_page' => 1, - 'tax_query' => array( - 'relation' => 'AND', - array( - 'taxonomy' => ppseries_get_series_slug(), - 'field' => 'id', - 'terms' => array($ser->term_id) - ) - ), - ); - $series_posts = new WP_Query($series_posts_arg); - $unpublished_posts_counts = $series_posts->found_posts; - - //count scheduled posts - $series_posts_arg = array( - 'post_status' => 'future', - 'paged' => 1, - 'posts_per_page' => 1, - 'tax_query' => array( - 'relation' => 'AND', - array( - 'taxonomy' => ppseries_get_series_slug(), - 'field' => 'id', - 'terms' => array($ser->term_id) - ) - ), - ); - $series_posts = new WP_Query($series_posts_arg); - $scheduled_posts_counts = $series_posts->found_posts; - - ?> > - - - - + + + + term_id != '' ) { ?> @@ -143,5 +269,93 @@ function edit_series_form_fields($series, $taxonomy) { status = 'error'; + // Bail if required term data is missing + if (!isset($_POST['terms']) || !isset($_POST['nonce']) || !isset($_POST['tax']) || !is_array($_POST['terms'])) { + $return_data->message = __('Invalid form data', 'organize-series'); + die( json_encode( $return_data ) ); + } + + $terms = array_map('sanitize_text_field', $_POST['terms']); + $nonce = sanitize_text_field($_POST['nonce']); + $tax = sanitize_text_field($_POST['tax']); + + //bail if invalid nonce + if (!wp_verify_nonce($nonce, 'series-order-nonce')) { + $return_data->message = __('Invalid nonce, reload and try again', 'organize-series'); + die( json_encode( $return_data ) ); + } + + // Attempt to get the taxonomy + $tax = get_taxonomy($tax); + + // Bail if taxonomy does not exist + if ( empty( $tax ) ) { + $return_data->message = __('Invalid taxonomy', 'organize-series'); + die( json_encode( $return_data ) ); + } + + // Bail if current user cannot assign terms + if ( ! current_user_can( $tax->cap->edit_terms ) ) { + $return_data->message = __('Not enough permission', 'organize-series'); + die( json_encode( $return_data ) ); + } + + $return_data->message = __('Updated successfully', 'organize-series'); + + foreach($terms as $key => $term_id) { + $wpdb->update( $wpdb->terms, array('term_order' => ($key + 1)), array('term_id' => $term_id) ); + + } + clean_term_cache($terms); + + die( json_encode( $return_data ) ); +} + +function pp_series_terms_clauses($clauses, $taxonomies, $args) { + + if (!in_array(ppseries_get_series_slug(), $taxonomies) && !in_array('series_group', $taxonomies)) { + return $clauses; + } + + if (is_admin()) { + //return if use orderby columns + if (isset($_GET['orderby']) && $_GET['orderby'] != 'term_order') { + return $clauses; + } + if ((!isset($args['ignore_term_order']) || (isset($args['ignore_term_order']) && $args['ignore_term_order'] !== true))) { + $clauses['orderby'] = 'ORDER BY t.term_order'; + } + + return $clauses; + } + + if ((!isset($args['ignore_term_order']) || (isset($args['ignore_term_order']) && $args['ignore_term_order'] !== true) ) ) { + $clauses['orderby'] = 'ORDER BY t.term_order'; + } + + return $clauses; +} + +function pp_series_get_terms_orderby($orderby, $args) +{ + if (!isset($args['taxonomy'])) { + return $orderby; + } + if (!in_array(ppseries_get_series_slug(), $args['taxonomy']) && !in_array('series_group', $args['taxonomy'])) { + return $orderby; + } + + if (isset($args['orderby']) && $args['orderby'] == "term_order" && $orderby != "term_order") { + return "t.term_order"; + } + + return $orderby; +} ?> \ No newline at end of file diff --git a/orgSeries-options.php b/orgSeries-options.php index ab9fec2c..91220de0 100644 --- a/orgSeries-options.php +++ b/orgSeries-options.php @@ -156,6 +156,7 @@ function orgseries_validate($input) { $newinput['metabox_show_add_new'] = ( isset($input['metabox_show_add_new']) && $input['metabox_show_add_new'] == 1 ? 1 : 0 ); $newinput['metabox_show_series_part'] = ( isset($input['metabox_show_series_part']) && $input['metabox_show_series_part'] == 1 ? 1 : 0 ); $newinput['metabox_show_post_title_in_widget'] = ( isset($input['metabox_show_post_title_in_widget']) && $input['metabox_show_post_title_in_widget'] == 1 ? 1 : 0 ); + $newinput['limit_series_meta_to_single'] = ( isset($input['limit_series_meta_to_single']) && $input['limit_series_meta_to_single'] == 1 ? 1 : 0 ); $newinput['series_perp_toc'] = trim(preg_replace('/[^0-9]/', '', ($input['series_perp_toc']))); @@ -713,6 +714,11 @@ function series_templates_core_fieldset() { + + + +
name); ?> term_id.'')) ."'>". esc_html__('Update order', 'organize-series').""; - ?> term_id.'')) ."'>". esc_html__('Publish all', 'organize-series').""; + echo "term_id.'')) ."'>". esc_html__('Series order', 'organize-series').""; ?> term_id.'')) ."'>". esc_html__('Unpublish all', 'organize-series').""; + echo "term_id.'')) ."'>". esc_html__('Publish or schedule posts', 'organize-series').""; ?> slug.'')) ."'>". esc_html__('View series in admin','organize-series').""; diff --git a/addons/publisher/series_issue_manager.php b/addons/publisher/series_issue_manager.php index 7f1718b3..bb880c57 100644 --- a/addons/publisher/series_issue_manager.php +++ b/addons/publisher/series_issue_manager.php @@ -227,7 +227,7 @@ function series_issue_manager_add_series_form() { $published = get_option('im_published_series'); $unpublished = get_option('im_unpublished_series'); ?> -
+
+ + + +

+ +

+
/> +

diff --git a/orgSeries-setup.php b/orgSeries-setup.php index ed73dcbd..d2571d72 100644 --- a/orgSeries-setup.php +++ b/orgSeries-setup.php @@ -286,8 +286,14 @@ function register_taxonomy() { 'update_item' => __('Update Series', 'organize-series'), 'add_new_item' => __('Add New Series', 'organize-series'), 'new_item_name' => __('New Series Name', 'organize-series'), - 'menu_name' => __('Manage Series', 'organize-series'), - 'not_found' => __('No series found', 'organize-series') + 'menu_name' => __('Series', 'organize-series'), + 'not_found' => __('No series found', 'organize-series'), + 'back_to_items' => __('← Go to Series', 'organize-series'), + 'view_item' => __('View Series', 'organize-series'), + 'no_terms' => __('No Series', 'organize-series'), + 'items_list' => __('Series List', 'organize-series'), + 'item_link' => __('Series Link', 'organize-series'), + 'item_link_description' => __('A link to a Series', 'organize-series') ); $args = array( 'update_count_callback' => '_os_update_post_term_count', @@ -309,7 +315,7 @@ function add_settings($reset = false) { 'custom_css' => 1, 'automatic_series_part' => 0, 'metabox_show_add_new' => 0, - 'metabox_show_series_part' => 0, + 'metabox_show_series_part' => 1, 'metabox_show_post_title_in_widget' => 0, 'kill_on_delete' => 0, //determines if all series information (including series-icon tables) will be deleted when the plugin is deleted using the delete link on the plugins page. 'auto_tag_toggle' => 1, //sets the auto-tag insertions for the post-list box for posts that are part of series. @@ -321,6 +327,7 @@ function add_settings($reset = false) { 'series_post_list_limit' => '', 'series_post_list_position' => 'default', 'series_metabox_position' => 'default', + 'limit_series_meta_to_single' => 0, 'series_navigation_box_position' => 'default', 'series_toc_title' => __('All Series','organize-series'), //new template options @@ -654,6 +661,10 @@ public function add_series_meta($content) { */ $add_series_content = apply_filters('pp_series_add_series_content', true); + if (isset($this->settings['limit_series_meta_to_single']) && (int)$this->settings['limit_series_meta_to_single'] > 0 && !is_single()) { + return $content; + } + if($add_series_content && $this->settings['auto_tag_seriesmeta_toggle']) { if ($series_meta = wp_seriesmeta_write()) { $position = isset($this->settings['series_metabox_position']) ? $this->settings['series_metabox_position'] : 'default'; @@ -679,6 +690,11 @@ function orgseries_trim_excerpt($content) { function add_series_meta_excerpt($content) { if ( is_single() ) return; + + if (isset($this->settings['limit_series_meta_to_single']) && (int)$this->settings['limit_series_meta_to_single'] > 0 && !is_single()) { + return $content; + } + if($this->settings['auto_tag_seriesmeta_toggle']) { if ($series_meta = wp_seriesmeta_write(true)) { $position = isset($this->settings['series_metabox_position']) ? $this->settings['series_metabox_position'] : 'default'; diff --git a/orgSeries-taxonomy.php b/orgSeries-taxonomy.php index 68e08c7b..7429f51c 100644 --- a/orgSeries-taxonomy.php +++ b/orgSeries-taxonomy.php @@ -495,6 +495,18 @@ function wp_set_post_series( $post, $update, $post_ID = 0, $series_id = array(), $automatic_series_part = isset($settings['automatic_series_part']) ? (int)$settings['automatic_series_part'] : 0; + //set auto series part if part is empty + if($automatic_series_part === 0 + && isset($_REQUEST['action']) + && in_array($_REQUEST['action'], ['editpost']) + && $_REQUEST['post_series'] > 0 + && is_array($_REQUEST['series_part']) + && count($_REQUEST['series_part']) === 1 + && empty($_REQUEST['series_part'][$_REQUEST['post_series']]) + ) { + $automatic_series_part = 1; + } + if ( !is_bool($update) ){ return; //safety check for users on earlier version of WP (so existing series don't get messed up) } diff --git a/orgSeries-utility.php b/orgSeries-utility.php index b38fb94d..8d1afa01 100644 --- a/orgSeries-utility.php +++ b/orgSeries-utility.php @@ -77,7 +77,7 @@ function get_series_order($posts, $postid = 0, $series_id = 0, $skip = TRUE, $on /** NOTE: %postcontent% is NOT replaced with this function...it happens in the content filter function **/ function token_replace($replace, $referral = 'other', $id = 0, $ser_ID = 0) { global $post, $orgseries; - $p_id = ( $id == 0 ) ? $post->ID : $id; + $p_id = ( $id == 0 && !empty($post) ) ? $post->ID : $id; $ser_id = ( $ser_ID == 0 ) ? $id : $ser_ID; $id = ( (int)$id === 0 ) ? $ser_ID : $id; diff --git a/orgSeries-widgets.php b/orgSeries-widgets.php index 60965c83..661010c0 100644 --- a/orgSeries-widgets.php +++ b/orgSeries-widgets.php @@ -70,7 +70,7 @@ function form( $instance ) { $number = (int) $instance['number']; ?>

- +

@@ -265,7 +265,7 @@ function form( $instance ) { $series_array_list = ppseries_get_series_list(); ?>

- +

@@ -275,23 +275,23 @@ function form( $instance ) {

-
- - +
+ +

-

-

- +

- + 0) { @@ -359,24 +359,24 @@ function form( $instance ) {

- +

- + -
+

- + -
+

-

@@ -412,10 +412,10 @@ function form( $instance ) {

-
+

body .serieslist-box { - height: auto; - /*min-height: 100px;*/ -} - -h2.series-title { - font-size: 1.2em; - color: #1E3A96; - text-align: center; -} - -ul.serieslist-ul { - margin: 0; - padding: 0; - list-style-type: none; -} - -li.serieslist-li { - margin: 0; - padding: 0; -} - -.seriesbox { - display:inline; - float: right; - background: #F8F8F8; - color: #777; - text-align: left; - font-size: .8em; - margin: 0 10px 0px 10px; - padding: 0 20px 20px; - border: 1px solid #1E3A96; - border-bottom-width: 3px; - min-width: 125px; -} - -.seriesbox img { - padding-top: 20px; -} - -h3.series-title-post-page { - font-size: 1.1em; - color: #1E3A96; - text-align: center; -} - -p.series-description { - font-style: italic; -} - -.seriesmeta { - background-color: #E5F3FF; - font-size: .8em; - padding: 20px; - margin-bottom: 20px; -} - -.series-nav-left { - float: left; - margin-right: 20px; -} - -.series-nav-right { - float: right; -} - -.stocpagination { - clear: both; - padding: 20px 0; - position: relative; - left: 465px; - font-size: 12px; - line-height: 13px; - color: #fff; -} - -.stocpagination a { - display: block; - text-decoration: none; - color: #717171; - font: bold 11px Arial, sans-serif; - text-shadow: 0px 1px white; - padding: 5px 8px; - - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - - -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.35); - -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.35); - box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.35); - background: #f9f9f9; - - background: -webkit-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); - background: -moz-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); - background: -o-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); - background: -ms-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); - background: linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#e8e8e8',GradientType=0 ); -} - -.stocpagination a:visited { - color: #5F7BB3; - background-color: #F1F6F5; - text-decoration: none; -} - -.page-numbers { - background-color:transparent; - display: block; - float: left; - margin: 0 5px 5px 0; - padding: 6px 9px 5px 9px; - text-decoration:none; - width: auto; - color: #fff; - background: #555; - border-color: #c8d6d6 #9EADAD #9EADAD #c8d6d6; -} - -.stocpagination a:hover { - -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.55); - -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.55); - box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.55); - background: #fff; - background: -webkit-linear-gradient(top, #fff 0%, #e8e8e8 100%); - background: -moz-linear-gradient(top, #fff 0%, #e8e8e8 100%); - background: -o-linear-gradient(top, #fff 0%, #e8e8e8 100%); - background: -ms-linear-gradient(top, #fff 0%, #e8e8e8 100%); - background: linear-gradient(top, #fff 0%, #e8e8e8 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#e8e8e8',GradientType=0 ); -} - -.stocpagination a:active, .page-numbers.current:active { - -webkit-box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.5), 0px 1px 1px 0px rgba(255,255,255,1); - -moz-box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.5), 0px 1px 1px 0px rgba(255,255,255,1); - box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.5), 0px 1px 1px 0px rgba(255,255,255,1); -} - -.page-numbers.current:hover { - -webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.9); - -moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.9); - box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.9); - background: #99cefc; - background: -webkit-linear-gradient(top, #99cefc 0%, #57a1d8 100%); - background: -moz-linear-gradient(top, #99cefc 0%, #57a1d8 100%); - background: -o-linear-gradient(top, #99cefc 0%, #57a1d8 100%); - background: -ms-linear-gradient(top, #99cefc 0%, #57a1d8 100%); - background: linear-gradient(top, #99cefc 0%, #57a1d8 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99cefc', endColorstr='#57a1d8',GradientType=0 ); -} - -.page-numbers.current { - color: white; - text-shadow: 0px 1px #3f789f; - -webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.8); - -moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.8); - box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.8); - background: #7cb9e5; - background: -webkit-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); - background: -moz-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); - background: -o-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); - background: -ms-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); - background: linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7cb9e5', endColorstr='#57a1d8',GradientType=0 ); -} +.imgset { + float: left; + /*overflow: visible;*/ + border: none; + margin-right: 6px; +} + +.serieslist-content { + font-size: 1.2em; + color: #000; + text-align: left; +} + +.serieslist-box { + background: #fff; + width: 90%; + /*height: 100px;*/ + padding: 6px; + margin: 10px auto 0 auto; + border: 1px solid #1E3A96; + border-bottom: 2px solid #1E3A96; +} + +html>body .serieslist-box { + height: auto; + /*min-height: 100px;*/ +} + +h2.series-title { + font-size: 1.2em; + color: #1E3A96; + text-align: center; +} + +ul.serieslist-ul { + margin: 0; + padding: 0; + list-style-type: none; +} + +li.serieslist-li { + margin: 0; + padding: 0; +} + +.seriesbox { + background: #F8F8F8; + color: #777; + text-align: left; + font-size: .8em; + margin: 0 10px 0px 10px; + padding: 0 20px 20px; + border: 1px solid #1E3A96; + border-bottom-width: 3px; + min-width: 125px; +} + +.seriesbox img { + padding-top: 20px; +} + +h3.series-title-post-page { + font-size: 1.1em; + color: #1E3A96; + text-align: center; +} + +p.series-description { + font-style: italic; +} + +.seriesmeta { + background-color: #E5F3FF; + font-size: .8em; + padding: 20px; + margin-bottom: 20px; +} + +.series-nav-left { + float: left; + margin-right: 20px; +} + +.series-nav-right { + float: right; +} + +.stocpagination { + clear: both; + padding: 20px 0; + position: relative; + left: 465px; + font-size: 12px; + line-height: 13px; + color: #fff; +} + +.stocpagination a { + display: block; + text-decoration: none; + color: #717171; + font: bold 11px Arial, sans-serif; + text-shadow: 0px 1px white; + padding: 5px 8px; + + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + + -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.35); + -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.35); + box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.35); + background: #f9f9f9; + + background: -webkit-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); + background: -moz-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); + background: -o-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); + background: -ms-linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); + background: linear-gradient(top, #f9f9f9 0%, #e8e8e8 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#e8e8e8',GradientType=0 ); +} + +.stocpagination a:visited { + color: #5F7BB3; + background-color: #F1F6F5; + text-decoration: none; +} + +.page-numbers { + background-color:transparent; + display: block; + float: left; + margin: 0 5px 5px 0; + padding: 6px 9px 5px 9px; + text-decoration:none; + width: auto; + color: #fff; + background: #555; + border-color: #c8d6d6 #9EADAD #9EADAD #c8d6d6; +} + +.stocpagination a:hover { + -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.55); + -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.55); + box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.55); + background: #fff; + background: -webkit-linear-gradient(top, #fff 0%, #e8e8e8 100%); + background: -moz-linear-gradient(top, #fff 0%, #e8e8e8 100%); + background: -o-linear-gradient(top, #fff 0%, #e8e8e8 100%); + background: -ms-linear-gradient(top, #fff 0%, #e8e8e8 100%); + background: linear-gradient(top, #fff 0%, #e8e8e8 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#e8e8e8',GradientType=0 ); +} + +.stocpagination a:active, .page-numbers.current:active { + -webkit-box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.5), 0px 1px 1px 0px rgba(255,255,255,1); + -moz-box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.5), 0px 1px 1px 0px rgba(255,255,255,1); + box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,0.5), 0px 1px 1px 0px rgba(255,255,255,1); +} + +.page-numbers.current:hover { + -webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.9); + -moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.9); + box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.9); + background: #99cefc; + background: -webkit-linear-gradient(top, #99cefc 0%, #57a1d8 100%); + background: -moz-linear-gradient(top, #99cefc 0%, #57a1d8 100%); + background: -o-linear-gradient(top, #99cefc 0%, #57a1d8 100%); + background: -ms-linear-gradient(top, #99cefc 0%, #57a1d8 100%); + background: linear-gradient(top, #99cefc 0%, #57a1d8 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#99cefc', endColorstr='#57a1d8',GradientType=0 ); +} + +.page-numbers.current { + color: white; + text-shadow: 0px 1px #3f789f; + -webkit-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.8); + -moz-box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.8); + box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.8); + background: #7cb9e5; + background: -webkit-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); + background: -moz-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); + background: -o-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); + background: -ms-linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); + background: linear-gradient(top, #7cb9e5 0%, #57a1d8 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7cb9e5', endColorstr='#57a1d8',GradientType=0 ); +} diff --git a/orgSeries.php b/orgSeries.php index b645d5d4..2da8a9ea 100644 --- a/orgSeries.php +++ b/orgSeries.php @@ -3,7 +3,7 @@ * Plugin Name: PublishPress Series * Plugin URI: https://publishpress.com/publishpress-series/ * Description: PublishPress Series allows you to group content together into a series. This is ideal for magazines, newspapers, short-story writers, teachers, comic artists, or anyone who writes multiple posts on the same topic. - * Version: 2.9.2 + * Version: 2.10.0 * Author: PublishPress * Author URI: https://publishpress.com/ * Text Domain: organize-series @@ -73,7 +73,7 @@ register_activation_hook( __FILE__, 'pp_series_core_activation' ); if (!defined('ORG_SERIES_VERSION')) { - define('ORG_SERIES_VERSION', '2.9.2'); //the current version of the plugin + define('ORG_SERIES_VERSION', '2.10.0'); //the current version of the plugin define( 'SERIES_FILE_PATH', __FILE__ ); define( 'SERIES_PATH_URL', plugins_url('', __FILE__).'/' ); define('SERIES_LOC', plugins_url('', __FILE__).'/' ); //the uri of the orgSeries files. diff --git a/orgSeriesBoxTheme.css b/orgSeriesBoxTheme.css index 9a33608c..054771da 100644 --- a/orgSeriesBoxTheme.css +++ b/orgSeriesBoxTheme.css @@ -1,5 +1,4 @@ .seriesbox { - float: right; background: #fff; color: #444; text-align: left; @@ -62,4 +61,13 @@ .series-nav-left { margin-right: 20px; -} \ No newline at end of file +} + +@media (min-width:979px) { + body:not([class*="theme-twentytwenty"]) .series-nav-left { + float: left; + } + body:not([class*="theme-twentytwenty"]) .series-nav-right { + float: right; + } +} diff --git a/orgSeriesDarkTheme.css b/orgSeriesDarkTheme.css index 88a15bc1..29bb4f01 100644 --- a/orgSeriesDarkTheme.css +++ b/orgSeriesDarkTheme.css @@ -1,6 +1,4 @@ .seriesbox { - display:inline; - float: right; background: #222; color: #f2f2f2; text-align: left; @@ -40,4 +38,13 @@ .series-nav-left { margin-right: 20px; -} \ No newline at end of file +} + +@media (min-width:979px) { + body:not([class*="theme-twentytwenty"]) .series-nav-left { + float: left; + } + body:not([class*="theme-twentytwenty"]) .series-nav-right { + float: right; + } +} diff --git a/orgSeriesLightTheme.css b/orgSeriesLightTheme.css index 5ad33e30..368cb4da 100644 --- a/orgSeriesLightTheme.css +++ b/orgSeriesLightTheme.css @@ -1,6 +1,4 @@ .seriesbox { - display:inline; - float: right; background: #f2f2f2; color: #444; text-align: left; @@ -42,4 +40,13 @@ .series-nav-left { margin-right: 20px; -} \ No newline at end of file +} + +@media (min-width:979px) { + body:not([class*="theme-twentytwenty"]) .series-nav-left { + float: left; + } + body:not([class*="theme-twentytwenty"]) .series-nav-right { + float: right; + } +} diff --git a/package-lock.json b/package-lock.json index 2d53da22..3c790964 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,6 +92,64 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@types/eslint": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", @@ -4160,13 +4218,14 @@ } }, "node_modules/terser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", - "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "dependencies": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "bin": { @@ -4290,15 +4349,6 @@ "node": ">=0.10.0" } }, - "node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/terser/node_modules/source-map-support": { "version": "0.5.20", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", @@ -5010,6 +5060,55 @@ } } }, + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@types/eslint": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz", @@ -8444,22 +8543,17 @@ } }, "terser": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz", - "integrity": "sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - }, "source-map-support": { "version": "0.5.20", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", diff --git a/readme.txt b/readme.txt index 629cc8c3..d1b994dc 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: issue, series, magazine, newspaper, publication Requires at least: 4.7 Requires PHP: 5.6 Tested up to: 6.0 -Stable tag: 2.9.2 +Stable tag: 2.10.0 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -173,6 +173,31 @@ Yes, Publishpress Series introduces a new taxonomy "series". Thanks to the rich == Changelog == +v2.10.0- 2022-10-04 +* Feature: Add Series and Series Group re-order field with term drag and drop feature #584 +* Feature: Add series order link to series and new post selected series #612 +* Feature: Add series Groups(Categories) overview page shortcode [publishpress_series_categories] #591 +* Feature: Add search box to series metabox #239 +* Feature: Add settings to limit series meta display to single page only #588 +* Fixed: Only allow valid numbers in series part input #634 +* Update: Set series part if empty irrespective of Automatic Numbering settings #636 +* Feature: Add filter, search and pagination to "Publish Series" screen #510 +* Update: Enable "Show "Series Part"" by default #617 +* Fixed: Font styles and font sizes inconsistency on 'Series Table of Contents' widget page #604 +* Fixed: Syntax Error on 'Edit Series' page #607 +* Update: Simplify the Publish Series screen #614 +* Update: Change the menu links inside Series #615 +* Fixed: TOC template header and footer deprecated in FSE themes #623 +* Fixed: Groups template header and footer deprecated in FSE themes #416 +* Fixed: Series taxonomy template header and footer deprecated in FSE themes #409 +* Feature: Add "Series Groups" into a Free feature #613 +* Fixed: Remove new taxonomy metabox #595 +* Fixed: Float left for next post navigation #586 +* Update: Series-Translation updates for Spanish July 21 #578 +* Update: Series-Translation updates for French-Spanish-Italian #567 +* Update: Remove "Create as unpublished"? #655 +* Fixed: Series link in "Posts" table doesn't go anywhere #651 + v2.9.2- 2022-07-12 * Fixed: Problem with series navigation and List #568 * Fixed: Define plugin addon path from primary plugin file to fix include error #570 diff --git a/seriestoc.php b/seriestoc.php index a15db548..3371198f 100644 --- a/seriestoc.php +++ b/seriestoc.php @@ -1,33 +1,42 @@ - AND WITH - * 4. Modify the .css in your active theme/orgSeries.css to your liking. - * 5. That's it! - * - * @package WordPress - * @subpackage Twenty_Twelve - * @since Twenty Twelve 1.0 - */ - -get_header(); ?> - -
-
- - - -
-
-
- - - + AND WITH + * 4. Modify the .css in your active theme/orgSeries.css to your liking. + * 5. That's it! + * + * @package WordPress + * @subpackage Twenty_Twelve + * @since Twenty Twelve 1.0 + */ + +if (pp_series_locate_template(['header.php'])) { + get_header(); +} elseif (pp_series_is_block_theme()) { + pp_series_format_block_theme_header(); +} +?> + +
+
+ + + +
+
+
+ + \ No newline at end of file diff --git a/src/domain/services/CoreBootstrap.php b/src/domain/services/CoreBootstrap.php index ee9f13c8..fd160329 100644 --- a/src/domain/services/CoreBootstrap.php +++ b/src/domain/services/CoreBootstrap.php @@ -46,6 +46,7 @@ private function requireLegacyOrganizeSeries() require_once Root::coreMeta()->getBasePath() . 'inc/debug/plugin_activation_errors.php'; require_once Root::coreMeta()->getBasePath() . 'inc/review/review-request.php'; require_once Root::coreMeta()->getBasePath() . 'addons/publisher/series_issue_manager.php'; + require_once Root::coreMeta()->getBasePath() . 'addons/grouping/organize-series-grouping.php'; }