WordPress.org

Ready to get started?Download WordPress

Forums

Custom List Table Example
You do not have sufficient permissions to access this page. (3 posts)

  1. michalskiluc
    Member
    Posted 2 years ago #

    Hi guys,

    Hope you are all well!

    I have installed this module for a custom MySQL table, that I have created in my wordpress database and that I d like to administrate from the WordPress back end.

    The list is displayed well, all sorting functions are working properly.

    But each time I try to delete or bulk delete it shows the screen :
    You do not have sufficient permissions to access this page.

    I tried to create a search box for filtering the list and get each time the same message.

    How do you grant delete privilegies to custom tables with this plugin ?

    It is the last point for making this plugin wonderful.

    Cheers
    Luc

    http://wordpress.org/extend/plugins/custom-list-table-example/

  2. wrenchpilot
    Member
    Posted 1 year ago #

    I'm in the same spot right now. I'll follow up if I make any progress.

  3. wrenchpilot
    Member
    Posted 1 year ago #

    What was causing my problem is that I created a custom post type and the post type has to be passed to the action or it doesn't know what context your in.

    For example:

    function column_title($item) {
    
            //Build row actions
            $actions = array(
                'edit' => sprintf('<a href="?page=%s&action=%s&movie=%s">Edit</a>', $_REQUEST['page'], 'edit', $item['ID']),
                'delete' => sprintf('<a href="?page=%s&action=%s&movie=%s">Delete</a>', $_REQUEST['page'], 'delete', $item['ID']),
            );
    
            //Return the title contents
            return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
                            /* $1%s */ $item['title'],
                            /* $2%s */ $item['ID'],
                            /* $3%s */ $this->row_actions($actions)
            );
        }

    Should be:

    function column_title($item) {
    
            //Build row actions
            $actions = array(
                'edit' => sprintf('<a href="?post_type=%s&page=%s&action=%s&movie=%s">Edit</a>', $_REQUEST['post_type'], $_REQUEST['page'], 'edit', $item['ID']),
                'delete' => sprintf('<a href="?post_type=%s&page=%s&action=%s&movie=%s">Delete</a>', $_REQUEST['post_type'], $_REQUEST['page'], 'delete', $item['ID']),
            );
    
            //Return the title contents
            return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
                            /* $1%s */ $item['title'],
                            /* $2%s */ $item['ID'],
                            /* $3%s */ $this->row_actions($actions)
            );
        }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.