Support » Plugin: Permalink Manager Lite » search or filter or sort by Current URI in Admin

  • Resolved kortex1969

    (@kortex1969)


    Hello,

    in the WordPress admin list of Pages (/edit.php?post_type=page)

    I have the column : “Current URI”.

    However, when I do a search, example “example-page-home.php”

    I would like the search to find and put first the page that has as “Current URI”:
    “example-page-home.php”

    Or add a filter on “Current URI”.
    Or sort by “Current URI”.

    Thanks for the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @kortex1969,

    Thank you for your suggestion. I will add this feature to the next version of plugin.

    Best regards,
    Maciej

    Thread Starter kortex1969

    (@kortex1969)

    Maciej,

    That would be nice 😉

    Otherwise, I did this, but it does not work, am I far from the solution

    function my_set_sortable_columns($columns)
    {
        $columns['permalink-manager-col'] = 'permalink-manager-col';
        return $columns;
    }
    add_filter('manage_edit-page_sortable_columns', 'my_set_sortable_columns');
    
    function permalink_manager_col_orderby($query)
    {
        if (! is_admin()) {
            return;
        }
     
        $orderby = $query->get('orderby');
        if ('permalink-manager-col' == $orderby) {
            $query->set('meta_key', 'custom_permalink');
            $query->set('orderby', 'meta_value');
        }
    }
    add_action('pre_get_posts', 'permalink_manager_col_orderby');

    thx

    Plugin Author Maciej Bis

    (@mbis)

    Hi @kortex1969,

    The custom permalinks are not stored in “post_meta” table and that is the reason why your code does not work 😉 The biggest problem here is that all the custom permalinks are stored in a single serialized array. Unfortunately, there is no way to directly sort the posts in MySQL by the IDs extracted from the permalinks array.

    However, it would be possible to search by “Current URI” field. I will add this feature to the next version of plugin. In fact, this functionality is already implemented in bulk “URI Editor” (Tools -> Permalink Manager -> URI Editor).

    Best regards,
    Maciej

    Thread Starter kortex1969

    (@kortex1969)

    Thx @mbis !

    I hope you will maintain it well and make it evolve, because it is very practical your plugin! Nice work !

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.