Developing a wordpress plugin I have problems to setup a custom edit page to handle my items in the admin area. I have been taking a look what is the workflow in case of posts and as I see all edit actions are redirected from edit.php to post.php?post=33&action=edit. I have been setting up an option page and I handle from here all items edits but in this case shows the menu in the sidebar what is not optimal for the user, because if no item id is passed to it can cause a lot problems. I have to mention, developing Wordpress plugins is something new for me and maybe the researches what I made are not proper. I have been taking a look in wordpress API and I found the following function
add_management_page().
but this needs to be ordered under the admin menu
adding the following function and linking my items edit like
admin.php?page=parser-target-edit&record=73
add_submenu_page( 'parser-top-level-handle', 'Edit', 'Sub-menu title', 'manage_options', 'parser-target-edit', array($this , 'edit_item') );
is working but as I said is showing up in the sidebar as menu item. So it has to be another workaround what it can be used in case of edit action
You can try add_menu_page() which can be coupled to add_submenu_page() to create administration pages
You can execute a callback function that gets executed from add_menu_page().
Related
My wordpress site has a portfolio page by itself, and the link is www.example.com/portfolio. I tried to find the specific page (with this url), but i couldn't find. So my purpose is to create a portfolio page, on my wordpress site and have the specific url "www.example.com/portfolio".
That where i did, to create a portfolio page, was to create a page and change the slug to "www.example.com/portfolio", but when i hit this url, show me the portfolio page, that has the site by itself and not my page.
So my question is, can i change the name of the existing url "/portfolio" and if yes, how (can i change it from my wordpress files), to appear the page i created and not existing page has the site by itself?
Thank you in advance!
Your WordPress page slugs aren't configured from within the codebase; instead if you go to the relevant page whilst in the admin dashboard, on the right hand side will be some config options - here is where you're able to change the slug.
How to change your slugs using permalinks WordPress Docs
It means you have a custom post type "portfolio". You need to unregister it. Put this code in the functions.php file of your active theme and then create a new page with a "portfolio" name(title).
if( !function_exists( 'cus_unregister_post_type' ) ) {
function cus_unregister_post_type(){
unregister_post_type( 'portfolio' );
}
}
add_action('init','cus_unregister_post_type');
Amin panel, go to pages... search for the page portfolio... there is no physical presence like portfolio.php... hope this helps
You just use this plugin and this plugin will help you.
Plugin: https://wordpress.org/plugins/custom-permalinks/
I chose Wordpress for my last project but I have a question. I'll use Pages so the client is able to change the content himself. For the moment there are no Post or blog in it. Is it possible to run Wordpess without a blog? It'll be a blog in a future but not now. Thanks.
Absolutely you can have a WordPress site without a blog. You just need to do a couple of things in the admin.
First you need to create 2 pages: a static 'home' page, and a 'blog index' page. The home page is what will be displayed when a visitor comes to the site. The blog index page is just a blank page, with a title you can remember.
Next, in Settings > Reading, select Front page displays a 'static page', then set 'Front page:' to the home page you made, and 'Posts page:' to the blog index page you made.
Yes, for sure you can do this.
Just do the following:
In your admin backend click on Settings -> Reading and set "A Static Page"
Go to Appearance and build a custom menu and add there your pages to a active menu.
Disable all widgets which link to posts.
In fact you need only the first step, but with the second you allow users to navigate on your site. To make the UX better, just add a plugin like Map Categories to Pages to add a category widget or something in this way, to let people browse your site more nicely.
I want to make a public blog, Where user can write from the frontend after login.
Basically in wordpress, after login, Users being redirect to wp-admin, the Dashboard. And there they have the 'new post' functionality. But i want to keep that away from my bloggers. They will login from the custom login panel in the sidebar and they will have a new post link there, which will take them to www.domainname.com/new-post or something like that. There they will have the full functionality of wordpress content editor. Upload, Main text-area with Editor, Tag and Category. All of them in the frontend so that i don't have to show them the wp-admin section.
is there any way to make this happen?
It looks like that what you describes can be easily done with this plug-in:
http://wordpress.org/extend/plugins/wp-user-frontend/
I am creating simple plugin, and I prepared few pages: add.php, edit.php, delete.php and list.php. I've used add_menu_page and add_submenu_page - so I understand why they are visible in admin menu. How to create page (or custom URL with parameter) without putting this into menu? I'd like to add link to edit page and delete url (code executed by plugin) on listing page - something like in posts listing page but can't find function to achieve this.
Here are two possible solutions for this questions:
How do you add a WordPress admin page without adding it to the menu?
Personally i havent tried it but it like the one where you remove the item from the menu after you set things up like normal.
There is also a great plugin called the WP Router that can help you setup totally unique urls with the callback you desire.
I am writing a new plugin, registered a new admin menu page, and added a few submenu pages. One of the pages has a doctors list, and each doctor is picked up from the database.
I want to have an "edit" link near each doctor. The link has to take the client to an edit page. How do I register this page without showing as submenu page?
Ok, I have found a solution. You have to create two submenu pages one under another, secound page will not be showed in admin panel.
Goes like this:
add_submenu_page( 'dev7d-father','Daktarai','Daktarai', 'manage_options' , 'dev7d-sub-doctors', 'doctors_options');
add_submenu_page( 'dev7d-sub-doctors','Daktarų redagavimas','Daktarų redagavimas', 'manage_options' , 'dev7d-sub-doctors-edit', 'doctors_edit');