Custom Wordpress Dashboard for custom user role without a plugin - php

I am creating a page where a certain type of user upon login should only be able to see my plugin dashboard (or a custom php file), without the WordPress dashboard. Is there a way to do this without an extra plugin?
I am currently using Advanced Access Manager as a way of restricting that given user type of accessing anything else in the dashboard.
I would like to get to a similar result if possible hide every Wordpress-like element or style it to my own design. And I would like to achieve it without using an external plugin or editing the functions.php

You can do custom page template, check if user legged in and then present functionality, then users with subscriber role can access the page because they are singed in. do custom login form and after successful login redirect to that custom page.

Related

Navigating links within custom WordPress plugin

I have created a custom WordPress plugin that will display a list of information and i will have the ability to add or edit this information. This seems easy but somehow i am not able to make it work how i would like it to. I have a list of companys and i am showing this list in a table. For each company, i can change its info.
I want to make it so when i click on settings or profile that the page will change and i will pass in the id of the company as a parameter.
I can add a new php page to the href but then that navigates to a new page and i am no longer in the admin dashboard. How can i navigate the url to another page with id without having to leave the dashboard?
When i created a plugin i created submenu pages and when i navigate to these pages... i am executing code all in the same file but different functions with different html which i feel is the way i want when navigating to Settings or Profile for a company.
You can do this by following the below steps:
If you admin/dashboard page URL is something like this: /wp-admin/admin.php?page=list then you need to add extra parameter for settings & profile page like this way: /wp-admin/admin.php?page=list&action=settings&id={id} or /wp-admin/admin.php?page=list&action=profile&id={id}
After that, you need to check if $_GET['action'] is profile or settings, then you need to render the profile page or settings page content respectively instead of list page content. Otherwise, if the action parameter is not set you can render the list page content.
Let me know if you need further assistance.

Customizing wordpress navigation header with woocommerce my account

I am new to wordpress and I was creating a eCommerce website with woocommerce, then I have an idea to make an custom navigation header where when user is not log in it will show login/register and when login it will show to name of the customer.
There are a few ways you can achieve this.
The easiest option is to use any one of the below plugins. Using these plugins, you can show/hide menu items based on their login status. These plugins also allow you to customize the menu based on User roles as well.
https://wordpress.org/plugins/nav-menu-roles/
https://wordpress.org/plugins/user-menus/
Or you can assign a custom class to the menu item and then you can hide/show them using CSS. "logged-in" class is added to the BODY tag when a user is logged in.

Create custom login widget in Wordpress with specified action address

I've created a CRM system in PHP, which of course has it's own user login / admin area. Up until this point, the index page of the top level domain would take you to a login form which I've manually created - simple username, password, forgot password sort of setup. When the user clicks the login button, the information is sent via AJAX, PHP then processes it as necessary, returns a JSON response which tells the page what to do next - i.e. redirect to the admin page.
In short I'd like to replace the index page with an actual Wordpress website, and then have the login form somewhere within the website. I've purchase the BeTheme theme and have activated that inside Wordpress, and it's bundled with Muffin Builder. So far, I can see it's great for building brochure style websites but I can't seem to find anywhere the ability to add custom HTML. Well, if I do add HTML to a page then 'input' tags are automatically stripped.
So, what I'd like to do is have a website built in wordpress, but, somewhere on one of the pages be able to integrate my own login form which has absolutely nothing to do with inbuilt wordpress users. It uses an entirely different database on a different server. Is this possible?
I figured it out a different way. You can add custom HTML (including form elements) using the 'Custom HTML' widget under Appearance->Widgets. Then, in Muffin Builder for a specific page just add 'Sidebar Widget Item' under 'Add Item', and Voila, it drops it in the page according to the usual grid system.
JS functionality can be added using Scripts n Styles plugin.

Translating Wordpress Login Page with WPML

We are building a custom theme with BeaverBuilder for the front end and custom theme for logged in users. We have been able to translate both the beaver builder front end and the custom theme part. We are having a hard time translating the login page and I'm wondering if there is a filter or hook I can use to get the login and forgot password pages translated. I understand there is an ICL_LANGUAGE_CODE variable that is set as the user navigates the site. Can I use it somehow to translate those pages?
You can use login hooks to update the login page with your custom items.

How to get the post title or id from a custom plugin in the admin page

I am using Carrington Build theme and I've created a custom module.
Now, I need to check in which pages these modules are being using and generate a list somewhere else.
To achieve this I am trying to get the current page in which the module has been added from the admin side page. but everytime I open the module admin panel in the page it never returns the existing page with the following wp commands.
I was wondering if anyone could tell me how to get the current page from the admin side?
I've tried get_the_ID(), wp_title(), single_post_title()

Categories