• Hi,

    I wonder if any of the community can help me.

    I have created a plugin which has basic functionality through the shortcode. But I am creating an plugin options page which utilises the

    admin.php?page={plugin-name}

    . I want to be able to click on “Add New” and it takes me to a custom page which I can add new items to the DB, but I want to add it to a custom table

    wp_{plugin-name}

    where the value field has data stored similar to:

    a:1:{s:2:"cat_name";s:3:"Plugins";s:8:"cat_slug";s:32:"plugins";}

    I would also like to be able to click on edit and it redirects me to the edit page and outputs the data by id. Also I would like to be able to click delete and it deletes the row by id.

    Is there any functions or script I can use the achieve this and retrieve the to be able to use on the main plugins options page and frontend.

    Many Thanks
    Stephen

Viewing 1 replies (of 1 total)
  • Thread Starter sasherwood93

    (@sasherwood93)

    Let me improve upon this.

    I would like to use a custom page similar to the edit-tags.php but the part where you update a category. I want the update button to be able redirect to the main plugin page or referred page which would be “admin.php?page=plugin” but only if the url has a “&update-settings=1” to the end of it.

    If I am adding a new category I want the same page as described but it will have a url string of “&new-cateogry=1” and then it redirects to a page with adds custom posts which I would like to have a custom page for as well.

    Please note I don’t want to use the default WordPress pages just custom pages using custom url’s such as the layerslider plugin and RevSlider plugins do.

    Example:

    admin.php?page=myfirstplugin
    
    admin.php?page=myfirstplugin&action=edit&cat_id=1
    
    admin.php?page=myfirstplugin&action=edit&cat_id=1&post_id=4

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘[Custom Plugin] Add, update, delete database data’ is closed to new replies.