Articles of wp admin

Change users.php WP_User_Query

A client has requested to have two kinds of custom user roles, and have those users displayed in an Admin Menu Page of its own. So far, I’ve achieved that using WP_List_Table with success. Now, the next request is to not display those users with those custom roles in users.php. So far, I haven’t been […]

Add custom content in user-edit.php page

When I go to edit a user’s account located in: http://web.site/wp-admin/user-edit.php?user_id=ID I want to add a custom section with my own information (just text), similar to the add_settings_section() function. However, I believe this is limited to only adding custom sections to the Settings menu: Settings — General — Reading — Media — Permalinks This is […]

How do I edit the WordPress post.php file?

I have a Custom Post Type which contain a Gravity Form on my website. I would like to display a message on the back end of the Post when logged in as admin. The message will say when the form has reached its entry submission limit. The file that displays the post content in the […]

Is there a better way of handling AJAX requests in WordPress?

I’m currently building a pretty straightforward plugin, but it relies quite extensively on AJAX requests. I’m using the standard admin-ajax endpoint for the requests, but I find that it seems to be massively inconsistent, sometimes the request (for the same data) will take a few hundred milliseconds and then sometimes take a couple of seconds. […]

“Add New” button on custom post type grid

I’ve created a custom page in my wp-admin panel to show my custom model in a grid. It extends wp_list_table, and the grid works great with sorting and pagination. I’m having trouble adding an “Add New” button above the grid, however. I’ve added the button: <a href=”admin.php?page=certificates&amp;action=new” class=”add-new-h2″>Add New</a> And it takes me to the […]

Can I limit term selection to one plus parent?

So i have a custom post type (listings) and a custom taxonomy (listing_terms). The taxonomy has parent/child terms. Eg: Restaurant -> Cafe (where Cafe is the child of Restaurant). I want to only let my users to be able to select one child term and then have the parent term automatically selected when they’re creating […]

How to add custom CSS and JavaScript file for wp- admin dashboard (backend)

I want to add some CSS and JavaScript to the WordPress dashboard but only for my custom post type design and some script functionality. Can any one suggest to me about how to include my custom CSS and JavaScript files for backend users?

Redirect an entire WordPress site on a subdomain, except wp-admin

With .htaccess I’m trying to redirect all traffic away from a WordPress site, except traffic to wp-admin. The goal is to redirect all traffic away from the site, but retain admin access. I’m using .htaccess to do this, and it’s working to an extent. But when trying to access wp-admin I get an internal server […]

Is there alternative to WP_List_Table?

I need to create html tables in a admin pages. It should be responsive. After a research I find the WP_List_Table. But in codex page, This class’s access is marked as private. That means it is not intended for use by plugin and theme developers as it is subject to change without warning in any […]

Redirect Plugins.php to New Plugin Page

I have a multisite install and need to redirect the default plugin page to another admin page that will handle plugins. For example, if they request /wp-admin/plugins.php, then it should redirect them to /wp-admin/admin.php?page=pretty-plugins.php if they are not a network admin. The code below is what I have come up with so far, but I […]