All Questions
454 questions
49
votes
2
answers
25k
views
Create more Meta Boxes as needed
I'd like users to be able to create and remove additional meta box fields as needed.
For example, say a music podcast with a variable amount of songs played per episode.
The user should be able to ...
139
votes
17
answers
107k
views
Adding a Taxonomy Filter to Admin List for a Custom Post Type?
I have created a Custom Post Type called 'listing' and added a Custom Taxonomy called 'businesses'. I would like to add a dropdown list of Businesses to the admin list for the Listings.
Here is what ...
104
votes
8
answers
283k
views
How to check if a user is in a specific role?
I have a pretty specific requirement to show different text in a field label on the user profile page based on the current user's role. I can't seem to figure out how to check whether the current use ...
51
votes
14
answers
81k
views
meta_query with meta values as serialize arrays
I'm working on a project in which I'm creating a custom post type and custom data entered via meta boxes associated with my custom post type. For whatever reason I decided to code the meta boxes in ...
77
votes
13
answers
85k
views
Can I rename the wp-admin folder?
Is it possible to rename the wp-admin folder?
I know I could just rename it, but unless it's supported by the code lots of things would break.
If I use a custom folder name, it will make it slightly ...
24
votes
7
answers
20k
views
Change the text on the Publish button
Is there a way to change the text of the publish button on a custom post type to say some different? For example, Save instead of Publish. And also remove the draft button?
8
votes
1
answer
15k
views
Export data as CSV in back end with proper HTTP headers
I wrote a plugin that displays all products in a woocommerce store in admin settings option, now I want to add a link to download the products as CSV file.
The problem is, when I click the link I get ...
67
votes
2
answers
114k
views
How can I add an image upload field directly to a custom write panel?
I've added a new page under "Pages" in the wordpress admin, and added several custom fields. I'd also like to be able to add an upload image field to the page editor - is there some way to do this via ...
27
votes
4
answers
37k
views
How to set default screen options?
I'd love to be able to hide meta boxes using screen options, instead of removing them or restricting them to user roles, the goal is to just "uncheck" the meta box for the user.
I see how this would ...
21
votes
2
answers
63k
views
Add "upload media" button in meta box field
I have a custom post which has a meta tag that needs to be using a file upload (for video files). I am wondering, what is the correct way of adding an "Upload" button that points to the WordPress ...
18
votes
2
answers
7k
views
Toggle admin metabox based upon chosen page template
I'd like to have a custom field interface show up only when a certain template is assigned to a particular WordPress page.
Any ideas?
72
votes
9
answers
76k
views
How do I Enqueue styles/scripts on Certain /wp-admin Pages?
I have two simple functions that load stuff using wp_enqueue_style() and wp_enqueue_script(), something like these:
function admin_custom_css()
{ wp_enqueue_style( 'stylesheet_name', 'stylesheet.css')...
53
votes
7
answers
108k
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() {
...
23
votes
1
answer
43k
views
Order by multiple meta key and meta value [closed]
How can I set multiple meta keys order by meta value, can any one give me some example?
15
votes
2
answers
13k
views
do_shortcode() within Admin Page
I'm using a few plugins that have shortcodes ... however, instead of creating a public page for the content, I've created some new pages within the admin using add_menu_page and I need to know how to ...
12
votes
6
answers
10k
views
Removing panels (meta boxes) in the Block Editor
When the Block Editor was added to WordPress, custom and core meta boxes became legacy, meaning, using the remove_meta_box() function won't work when removing meta boxes/panels displayed on the post ...
10
votes
1
answer
2k
views
What is the index [0] for on post meta fields?
Trying to improve my PHP knowledge through test and try! I am confused on [0] arguments at following WordPress PHP code
global $post;
$custom = get_post_custom($post->ID);
$price = $custom['price']...
36
votes
5
answers
38k
views
How can I put a custom meta box above the editor but below the title section on the edit post page?
I have a custom meta box for a custom post type that my client wants placed between the title/permalink section and the post editor in the admin panel. Is this possible and if so is there a hook/...
30
votes
6
answers
40k
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 ...
18
votes
5
answers
9k
views
Can I add a Category Metabox to attachment?
I am using register_taxonomy_for_object_type() to add the Category taxonomy field to Media uploads (attachments). I'm using this code to do so:
add_action('init', 'reg_tax');
function reg_tax() {
...
4
votes
2
answers
2k
views
How to add or remove metabox each page separately?
How to add a meta box for a particular page, say: for only About Us page.
How shall i do?
The current code adds the metaboxes for all pages:
function myplugin_add_custom_box() {
add_meta_box(
...
62
votes
6
answers
122k
views
Adding custom columns to custom post types
I've done this previously but I've forgotten the name of the hook, and can't find it anywhere...
What I'm trying to do is add some custom columns in the listing of a custom post type in the admin.
...
23
votes
2
answers
18k
views
How to show a custom meta box on the "Quick Edit" screen?
I've used add_meta_box() to add a custom meta box to the WordPress edit window on both pages and posts.
How can I make this meta box also show on the "Quick Edit" screen?
Ideally, I'd like it to ...
22
votes
4
answers
14k
views
Passing error/warning messages from a meta box to "admin_notices"
I have a simple meta box that updates the post custom fields (using update_post_meta()).
How can I send a error or warning message to the next page after the user publishes/updates the post and doesn'...
10
votes
1
answer
5k
views
Filtering the Admin Comments List to Show Only Comments from the Current User?
In the Comments page (/wp-admin/edit-comments.php), every logged in user can see all the site comments.
I'd like the users to see only his/her own comments and the comments that are left to his/...
9
votes
3
answers
45k
views
How to redirect/rewrite all /wp-login requests
Is there any simple way to have wordpress, php or apache rewrite all urls which involve /wp-admin to /admin?
I have added this entry to my .htaccess file:
RewriteRule ^admin /wp-login.php [L]
...
9
votes
2
answers
9k
views
Get List of Registered Meta Boxes and Removing Them
Is there a function for getting a list of registered Meta Boxes and removing them? I see there is a method for adding, and removing.
http://codex.wordpress.org/Function_Reference/remove_meta_box
...
2
votes
2
answers
1k
views
Modifying the main editor priority
I want the main WordPress post editor to appear below some of my meta boxes (generated by Advanced Custom Fields).
I know there are the add_meta_box() and remove_meta_box() functions, however it'd be ...
1
vote
1
answer
7k
views
Custom meta box shown when template is chosen [duplicate]
Possible Duplicate:
Toggle admin metabox based upon chosen page template
Is this possible to change editor screen immediately after someone picks some template from the drop down?
I need a ...
109
votes
8
answers
79k
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 ...
50
votes
6
answers
94k
views
Changing Admin Menu Labels
I have spent the last day using the functions.php file to fully customize WordPress for my client sites. I am amazed at how much I have been able to accomplish and how much easier it will make things ...
20
votes
8
answers
13k
views
Disable dragging of meta boxes?
Anyone know how to disable this functionality so the meta boxes can't be repositioned?
16
votes
2
answers
5k
views
Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
I need to create a custom post meta box(es) for my custom post type "Slideshow" (this post type is already created). Each metabox will hold the content in each slide slide and save it to ...
11
votes
2
answers
12k
views
How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button
I have a custom post type (called contacts).
Since this post type is not working like a post, I don't want to show SAVE DRAFT, PREVIEW, Status, Visibility or Publish Date.
The only options I want to ...
9
votes
1
answer
6k
views
How do I position meta_box on post edit screen after the title?
I am displaying a div in the Edit Post screen using add_meta_box(). This function provides very limited positioning options via "priority" and "context" params and these are not sufficient for my ...
7
votes
3
answers
2k
views
How to Add Reminders/Notes to New Post Meta Boxes
I have a multi-author website and I use the WyPiekacz plugin to require that authors add 1-5 tags, select only a single category, and include a featured image (and require minimum dimensions for the ...
7
votes
6
answers
4k
views
Best way to present options for home page in admin?
I have a site with a custom home page, home.php. What's the right way to present the editable home page options in the admin tool?
For example, there's a few custom text fields on the home page that ...
6
votes
1
answer
4k
views
Custom column for changing post status via ajax
I'm currently trying to implent a new custom column at the page manage screen that will let me change the status (published/pending) of the different pages via an easy toggle link.
From what I've ...
3
votes
2
answers
3k
views
Add column to pages table
Hey all i am trying to find the section within the edit.php page where it populates the table with all my current pages. What i want to do is add another colum to the table in order to launch a side ...
3
votes
1
answer
6k
views
Hide a page in the admin end without a plugin?
I'm creating a series of pages with iFrames embedded in them, but it seems the only way to do this within Wordpress (i.e. using the templating system) is to create pages in the admin end and then ...
1
vote
1
answer
4k
views
Dynamic page.php template for custom post types
I have a couple of custom post types registered. I would like to display all "posts" from each custom post type on its own page, and these pages must be visible in the nav menu.
It would be great to ...
34
votes
6
answers
43k
views
Is there ANY way to remove comments function and section totally?
I don't want any comment querys to run. I don't wont anything about comments to be shown in wordpress admin area.
Is this possible in any way?
EDIT: Remove all links to the comments from admin bar, ...
31
votes
3
answers
21k
views
Set Default Admin Screen options & Metabox Order
I am desperately looking for some way (any way) to set default "screen options" and metabox order through the functions.php file. does anyone have any help they can provide here?
26
votes
3
answers
33k
views
How do i best handle custom plugin page actions?
I'm constantly running into the same annoyance, so i thought i'd see if there's any ideas or experience out there...
I've created a plugin that uses it's own admin page. It has to. Now that i sorted ...
20
votes
1
answer
31k
views
Setting $_SERVER['HTTPS']='on' prevents access to wp-admin
First off my server is sitting behind a load balancer. My SSL certificate sits on the load balancer and handles HTTPS. The data coming in on port 443 is forwarded to the Wordpress server using HTTP ...
16
votes
6
answers
15k
views
Trigger Javascript on Gutenberg (Block Editor) Save
So I have a metabox which I want to trigger some Javascript when a post is saved (to refresh the page in this use case.)
In Classic Editor, this can be done via a simple redirect hooked to save_post ...
14
votes
5
answers
12k
views
How to search all user meta from users.php in the admin
The search form at the top of the users listing in the Admin area (wp-admin/users.php) is limited and does not search all of the user meta fields, such as bio, instant messenger handles, etc. I've not ...
13
votes
1
answer
27k
views
Changing the 'wp-admin' URL to whatever I want
Is there a plugin that allows me to change the url of domain.com/wp-admin to domain.com/whatever-iwant ? Curious if there is an easy solution to this by now.
12
votes
5
answers
32k
views
How can I remove the "Add New" button in my custom post type?
I have many custom post types that need the Add [custom post type] feature but I have a custom post type of "About" and I do not need to "Add New" about to the about custom post type. So I want to ...
11
votes
2
answers
11k
views
Custom field/meta populated by dropdown of existing posts?
(My first WP question ever asked! Be gentle!)
I'm building a site that is mostly pages (i.e., static), using WP as CMS. At the bottom of several of the pages, there will appear 1, 2, or 3 "promo ...