Questions tagged [admin]

Users with the ability to perform administrative tasks for a site or a network of sites.

Filter by
Sorted by
Tagged with
346 votes
108 answers
167k views

Best collection of code for your 'functions.php' file [closed]

As with many others who are now viewing this post, I have been reading various blogs, forums, and discussion groups to learn and improve my WordPress skills. Over the past 12 months I have been on a ...
108 votes
8 answers
77k views

Organizing Code in your WordPress Theme's functions.php File?

The more customization I make to WordPress the more I start thinking about if I should be organizing this file or splitting it up. More specifically, if I have a bunch of custom functions which only ...
NetConstructor.com's user avatar
55 votes
3 answers
83k views

Add filter menu to admin list of posts (of custom type) to filter posts by custom field values

This answer is very close to what I am looking to do, but instead I would like to specify a specific custom field and display a select menu of its available values. Thanks!
adam5280's user avatar
  • 683
55 votes
6 answers
71k views

What are the standard admin CSS id/class tags?

Is there a list of WordPress CSS id/classes that I can use to build plugin option screens that look and feel more like a normal WordPress option page? I have found some through serendipity but it ...
Ole Henrik Skogstrøm's user avatar
52 votes
7 answers
66k views

Creating a table in the admin-style?

What is the recommended way of creating a page with a table, in the style of the tables showing posts or users in the admin area? I am expanding the Cache Images plugin, and it contains a table with ...
Jan Fabry's user avatar
  • 30.3k
51 votes
7 answers
103k views

How to remove admin menu pages inserted by plugins?

I've got the following code, which cleans up a lot of stuff that is not going to be used within the admin area: add_action( 'admin_menu', 'my_remove_menu_pages' ); function my_remove_menu_pages() { ...
tmyie's user avatar
  • 853
44 votes
15 answers
111k views

Admin Ajax is returning 0

I am relatively new to jQuery and AJAX in particular. I have a small issue with the return value always being 0, though I think this is actually the success message and it's not returning anything. I ...
Apina's user avatar
  • 649
41 votes
1 answer
28k views

How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?

Despite the fact I googled a lot, I've not found the answer to a very simple question : I have some posts with a custom field (i.e. supplier_name). I would like to be able to search and filter my ...
jean04's user avatar
  • 411
39 votes
1 answer
76k views

Add custom column to Users admin panel

There is default 5 columns named Username Name Email Role Posts in USERS. Now I want to add one more column with his contact number. How can I achieve this??
Rohil_PHPBeginner's user avatar
32 votes
6 answers
38k views

Changing the Order of Admin Menu Sections?

I am getting a bit frustrated over here after having spent a few hours trying to accomplish this fairly simple task without any luck. Essentially I have 5 custom post types which I created and all I ...
Binarybit's user avatar
  • 423
29 votes
4 answers
26k views

How to determine whether we are in add New page/post/CPT or in edit page/post/CPT in wordpress admin?

This seems like simple thing but I need way to determine whether the current screen is for Add New or Edit ( a sort of wordpress admin conditional tag). Is there a built in function for this already, ...
Dipesh KC's user avatar
  • 924
29 votes
2 answers
13k views

wp_verify_nonce vs check_admin_referer

What is the difference, which one should I use? I know that wp_verify_nonce checks the time limit, and check_admin_referer I think calls wp_verify_nonce as well as checking for an admin url segment, ...
Jeff's user avatar
  • 2,515
27 votes
7 answers
24k views

Add a Separator to the Admin Menu?

Does anyone know how to add an admin menu separator? I found this but it did not help. Any ideas?
user1147's user avatar
  • 802
25 votes
3 answers
48k views

how to know if admin is in edit page or post [duplicate]

I use this after I checked if the user is admin if ( isset($_GET['action']) && $_GET['action'] === 'edit' ) is there better way?
DrMosko's user avatar
  • 791
24 votes
10 answers
32k views

Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?

I just figured out the menu_position parameter it seems like you can place the menu of your custom post type almost everywhere. Except above the Posts menu! How can I accomplish that?
janoChen's user avatar
  • 3,787
23 votes
3 answers
37k views

Load a script just to custom post type in admin

I have created a custom post type "portfolio" with something like this : $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => ...
zac's user avatar
  • 630
22 votes
4 answers
13k views

body_class hook for admin pages

The body_class hook seem only to work with non-admin pages. When I do add_filter('body_class', 'add_body_classes'); function add_body_classes($classes) { $classes[] = 'myclass'; ...
ltfishie's user avatar
  • 755
22 votes
3 answers
53k views

Admin Page Redirect

Is it possible to redirect users to an admin page if they access another admin page? For example if they a user ever hits "all pages" /wp-admin/edit.php?post_type=page they would get redirected to "...
Shae's user avatar
  • 721
21 votes
2 answers
36k views

How to check if user is in back end?

In my application, i have one form. Now if user is in front end i want to display the title but if he is in back end i do not want to display it. I do not want to check it based on user role.
Ajay Patel's user avatar
21 votes
3 answers
15k views

Adding an Arbitrary Link to the Admin Menu?

Is there a way to add a arbitrary hyperlink to the WordPress admin menu (I mean the menu on the left when you log into the admin dashboard)? For example, can one add a link to Google? In my ...
Tom's user avatar
  • 449
21 votes
3 answers
95k views

Where in WP can I check history or log of updates of plugins etc?

I need to find out what happened at a certain time when some of my admins made some plugin updates etc. So I need to check in admin the log of changes, updates etc. Where can I find that in WP admin?
Derfder's user avatar
  • 1,982
20 votes
2 answers
32k views

Modal window from within Wordpress admin

How can get a modal window to work from within the wordpress admin? I want to create a modal window that will work from a meta box within the wp-admin. Any ideas?
Shae's user avatar
  • 721
19 votes
8 answers
12k views

Disable dragging of meta boxes?

Anyone know how to disable this functionality so the meta boxes can't be repositioned?
fxfuture's user avatar
  • 1,317
19 votes
1 answer
42k views

Adding a custom admin page

I want to add a page of content (a readme file) in the WordPress admin, I can't seem to find how to do this in the codex - can anyone point me in the right direction? It will literally just be a ...
user319940's user avatar
18 votes
4 answers
109k views

How does admin-ajax.php work?

We are having some issues with an external developer. We want to limit access to the wp-admin site to internal access only (via VPN). Simply so it will not be attacked by external users. We can ...
nick's user avatar
  • 181
16 votes
3 answers
18k views

How do i know the current post type when on post.php in admin?

Im trying to do something with an admin_init hook if - and only if - the user is editing a post (post.php) with post type "event". My problem is that, even though wordpress points to a global variable ...
Malibur's user avatar
  • 579
16 votes
3 answers
7k views

Remove update nags for non-admins [duplicate]

I'm trying to remove or hide the update nags for non-admin users. As an admin, I see: The popular answer I've seen to handle this says to use: function hide_update_nag() { if ( !current_user_can(...
j08691's user avatar
  • 755
16 votes
7 answers
17k views

Loading External Scripts in Admin but ONLY for a Specific Post Type?

So I continue to run into this issue and I just looking for the best and simplest solution to solve this problem. I have come to make use of custom post types in many different projects and have ...
NetConstructor.com's user avatar
16 votes
2 answers
15k views

Give Editor Access To Sidebar

I want to give the Editor Role access to editing the sidebar and it's contents. I have a text widget in there and in order to edit this text widget the user needs to be an admin - this sucks. How do I ...
Howdy_McGee's user avatar
  • 20.3k
15 votes
1 answer
12k views

Customize Edit Post screen for Custom Post Types?

What's the best way to completely customize the Edit Post admin screen for a specific custom post type? I have customized it to an extent already on creation of the custom post type - adding ...
fxfuture's user avatar
  • 1,317
14 votes
4 answers
43k views

How do I get the current edit page ID in the admin?

Most solutions I found are for front-end use. This is for a plugin, so the all activity is in the back-end. How do I get the page ID that's being currently use(edited) in the admin? Note I'm out of ...
Daniel's user avatar
  • 1,176
14 votes
5 answers
20k views

How to remove entire admin menu?

I need to customize the admin panel for my user. So how do I remove the entire admin menu? Not remove the menu item, I mean entirely remove the left vertical menu bar, include the design of the menu (...
dev-jim's user avatar
  • 1,898
13 votes
4 answers
22k views

How do I remove dashboard access from specific user roles?

I'd like to prevent certain user roles from accessing the dashboard http://www.openeye.net/wp-admin/ at all. I've moved and restyled user profiles to a new page that's viewable on the site. How would ...
Zach Shallbetter's user avatar
13 votes
5 answers
33k views

Filter by custom field in custom post type on admin page

I've used Advanced Custom Fields to create custom fields for Competition name, answers etc. I've made a custom post type for competitions as shown on the image and I used Wordpress functions.php to ...
grAND's user avatar
  • 133
13 votes
1 answer
35k views

Create tabs inside Plugins Admin Page [closed]

I am developing my own plugin and I am trying to figure out how to add tabs to my admin page. Is the process similar to how we add meta boxes? Ie, something like add_tab_box(...); and I specify a ...
sazr's user avatar
  • 347
13 votes
5 answers
7k views

Admin: very slow edit page caused by core meta query

We've been noticing really long load times when going to edit a post or page. Using Query Monitor, we found that this WP core query is taking upwards to 15-20s. SELECT meta_key FROM wp_postmeta ...
psorensen's user avatar
  • 487
12 votes
2 answers
38k views

if admin is logged in

We know, that is_admin() checks if current URL belongs to DASHBOARD (BUT it doenst check whether user is ADMIN). So, I use this function to detect if administrator is logged in wordpress: function ...
T.Todua's user avatar
  • 5,629
12 votes
2 answers
26k views

How to remove a column from the Posts page

In a previous question I asked how to add a column to the Posts page in the Administration section, and got a working answer. But now I need to know how to delete an existing column (e.g. the Date ...
Justin Long's user avatar
12 votes
8 answers
134k views

Disable SSL / HTTPS for wordpress

I've installed WordPress and setup the database. I go to the address and the setup page is there, but no CSS. I think: something's wrong, but if I just do the setup maybe everything will just go back ...
cCe.jbc's user avatar
  • 121
12 votes
3 answers
19k views

How can I speed up my WP admin section?

We have many WP sites with a proxy in between the servers that they sit on and the internet. Some things in WP simply don't work: RSS feeds on dashboard looking up themes looking up plugins core ...
STing's user avatar
  • 581
12 votes
2 answers
7k views

How to pass parameters to admin_notices?

So there is the following case. I need to display a name inside of admin_notices. class MyPlugin_Admin { public static function render_admin_notice() { echo $name . ' has been upgraded.';...
Aley's user avatar
  • 351
12 votes
1 answer
5k views

Search posts by ID in admin

I'm looking for a way to search through posts by ID, preferably with support for custom post types. I was hoping there'd be a plugin enabling this functionality, but I've failed to find anything. Any ...
pereyra's user avatar
  • 465
12 votes
1 answer
3k views

Changing the "Plugin Activated" Message Default

Whenever an administrator in WordPress activates a plugin, upon the reload of the plugin page, a notice will appear upon successful activation reporting "Plugin Activated". Is there a way to change ...
gate_engineer's user avatar
11 votes
1 answer
27k views

Sort pages in loop by admin's page attributes order field?

Is it possible to sort pages in the loop using the admin's order field (under page attributes)?
Ryan's user avatar
  • 515
11 votes
3 answers
21k views

Wordpress admin stylesheet

Is there a way to override the styles in the admin in my theme? I don't want to touch the admin style sheet if I don't have to. I just want to make a column bigger in my admin, but also, to do it in ...
redconservatory's user avatar
11 votes
3 answers
8k views

Hide other users' posts in admin panel

I intended to run a multi-author site, I don't want the posts from other authors to be shown in /wp-admin/edit.php page. I managed solve this problem by the codes from this thread. The code is like ...
dev-jim's user avatar
  • 1,898
11 votes
2 answers
4k views

Set Default Admin Colour For All Users

I am surprised with the new colour scheme for 3.8 and although the classic 3.7 theme has gone, I would like to set the new "Light" colour scheme as the default for all users, but at the same time, ...
SolaceBeforeDawn's user avatar
11 votes
2 answers
12k views

How to Add a Third Level Sub Menu to the Wordpress Admin Menu

Is there a function, action or filter that I can use to add a third level drop-down menu to the WordPress admin menu. For instance, right now in the sidebar menu, there is a menu for posts and under ...
Moshe's user avatar
  • 225
11 votes
6 answers
23k views

How to use more than 256MB of memory in the admin?

I'm building a site for a photographer who uploads pictures that are normally large for todays digital cameras. Images are quite memory intensive, especially the image operations like creating ...
hakre's user avatar
  • 12.8k
11 votes
1 answer
11k views

How to Change the Default Home Page for the WordPress Dashboard?

Is it possible to change the Default "Home" admin page when logging into the WordPress Dashboard? I thought about a couple of possibilities... Substitute the content on the Dashboard home page with ...
Michael Ecklund's user avatar

1
2 3 4 5
35