Git Product home page Git Product logo

reorder-posts-within-categories's People

Contributors

3s777 avatar aurovrata avatar datacore-web avatar pondermatic avatar robrecord avatar tobifjellner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

reorder-posts-within-categories's Issues

Drag and Drop not working for custom post types

Good morning!

I have a client who is a photography agent and we've been loving your plug-in for it's ease of use, however since the latest update we've found that the drag and drop interface isn't working.

I've had a look through the logs and it's showing the following error:

WordPress database error Unknown column 'undefined' in 'field list' for query REPLACE INTO wp_***********_postmeta VALUES (30297, 3646, '_rpwc2', 32),(30298, 3648, '_rpwc2', 32),(30299, 3647, '_rpwc2', 32),(30300, 3645, '_rpwc2', 32),(30301, 3644, '_rpwc2', 32),(30302, 3643, '_rpwc2', 32),(30303, 3642, '_rpwc2', 32),(30304, 3641, '_rpwc2', 32),(30305, 3640, '_rpwc2', 32),(30306, 3639, '_rpwc2', 32),(30307, 3638, '_rpwc2', 32),(30308, 3637, '_rpwc2', 32),(30309, 3636, '_rpwc2', 32),(30310, 3635, '_rpwc2', 32),(30311, 3634, '_rpwc2', 32),(30312, 3633, '_rpwc2', 32),(30313, 3632, '_rpwc2', 32),(30314, 3631, '_rpwc2', 32),(30315, 3327, '_rpwc2', 32),(30316, 588, '_rpwc2', 32),(30317, undefined, '_rpwc2', 32),(30318, undefined, '_rpwc2', 32) made by do_action('wp_ajax_user_ordering'), WP_Hook->do_action, WP_Hook->apply_filters, Reorder_Post_Within_Categories_Admin->save_order, Reorder_Post_Within_Categories_Admin->_save_order

Do you have any hints for me?

Thanks again,

Paul

Conflict with Edit Flow's custom status module

Hi.
I ran into the same problems people have been complaining about in this plugin's support area at wp.org and saw your patch, which I installed. It partially fixes things(no more French), but the plugin still fails to list entries once a category was selected.

I was able to track this down to the Custom Status module of Edit Flow, which I use. Disabling just that, not even the entire Edit Flow collection, restores expected functionality.

Given the module provides post statuses, it might initially seem that this has nothing to do with you, but the thing is that upon arriving at the sorting page, this JS error is thrown:

Error: ReferenceError: current_user_can_publish_posts is not defined
Source File: […]/wp-content/plugins/edit-flow/modules/custom-status/lib/custom-status.js?ver=0.8

Given that what you were doing with this patch was modifying who's allowed to make use of the plugin, it seems like there's at least some chance the problem is coming from your end of things and you might want to have a look.

I tried a quick scan to see if I could identify the problem more specifically but your edits were more extensive than I expected and I have a deadline coming up for a client at the moment. I might give it another try over the weekend.

"Grid of Posts, classified as" Range Control Moves Both Range Limits at Once

Browser: Safari Version 13.0.2 (15608.2.30.1.1)

Steps to Reproduce:

  1. Under the "Posts" menu go to Reorder plugin's section. (/wp-admin/edit.php?page=re-orderPost-post)
  2. Select a category to reorder.
  3. The category selected in this case has a few hundred post records. In this case, we're looking for a recently written post that's going to show up at the end of the list.
  4. When one attempts to drag the user interface control on the right side of the range definition, the left boundary control removes as well.
    1. The expectation is that one would be able to move each of these range limitations independently
    2. If the intention is for the left boundary to move, should it move at the same rate as the right boundary control?
  5. There is a workaround for this issue that one can use the input above to type in a number for the number of posts to display on the reordering screen. The only issue with this is that the user may not know how many posts they have in the category, making the draggable UI limitation a better option.

Screenshots of behavior:

Original Position:

Screen Shot 2019-10-29 at 10 13 35 PM

Dragging the upper limit to the right:

Screen Shot 2019-10-29 at 10 13 49 PM

Dragging the upper limit further to the right.

Screen Shot 2019-10-29 at 10 14 01 PM

Issue using ReOrder Post within Categories

Hi,

We are having an issue with the ReOrder plugin where from time to time the content producer creates a post, assigns the post to a category and the new post does not appears in the page. When we go to the “Plugin Dashboard” and select the category to reorder. We have the Use the manual sorting for this category? Yes and Override ‘orderby’ query attribute. But the new post does not show up, until the content producer clicks on the Reset Order.

We have between 3000 to 10000 posts in each category. It is happening the categories with the upper and lower limit.

We are using V2.12.5

Filter function get_thumbnail_url

Hello there, thank you for the wonderful plugin.

So this is not an issue, rather a suggestion for the next release. We use acf to our posts, not the default wp attachment image. It would be nice to add a filter in function get_thumbnail_url (file class-reorder-post-within-categories-admin.php) to return the url of a custom field image.

Thank you for your consideration.

In some case all the posts for a category in the "reorder_post_rel" are deleted

Hello,

First of all, thank you for this plugin!

I reorder posts within a category where posts are often deleted or reassigned to other categories.

I don't know exactly why, but in some case all the posts for a given category in the reorder_post_rel table are deleted. As a consequence, the database query returns no posts. I was not able to determine where the bug is.

To fix this bug, I had to check in the posts_join, posts_where and posts_orderby filters, if the reorder_post_rel table, for the given category ID, contains entries. If yes, we can safely alter the wp_query object.

/**
 * Make sure that the reorder table is not empty for this given category!
 * It there is not entry, we do not want to alter the WP Query (it will returns no posts in the loop).
 *
 * @param int $idCategory The category ID
 * @return bool
 */
private function isPostsOrderedInCategory($idCategory)
{
    global $wpdb;

    $table_name = $wpdb->prefix . $this->deefuse_ReOrder_tableName;

    $nbPosts = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $table_name WHERE category_id=%d", $idCategory));

    return ($nbPosts > 0);
}


public function reOrder_query_join($args, $wp_query)
{
    // ...

    $userOrderOptionSetting = $this->getOrderedCategoriesOptions();
    if (!empty($userOrderOptionSetting[$theID]) && $userOrderOptionSetting[$theID] == "true" && $this->stop_join == false) {
        if ($this->isPostsOrderedInCategory($theID)) {
            $args .= " INNER JOIN $table_name ON " . $wpdb->posts . ".ID = " . $table_name . ".post_id and incl = 1  ";
            //echo $args;
        }
    }

    return $args;
}

public function reOrder_query_where($args, $wp_query)
{
    // ...

    $userOrderOptionSetting = $this->getOrderedCategoriesOptions();
    if (!empty($userOrderOptionSetting[$theID]) && $userOrderOptionSetting[$theID] == "true" && $this->stop_join == false) {
        if ($this->isPostsOrderedInCategory($theID)) {
            //$args .= " INNER JOIN $table_name ON ".$wpdb->posts.".ID = ".$table_name.".post_id and incl = 1  ";
            $args .= " AND $table_name" . ".category_id = '" . $theID . "'";
            //echo $args;
        }
    }

    return $args;
}

public function reOrder_query_orderby($args, $wp_query)
{
    // ...

    $userOrderOptionSetting = $this->getOrderedCategoriesOptions();
    if (!empty($userOrderOptionSetting[$theID]) && $userOrderOptionSetting[$theID] == "true" && $this->stop_join == false) {
        if ($this->isPostsOrderedInCategory($theID)) {
            $args = $table_name . ".id ASC";
        }
    }

    return $args;
}

I hope it helps!

Guillaume

How to adjust admin UI?

Hi guys! I want to have sorting admin looks like below:

screenshot-1

How would I implement it? I checked code, but I don't know how to setup JS to show vertical list instead of horizontal. Any advices?

Thank you in advance!

Drag & Drop grid is randomized each reload

Hey there,

We are using your plugin on a site (without any issues until now) and after the last update, whenever I rearrange post under a category, leave the reorder page and come back, all the posts are in an entirely different sort order and the frontend output never matches the backend.

I tried using the 'reset the order' function thinking maybe it was a database issue, but that didn't help.

I also saw in the readme text that suppress_filters needed to be false, so I added that to my query string as well and no luck.

I checked error logs and am not getting any notices or errors regarding the plugin either.

Any other ideas that I should check?

Action get_more_posts returning empty values

I dont know if that error is because i use WPML but $this->_get_order returned with duplicated IDs and Admin Ajax action "get_more_posts" was returning empty values so i fixed the function and works fine now.

https://github.com/aurovrata/ReOrder-posts-within-categories/blob/master/admin/class-reorder-post-within-categories-admin.php

	private function _get_ranked_posts($post_type, $term_id, $start, $offset){
		$results = array();
		$ranking = $this->_get_order($post_type, $term_id, $start, $offset);
    $posts = get_posts(array(
			'post_status'=>'any',
      'post_type' => $post_type,
      'post__in'=>$ranking,
      'ignore_sticky_posts'=>false,
      'posts_per_page'=>-1
    ));
    foreach($posts as $post) {
			$img = self::get_thumbnail_url($post);
			$rank = array_search($post->ID, $ranking);
      $results[(int)$rank]=array(
				'id'=>$post->ID,
        'link'=>admin_url('post.php?post='.$post->ID.'&action=edit'),
        'img'=> $img,
				'status'=>$post->post_status,
        'title'=>apply_filters('reorder_posts_within_category_card_text',get_the_title($post), $post, $term_id)
      );
    }

		ksort($results);
		return $results;
	}

Not authorized to access page

Hi there, I just installed the plugin, but when I try to go to the settings page to configure the plugin, I receive an error telling me that I'm not authorized to view the page
the URL is:
/wp-admin/options-general.php?page=reorder-posts-within-categories.php

Ghost posts in dashboard.

I am facing the following problems with the plugin:

1 There are many thumbnails that don't have any post attached with them when I click on them either there is no link attached or I see an error 403
image

2 Some posts have been titled as undefined
image

3 If a post is categorized in 2 different categories it is not visible in both the categories

4 when a category has large number of posts and I wish to view the entire post range and then reorder them together. Here the plugin doesn't work properly. The reordered posts are not visible in the frontend

Please help me I don't want to switch to other plugin

my email id is [email protected]

Not ordering posts

Hi, I'm using the latest version of this plugin, but it doesn't seem to be working, I drag and drop posts in the order I'd like, visit the front end and nothing changes.

When I go back to the drag and drop page it refreshes and resets the order. I can't work out what is happening.

I get the following error:

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNIQUE rpwc_pm.post_id FROM 41_postmeta as rpwc_pm, 41_posts as rpwc_p ...' at line 1]
SELECT UNIQUE rpwc_pm.post_id FROM 41_postmeta as rpwc_pm, 41_posts as rpwc_p WHERE rpwc_pm.meta_key ='_rpwc2' AND rpwc_pm.meta_value=15 AND rpwc_pm.post_id=rpwc_p.ID AND rpwc_p.post_type='portfolio' ORDER BY rpwc_pm.meta_id

When this plugin is activated, my Divi filterable portfolio doesn´t work

Hi. This is an awesome plugin to show the filterable portfolio using Project Type Post. This is exactly what I need to reorder project portfolios, because currently my portfolio shows the posts order By date and I can not find any way to change it by "Alphabetical order". Therefore, when I activate this plugin, I have the ability to order my posts by alphabet order, within the category (EXCELLENT!), But, in the front-end, the Portfolio does not show any project. My Theme is Divi, and my filterable portfolio should be displayed in: (ReOrder-posts-within-categories deactivated, of course).
http://sociedadvenezolanacirugiaplastica.org/zona-de-miembros/directorio-por-apellidos/

When I activate the plugin, the Filterable Portfolio only shows categories A, B, C, D, E ... squares, but none of theme displays de respective category.

Thank you in advance, I apreciate your work!

Regards,

María Cemborain
captura de pantalla 2018-08-04 a las 3 50 48 a m
captura de pantalla 2018-08-04 a las 3 52 18 a m

reorder in admin page, fails to reorder on front end

installed on WP 5.3 some days ago. Succeeded in reordering one category displaying as expected on custom category page. Attempted on another category and failed. Numerous attempts, deleted plugin, and reinstalled from the page at https://wordpress.org/plugins/reorder-post-within-categories/ (v.2.4.0) still no joy.

error displayed in dashboard:

WordPress database error: [Table 'neolog_wcoulter_.wp_reorder_post_rel' doesn't exist]
SELECT rpwc.post_id FROM wp_reorder_post_rel as rpwc LEFT JOIN wp_posts as wp on wp.ID = rpwc.post_id WHERE rpwc.category_id = 14 AND wp.post_type='post' order by rpwc.id

errors in debug.log:

[02-Dec-2019 17:51:14 UTC] WordPress database error Table 'neolog_wcoulter_.wp_reorder_post_rel' doesn't exist for query SELECT rpwc.post_id
				FROM wp_reorder_post_rel as rpwc
				LEFT JOIN wp_posts as wp on wp.ID = rpwc.post_id
				WHERE rpwc.category_id = 19 AND wp.post_type='post' order by rpwc.id made by require_once('wp-admin/admin.php'), do_action('posts_page_re-orderPost-post'), WP_Hook->do_action, WP_Hook->apply_filters, Reorder_Post_Within_Categories_Admin->print_order_page, Reorder_Post_Within_Categories_Admin->_get_order
[02-Dec-2019 18:03:59 UTC] WordPress database error Table 'neolog_wcoulter_.wp_reorder_post_rel' doesn't exist for query SELECT rpwc.post_id
				FROM wp_reorder_post_rel as rpwc
				LEFT JOIN wp_posts as wp on wp.ID = rpwc.post_id
				WHERE rpwc.category_id = 14 AND wp.post_type='post' order by rpwc.id made by require_once('wp-admin/admin.php'), do_action('posts_page_re-orderPost-post'), WP_Hook->do_action, WP_Hook->apply_filters, Reorder_Post_Within_Categories_Admin->print_order_page, Reorder_Post_Within_Categories_Admin->_get_order

Any ideas?

Re order not pulling through courses with Lifterlms

Hi, I use re-order with lifterlms tracks and the re-order is great to ensure courses are in the right order. It was working fine but now is no longer pulling through one of the courses for a track.
Please can you advise?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.