Modal window from within WordPress admin

Give the anchor a class of thickbox and make sure that the thickbox script is enqueued on your admin page using add_thickbox add_thickbox(); and <a href=”https://wordpress.stackexchange.com/questions/48514/your url” class=”thickbox”>click here</a> You can see what add_thickbox does here: http://hitchhackerguide.com/2011/02/11/add_thickbox/

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

You can use get_current_screen to determine this. $screen = get_current_screen(); if ( $screen->parent_base == ‘edit’ ) { echo ‘edit screen’; } I don’t know if I exactly would say this is always better, it depends on what’s needed, but it’s probably the way I’d do it. The big benefit with this method is that you … Read more

Add a Separator to the Admin Menu?

Here’s a quick and dirty way to get what you want. Background WordPress stores admin menu sections in a global array called $menu. To add a separator you add an element to the $menu array using an index that is between the indexes of the options that you want to separate. Using the add_admin_menu_separator() function … Read more

wp_verify_nonce vs check_admin_referer

I thought that check_admin_referer checked the nonce (it does call wp_verify_nonce, and the referring url. After digging into the core code I realised that it did not do this. Thinking it was a bug I reported it, and Ryan Boren replied with the following: Actually, if the nonce is valid the referrer should not be … Read more

Add custom column to Users admin panel

Ok, Here is the code to allow your users to add phone numbers. Paste this full code in functions.php file. This will add new field on user profile for “Phone Number” and add a column user table on WordPress admin for phone. function new_contact_methods( $contactmethods ) { $contactmethods[‘phone’] = ‘Phone Number’; return $contactmethods; } add_filter( … Read more

What are the standard admin CSS id/class tags?

We’re working on updating http://dotorgstyleguide.wordpress.com/ to have more of this information and reflect the style updates from 3.2. Other than that, I’ve seen a plugin (that I currently cannot locate) that shows a demo page of sorts that displays the various CSS selectors and what they look like, but I believe it was outdated. Other … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)