All Questions
69 questions
7
votes
3
answers
4k
views
How to force one column layout on custom post type edit page?
I've created a plugin using custom post types and I need to force the default two column post page to a single column. At the same time, the Publish metabox must move to the bottom. I need to do this ...
7
votes
2
answers
13k
views
How can I retrieve multiple get_post_meta values efficiently?
I am looking for a solution to returning multiple get_post_meta values...
Current I am using a meta box array as follows:
$meta_boxes[] = array(
'id' => 'setlist',
'title' => 'Setlist ...
6
votes
2
answers
2k
views
Can I force a metabox to be in one column?
Suppose I created a custom metabox for the add/edit post page that uses a wide width (not suitable for being in the sidebar), is there a way of keeping it in the middle column only and sortable while ...
5
votes
2
answers
4k
views
How to add a new tab to page editor
Anyone knows how to achieve this?
It has something to do with meta boxes, but I just can't figure out the proper syntax.
5
votes
2
answers
3k
views
WP_List_Table Inside Metabox Not Working on Submit
I'm trying to display a WP_List_table inside a metabox. The metabox is for a custom taxonomy called service which is registered to a custom post type called office. The table columns contain input ...
5
votes
1
answer
390
views
Listen to Post action
I am writing a plugin that adds a custom metabox to the post page. I would like to trigger an event when the user navigates away from the edit post page or when a user stops editing a specific post. ...
4
votes
4
answers
6k
views
How can I add a column/s to wp_posts table?
I am trying to sync WP with another service that offers an API that allows me to hook up their table's Update, Create, Delete to my sites.
So when they create, update, or delete a row on their server,...
4
votes
1
answer
26k
views
Add metabox with media uploader in a custom post type [duplicate]
I need to create a "media uploader metabox" and add it to my custom post type.
I've already create normal metaboxes, the function to add to the custom post type and the function to save them, I only ...
4
votes
1
answer
6k
views
How to add metabox for post of specific category
I want to add Metabox for the posts of category=18 and i am using the following code but unable to do so . So please help me out->
add_action('admin_init','my_meta_init');
function my_meta_init()
{
...
3
votes
2
answers
8k
views
How to batch update post content with custom post meta value
I have a custom meta box, using WPAlchemy, in which I am looking to get rid of. However, I would like to get all posts that have a specific custom meta value set, and insert it into the begininning of ...
3
votes
1
answer
4k
views
upload image in a meta box
im trying to implement uploading via a meta box without using the media manager, but i want it to add as a post attachment.
im currently doing it just uploading and saving to the server.
<?php
...
3
votes
1
answer
443
views
What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
I want to insert a custom button between "Publish" button and "Move To Trash" link. What can I use to make this?
Here is a screenshot to make this clearer:
I know I can use jQuery, but I want to do ...
3
votes
1
answer
4k
views
add_meta_box: Datepicker like the one for postdate?
I've built a custom post type called "Events". Each event has a future date and I don't want to use the normal postdate of the post.
I want to use add_meta_box to add some inputs for this "event-...
3
votes
0
answers
269
views
Have save_post write to database image meta [closed]
Programming rookie back again.
I have been studying the add_action('save_post','') but I am having difficulty getting it to work for my needs. The concept is simple - update the database information ...
2
votes
1
answer
2k
views
Change Post Title Edit Box
When editing a post, the title field displays the placeholder "Enter title here" (it's actually a label element that's made to look like a placeholder attribute, but whatever). I have a custom post ...
2
votes
4
answers
224
views
Multiple information using custom post type
I made a new custom type, it's working fine. My question is: If i want to add in a single post that custom-type with different informations for about x times...how should I do this?
Example:
Let's ...
2
votes
1
answer
2k
views
1 column admin screen options - move submitdiv to bottom
I'm using this code.
add_filter('meta-box-order_post','one_column_for_all');
function one_column_for_all($result, $option, $user){
$result['normal'] = 'postexcerpt,formatdiv,trackbacksdiv,tagsdiv-...
2
votes
1
answer
4k
views
Using radio button meta data from a custom meta box
Very new to attempting PHP and am hacking together my first plugin using tutorials..
I have a custom meta box with a Yes/No radio button on all WordPress pages (in the editor).
EDIT- I removed the ...
2
votes
1
answer
247
views
Save list from a custom meta box?
I have a simple list (ul>li) which is manipulated with jQuery UI in a custom meta box.
How would I go about saving the contents of the list during post save?
I already have the save function ...
2
votes
1
answer
219
views
Using Custom Posts with Metaboxes and Drop-downs
When using Custom Posts and adding a Metabox, I was wondering how I could add a drop-down menu that would populate data that was added by the user.
For example I want to be able to select a 'source' ...
1
vote
1
answer
62
views
Changing custom type name hides the posts [closed]
I created a custom post type. Plugin used is Custom Post Types & Custom Taxonomies plugin which does the job very good.
And added some posts to it.
But when I modify the name of the newly created ...
1
vote
2
answers
314
views
Automatic value for custom fields for posts
I have created custom fields for posts by using the add_meta_box action. I want to create my own WP Query based on my custom field, to make sure I will only load a post collection with the correct ...
1
vote
2
answers
628
views
How can I tell if a post has been published at least once?
I am working on a plugin that has a piece of meta data attached to each post. The fields are editable in a meta box on the post. This is all working fine.
I would like to prevent anyone from ...
1
vote
1
answer
749
views
How to rename "Publish" metabox title in post screen
I've looked everywhere trying to find how to rename the "Publish" metabox title in the WordPress backend post screen. There's help for every other metabox for changing titles and there's help for ...
1
vote
1
answer
50
views
Understanding and using metaboxes in posts
I am developing my first theme that is not dependent on a parent theme but I am running into some back-end problems. I'm trying to add a metabox to all posts that are being written. This question is ...
1
vote
1
answer
621
views
Adding dropdown select meta box to custom post type - seems restAPI is interfering
I have a custom post type, call it topic. It is from BBPress, but this isn't a BBPress question.
I also have a post type lessontopic.
I added a meta box to BBPress so that I can choose an associated ...
1
vote
1
answer
47
views
Dashboard :10 Last draft page and 10 last pending review page (metabox)
I want to display on the dashboard for some users role (Admin, editor and auther) . a box with 10 last draft page and 10 last edit page.
For the 10 last edited page I use the custom below :
...
1
vote
2
answers
3k
views
get_post_type on post.php
How can I get the post_type while on the post.php page?
I'm working on a plugin that lets users create a new post type. Then in the new post type, a meta box will be added with some options. The meta ...
1
vote
1
answer
483
views
Adding custom fields to bbpress reply form
Referring to post "adding-custom-fields-bbpress-topic-form" with link https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/,
I want to add custom fields to bbpress reply form ...
1
vote
1
answer
371
views
Meta value does not save for scheduled posts
I created a metabox into my posts, it's a checkbox that I checked.
Here's the code for saving the data :
add_action('save_post','save_metaboxes');
function save_metaboxes($post_ID){
if (...
1
vote
1
answer
611
views
Simultaneous admin updates causes custom fields to not update
Okay, I have another doozie of a problem and although I'm still in the middle of trying to figure out exactly what's going on and what kind of help I might need, I thought I'd throw something up here ...
0
votes
1
answer
667
views
meta_box or custom_field as a second tinymce post-instance?
probably a rather weird question but I have no idea if this is possible or not!?
I created a custom-post-type to handle events. An event always has a future date but once this date is over I want to ...
0
votes
1
answer
96
views
How to I retrieve the ID from the Posts page?
I am creating some custom meta boxes in my theme to allow user to insert their own custom meta description and keywords overrides (no I will not use a plugin for it). I am having an issue with the ...
0
votes
1
answer
140
views
How to save meta checkbox Wordpress
I want to save a meta with a checkbox for all my posts, here's my code :
add_action('save_post','save_metaboxes');
function save_metaboxes($post_ID){
if(isset($_POST['is_viewpay'])) {
$old_meta =...
0
votes
1
answer
2k
views
Hide custom metabox value from custom fields
Before I ask the question, I tried to added _ to the custom field, but it's not working, at least with my code.
I just want to hide the value of my meta box from appearing in the custom fields. When ...
0
votes
2
answers
65
views
Is there a way to create a meta box that can be added multiple times to a post dynamically?
This shouldn't be that difficult (I wouldn't think) ... I just want to have a section of my theme (directors) that has the name of the director / their bio in the title and post respectively (done).
...
0
votes
1
answer
2k
views
Get post meta retrieving wrong value
I created a custom meta box with a textbox where the user can enter a custom value in as an additional identification tag. I thought I had it right but when I try to retrieve the value it is giving me ...
0
votes
1
answer
414
views
Upload attachment from external site
For example, we have some image on the external site:
http://site.com/image.png
How do I upload this image to my wordpress as an image attachment by php?
Image should be copied to my uploads folder,...
0
votes
1
answer
2k
views
multicheck box for post metabox
Hi guys I have a headache on this I make a multicheck with this tutorial wpshout.com/create-an-in-post-theme-options-meta-box-in-wordpress/ the problem is it doesn't save all checked value and it ...
0
votes
1
answer
141
views
Show metabox value last post excerpt, title and link
I'm facing a problem I can't solve.
I'd like to get the excerpt, title and link of the last post containing a particular meta-box button status.
For example: I would like to retrieve the last post ...
0
votes
3
answers
2k
views
Updating post meta for checkbox
<div class="vp-field vp-checkbox vp-checked-field vp-meta-single" data-vp-type="vp-checkbox" id="_custom_meta[category][]">
<div class="label">
<label>Categories</label>
&...
0
votes
1
answer
2k
views
Adding JS functionality to the Publish button in wp-admin/post.php
I've created a plugin with a new metabox in my post.php. It's working fine on it's own, but the problem is getting it to save it's values if the users choose to press the "Publish/Update/Save" in ...
0
votes
1
answer
47
views
Get post related to particular meta box? [closed]
I have created few metaboxes and i would like to show the post related to that particular metabox value.
Just like we get the post related to tags or categories.
0
votes
1
answer
2k
views
Adding a meta box to determine the sidebar [closed]
I was trying to customize my WordPress, and I have added some custom meta boxes (it adds custom field) to add values in it, but I don't know how to do this one...
I want to a Meta Box, which will be ...
0
votes
1
answer
535
views
Simple Custom Metabox Not Saving
I'm not quite sure why but I've been playing around with all kinds of different solutions but none seem to work. I've traded update_post_meta with add_post_meta and even broke it up into 3 ...
0
votes
1
answer
1k
views
Why my meta boxes won't show in front post page?
I see it everywhere: in single post, in category archives etc, but in front page post not.
I display the metaboxes in this way:
<?php if (get_post_meta($post->ID, 'test_1', true) != '' ) { ?&...
0
votes
2
answers
169
views
Create a custom post type based on 'Post'
I would like to create a custom post type, but all the tutorials I've found are geared towards making a brand new one and creating meta boxes from scratch. Whereas all I would like to do is copy an ...
0
votes
1
answer
717
views
Display content between two dates?
I want to display a meta field between two dates, the admin can set the two dates via the custom fields.
How can i make such content show between the dates set?
Thanks
Matt
0
votes
1
answer
1k
views
How to get value in radio input in post meta box?
I use this code when create input box for post meta box:
<input type="text" name="<?php echo $name; ?>" id="x" value="<?php echo $value; ?>" />
Now I need to handle radio box which ...
0
votes
1
answer
135
views
Adding an option to post editor to show a site disclaimer or message
I was wondering how I would go about adding an option to add a site disclaimer or message for a published post in Word Press.
Something like this (Please See Below)
Which by checking the box will ...