Skip to content

Commit

Permalink
Merge pull request #790 from publishpress/release-v2.11.4
Browse files Browse the repository at this point in the history
Release v2.11.4
  • Loading branch information
olatechpro committed Jun 15, 2023
2 parents 8614c5e + f3d42ba commit 5b50e31
Show file tree
Hide file tree
Showing 29 changed files with 6,476 additions and 5,621 deletions.
4 changes: 2 additions & 2 deletions .builder-post-rsync-filters-post
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
- composer.json
- composer.lock
- vendor/publishpress/vendor-locator/composer.json
- vendor/publishpress/vendor-locator/composer.json
- vendor/publishpress/wordpress-banners/.gitattributes
- vendor/woocommerce/action-scheduler/README.md
- vendor/woocommerce/action-scheduler/changelog.txt
Expand All @@ -19,3 +17,5 @@
- vendor/sabre/vobject/README.md
- vendor/sabre/vobject/tests
- vendor/symfony/polyfill-ctype/README.md
- vendor/composer/installers/.gitignore
- vendor/publishpress/vendor-locator-series-pro/composer.json
8 changes: 7 additions & 1 deletion addons/publisher/css/series_im_sort_articles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
max-width: 910px;
}

.pp-series-publisher-wrap.series-order table.series-parts tbody tr {
.pp-series-publisher-wrap.series-order table tbody tr,
.pp-series-publisher-wrap.series-order-pending table tbody tr {
cursor: move;
}

.pp-series-publisher-wrap.series-order .postbox-container #submitdiv,
.pp-series-publisher-wrap.series-order-pending .postbox-container #submitdiv {
margin-top: 45px;
}

#timestampdiv select {
max-width: 90px !important;
}
Expand Down
6 changes: 5 additions & 1 deletion addons/publisher/js/series_im_sort_articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ jQuery(document).ready( function($) {
axis: "y",
});*/

$(".pp-series-publisher-wrap.series-order table.series-parts tbody").sortable({
$(".pp-series-publisher-wrap.series-order table tbody").sortable({
axis: "y",
});

$(".pp-series-publisher-wrap.series-order-pending table tbody").sortable({
axis: "y",
});

Expand Down
199 changes: 102 additions & 97 deletions addons/publisher/series-part-post-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
*/
class PPS_Publisher_Post_Part_Table extends WP_List_Table
{

/**
* PPS_Publisher_Post_Part_Table constructor.
*
* @param array $args
*/
function __construct($args = [])
public function __construct($args = [])
{

//Set parent defaults
Expand Down Expand Up @@ -71,15 +70,16 @@ public function get_columns()
return $columns;
}

public function get_table_data(){
public function get_table_data()
{

$series_id = isset($_GET['series_ID'])? (int)$_GET['series_ID'] : false;
$meta_key = SERIES_PART_KEY;
$series_id = isset($_GET['series_ID']) ? (int)$_GET['series_ID'] : false;
$meta_key = apply_filters('orgseries_part_key', SERIES_PART_KEY, $series_id);
$series_posts = [];

if ($series_id) {
$arg = array(
'post_status' => 'any',
'post_status' => ['publish'],
'post_type' => apply_filters('orgseries_posttype_support', array('post')),
'posts_per_page' => -1,
'no_found_rows' => true,
Expand All @@ -96,14 +96,14 @@ public function get_table_data(){
'part_field_sort_value' => array(
'key' => $meta_key,
'type'=> 'NUMERIC'
),
),
'part_field_sort' => array(
'key' => $meta_key,
'compare' => 'NOT EXISTS',
'type'=> 'NUMERIC'
),
),
'orderby' => array(
'orderby' => array(
'part_field_sort' => 'ASC'
),
);
Expand All @@ -125,37 +125,39 @@ public function get_table_data(){
*/
protected function handle_row_actions($item, $column_name, $primary)
{
$series_id = isset($_GET['series_ID'])? (int)$_GET['series_ID'] : false;
$series_id = isset($_GET['series_ID']) ? (int)$_GET['series_ID'] : false;

$actions['edit'] = sprintf(
'<a href="%s">%s</a>',
esc_url(
add_query_arg(
[
'post' => $item->ID,
'action' => 'edit',
],
admin_url('post.php')
)
),
esc_html__('Edit', 'organize-series')
);
$actions = array_merge($actions, [
'delete' => sprintf(
'<a href="%s" class="delete-post">%s</a>',
add_query_arg([
'page' => 'manage-issues',
'action' => 'part',
'part_action' => 'pps-publisher-delete-posts',
'series_ID' => esc_attr($series_id),
'series_post' => esc_attr($item->ID),
'_wpnonce' => wp_create_nonce('bulk-series-parts')
],
admin_url('edit.php')),
esc_html__('Trash', 'organize-series')
esc_url(
add_query_arg(
[
'post' => $item->ID,
'action' => 'edit',
],
admin_url('post.php')
)
),
esc_html__('Edit', 'organize-series')
);

$actions = array_merge($actions, [
'delete' => sprintf(
'<a href="%s" class="delete-post">%s</a>',
add_query_arg(
[
'page' => 'manage-issues',
'action' => 'part',
'part_action' => 'pps-publisher-delete-posts',
'series_ID' => esc_attr($series_id),
'series_post' => esc_attr($item->ID),
'_wpnonce' => wp_create_nonce('bulk-series-parts')
],
admin_url('edit.php')
),
]);
esc_html__('Trash', 'organize-series')
),
]);

return $column_name === $primary ? $this->row_actions($actions, false) : '';
}
Expand All @@ -173,14 +175,15 @@ protected function column_default($item, $column_name)
return !empty($item->$column_name) ? $item->$column_name : '&mdash;';
}

/**
* 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' );
}
/**
* Message to be displayed when there are no items
*
* @since 3.1.0
*/
public function no_items()
{
_e('There are no published posts in this series.', 'organize-series');
}

/**
* The checkbox column
Expand All @@ -192,7 +195,7 @@ public function no_items() {
protected function column_cb($item)
{
$out = sprintf('<input type="checkbox" name="%1$s[]" value="%2$s"/>', 'series_post', (int)$item->ID);

return $out;
}

Expand All @@ -207,40 +210,40 @@ protected function column_title($item)
{
return sprintf(
'<a href="%1$s"><strong><span class="row-title">%2$s</span></strong></a>',
esc_url(
add_query_arg(
[
'post' => $item->ID,
'action' => 'edit',
],
admin_url('post.php')
)
),
esc_html($item->post_title)
);
esc_url(
add_query_arg(
[
'post' => $item->ID,
'action' => 'edit',
],
admin_url('post.php')
)
),
esc_html($item->post_title)
);
}

/**
* Handles the post author column output.
*
*/
protected function column_author($item)
/**
* Handles the post author column output.
*
*/
protected function column_author($item)
{
return get_the_author_meta('display_name', $item->post_author);
}
}

/**
* Handles the post category column output.
*
*/
protected function column_categories($item)
/**
* Handles the post category column output.
*
*/
protected function column_categories($item)
{
$terms = get_the_terms($item->ID, 'category');
$term_html = '';

if ( is_array( $terms ) ) {
if (is_array($terms)) {
$term_links = [];
foreach ( $terms as $t ) {
foreach ($terms as $t) {
$term_links[] = '<a href="'. get_term_link($t->term_id) .'"> ' . esc_html($t->name) . ' </a>';
}
$term_html = implode(', ', $term_links);
Expand All @@ -249,20 +252,20 @@ protected function column_categories($item)
}

return $term_html;
}
}

/**
* Handles the post tags column output.
*
*/
protected function column_tags($item)
/**
* Handles the post tags column output.
*
*/
protected function column_tags($item)
{
$terms = get_the_terms($item->ID, 'post_tag');
$term_html = '';

if ( is_array( $terms ) ) {
if (is_array($terms)) {
$term_links = [];
foreach ( $terms as $t ) {
foreach ($terms as $t) {
$term_links[] = '<a href="'. get_term_link($t->term_id) .'"> ' . esc_html($t->name) . ' </a>';
}
$term_html = implode(', ', $term_links);
Expand All @@ -271,17 +274,18 @@ protected function column_tags($item)
}

return $term_html;
}
}

/**
* Handles the post post_status column output.
*
*/
public function column_post_status( $post ) {
/**
* Handles the post post_status column output.
*
*/
public function column_post_status($post)
{
$post_status = get_post_status_object($post->post_status);

return $post_status->label;
}
return is_object($post_status) ? $post_status->label : $post->post_status;
}

/**
* The part column
Expand All @@ -292,13 +296,13 @@ public function column_post_status( $post ) {
*/
protected function column_part($item)
{
$series_id = isset($_GET['series_ID'])? (int)$_GET['series_ID'] : false;
$series_id = isset($_GET['series_ID']) ? (int)$_GET['series_ID'] : false;
$part_key = apply_filters('orgseries_part_key', SERIES_PART_KEY, $series_id);
$series_part = get_post_meta($item->ID, $part_key, true);

if (empty(trim($series_part))) {
$series_part_output = esc_html__('(Currently has no Part number)', 'organize-series');
}else{
} else {
$series_part_output = $series_part;
}

Expand Down Expand Up @@ -364,16 +368,17 @@ public function prepare_items()
]);
}

/**
* Display the list table.
*
* @access public
* @return void
*/
public function display() {
/**
* Display the list table.
*
* @access public
* @return void
*/
public function display()
{

$this->views();
$this->views();

parent::display();
}
}
parent::display();
}
}
Loading

0 comments on commit 5b50e31

Please sign in to comment.