Questions tagged [metabox]

Refers to a box-like reusable user-interface component common in the WordPress backend.

Filter by
Sorted by
Tagged with
1
vote
1answer
44 views

Plugin - Combine Meta Box Input Fields into single saveble record

Im a complete novice when it comes to coding. I have managed to build a theme with some custom post types. Within the custom post type i have used a generator tool to create a custom meta box. It ...
0
votes
1answer
18 views

Metabox not saving values

I have a problem. My fields are showing in the meta box, but saving does not work: <?php // Create the metabox and fields function food_meta_box_markup($object) { wp_nonce_field(basename(...
1
vote
1answer
110 views

How to convert the WordPress meta box Page Attributes->Page Template dropdown to radio buttons?

I would like to be able to change the Page Attribute "Templates" dropdown to radio buttons, to allow me to have corresponding thumbnails next to them. I have already removed and replaced the Page ...
0
votes
1answer
303 views

How to position user meta data field

I have 1 additional field I want to display on the user profile page (mainly admin users will use this) I have done it but it is showing up at the very bottom of the page, I want it to sit in the ...
2
votes
1answer
107 views

How to verify meta box is registered in Unit Testing?

I am currently doing TDD with WordPress, in the PHPUnit I need to test if the meta box is actually registered on a method call, I could not find any function in WordPress to do that, so I was trying ...
1
vote
1answer
898 views

Want to hide some categories from the categories meta box in the post editor for the two specific user roles

Recently, I am customizing the COLORMag theme in WordPress. I want to make my site as a multi-author website where random people will register and write. But as my theme's homepage shows all the posts ...
1
vote
0answers
21 views

Add custom links like functionality

I want same functionality like WordPress provide for custom links but additionally I want to add some class to those links by default that is added by this feature (Other websites). I have tried to ...
0
votes
1answer
46 views

How to filter result set in custom metaboxes?

I am adding a plugin that adds a custom meta box on the admin woocommerce product detail page. What this does it lists the completed orders that contain the product. I was able to successfully add ...
0
votes
1answer
80 views

Creating custom meta box throws PHP warning error in WordPress

I am trying to create a meta box as a plugin in my WordPress test website. I am using an installed custom theme from a tutorial I am following from Udemy called, 'WordPress E-Commerce Development w/ ...
0
votes
1answer
30 views

Add a metabox when editing a media - but only for images

Is it possible to add a metabox for medias (attachments), but only if they are images ? I don't want this metabox on other file types. Thanks
0
votes
0answers
54 views

Create Metaboxes dynamically in admin for Pages

I've created in the admin editor of my site homepage a Metabox with an input and a textarea fields. The code works great. However my goal is to allow the admin user to duplicate the Metabox with the ...
0
votes
1answer
68 views

Create Post Types from a XML url (Real Estate website)

I have a URL provided by my Real Estate service that lists, in a XML file, every apartment and house that I have to sell. The XML url lists every detail of every apartment, things like images, year ...
0
votes
2answers
26 views

Find a way to retrive data updated through metabox plugin to web page

I developed a customer metabox plugin to save user details to db and retrieve them back to Contact Us Page in my website. But I searched a way to retrieve the data to contact us page and I couldn't ...
0
votes
1answer
23 views

Values entered in a meta box aren't saved

I developed a custom metabox plugin and linked it to contact us page in order to save to DB the phone number, email and working hours as user input. The thing values I entered are not save into DB. ...
0
votes
2answers
337 views

Custom Meta Box (SELECT2) Not Saving Taxonomy Terms

I have the code, /* * Add a metabox * I hope you're familiar with add_meta_box() function, so, nothing new for you here */ add_action( 'admin_menu', 'rudr_metabox_for_select2_cat' ); function ...
0
votes
0answers
22 views

How can I 'check' the “custom fields” box from the Screen Options?

I am using the latest version of WordPress v5.3.2. I am trying to find out a way [through Code] to enable 'Custom Fields' by default, when on the Add/Edit Post/Page pages, at least for the one's ...
1
vote
1answer
371 views

Cannot save Checkbox meta box value from a Custom Post Type

I have created a simple Custom Post Type which has a few textboxes and one checkbox. Textbox values are getting saved and updated perfectly in wp_postmeta table but I am not being able to save the ...
1
vote
0answers
25 views

Getting Custom Post Type Meta on Publish

Can you please take a look at this code and let me know why I am not able to get the Custom Post Meta on publishing the post. I tried thses function get_cpt_meta($post_ID) { $post = get_post($...
1
vote
0answers
28 views

Adding meta box without add_meta_box - is this bad?

I noticed that a plugin I am using has this hook during its rendering of a meta box in one of its settings tabs: do_action( 'learndash_metabox_options_div_after', $metabox->settings_metabox_key ); ...
1
vote
0answers
79 views

Remove metabox from WordPress menu editor page?

I'm trying to remove meta boxes added to the WordPress menu editor page from a theme, but can't seem to figure out how to do it, I found this answer, but I must be doing something wrong as it isn't ...
1
vote
1answer
253 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 ...
2
votes
1answer
221 views

Options to get my custom post type metadata via the WordPress API

I am using a plugin that adds multiple custom post types all of which have their own meta-data. I am able to expose the custom post type to WordPress's API but the metadata collected with those post ...
0
votes
0answers
20 views

How to determine wether a post gets just created

when showing a post of a custom posttype with my metabox, I would like to check, if this is the first,instantiating call for this post. Is there a WP-function or elegant way to do this?
0
votes
1answer
82 views

custom meta box data not saved

After two day of reasearch and questions without answer, today someone has suggested me a way to add a custom metabox field to the wordpress images. My scope is to add an url when the image are ...
0
votes
1answer
175 views

Add custom metabox to media library images

Is it possible to add a custom meta box for the images of the media library?How I achieve this using add_post_meta() function?
0
votes
0answers
20 views

I created a Custom Meta Box but it is not displaying the value on my post page

So i created a custom meta box, here is the code : add_action( 'add_meta_boxes', 'register_meta_box' ); function register_meta_box(){ add_meta_box( 'author_email', 'Author Email Id', '...
0
votes
0answers
16 views

Load meta box inside meta box.. is this possible?

Wondering if I might do this as I'm looking to create a To Do View like on github project view does. Any insight will be appreciated, I may just go for a completely custom solution but if someone ...
0
votes
1answer
121 views

WP_List_Table Inside Metabox Not Working on Clicking Search Button

I'm trying to display a WP_List_table inside a metabox. The metabox is for listing registered users to a course(LifterLMS Course Post Type). The table columns contain user_id, user_name, percentage &...
1
vote
1answer
40 views

How Meta Data is different from Custom Fields of POST/PAGE in WordPress

I am really looking forward to have a clear picture of Why Meta data is being used for the Posts/Pages? I have always been wondering on how Meta data is different from the Custom Fields of Posts. I ...
0
votes
2answers
478 views

Custom metabox with image gallery upload that won't attach images to post

I have created a custom metabox with an image uploader that will upload multiple images into a gallery that I can then query. It all works accept for the fact that the images don't show as attached to ...
0
votes
1answer
63 views

Modify Publish Metabox location on CPT

I've been struggling with how to do this properly and have yet to find a solution. I have a CPT with ACF fields. I can't use a front-end form because I'm synchronizing the CPT across several ...
0
votes
0answers
151 views

Adding a drop-down (select tag) option under Menu Settings in WordPress Admin

I looked (surfed) around a lot to get idea of how can I add custom field/drop-down under "Menu Settings" in WordPress Admin. I want a select tag with options from which I can get value based on the ...
0
votes
1answer
24 views

Custom Meta Box returns no HTML

I'm trying to write my first plugin and running into an issue with the callback in add_meta_box(). The meta box appears on the custom post type page however there is no content inside. Here is the ...
0
votes
1answer
18 views

Cannot add a class to metabox

I'm trying to add a class to the metabox, for doing so I have created the metabox element in this way: array( 'label' => esc_html__( 'Property Lot Size', 'zoacres' ), 'desc' => ...
0
votes
0answers
47 views

Wordpress Filesystem create CSS-File - get Shortcode ID for Name

My Script creates an CSS File when i save the post with the shortcode ID at the end of the filename. e.g. (test-293.css) The Problem is, that i need to register this individual File in my frontend and ...
0
votes
0answers
114 views

wp_editor in custom post type is not saving formatted text like bold, italic etc

My custom post type has 5 custom meta boxes which use wp_editor. Visually I can format the content but when saved, all the formatting is gone. For example I made a portion of my content bold, but ...
0
votes
0answers
35 views

How to create a custom metabox like the wordpress provided tag metabox?

I want to create a custom meta box like this: What's the code I should add and where file should i add it in? I'm using wordpress' 2017 theme
0
votes
0answers
300 views

update_post_meta() throws Uncaught error: Cannot create duplicate attribute

In my plugin I'm creating a post of a custom post type. Immediately after creation I'm trying to update some of the metadata that I've defined in metaboxes for this CPT. Upon execution of the code, ...
0
votes
1answer
109 views

Metabox multiple custom post select -> display selected items?

I'm building a theme that needs some cross-information(?) between custom post types. I have a metabox to select custom post types and display them inside the single page of another custom post type. ...
2
votes
4answers
1k views

Relate two custom post type using meta box

I've two custom post type: 1.products 2.seller Now I want to relate both the post types using the meta box. I want to display products in seller posts so that sellers can select the required ...
1
vote
1answer
56 views

MetaBox body is not showing (the callback function)

We're creating a plugin where, for example, it shows a metabox on all post types. To kick things off, I'm using the Starter Kit. <?php namespace PLUGIN_NAME; class Foo { public function ...
1
vote
1answer
98 views

Choosing a default page tempate (Classic => Gutenberg)

This code was working in the "Classic" era to set a default page template: /* Blank Page by default */ add_action('add_meta_boxes', 'blank_default_page_template', 1); function ...
0
votes
1answer
274 views

How to pass multiple custom fields as shortcode's parameters

I'm learning how to pass parameters in shorcode, I know the basic step after read through WP Codex. But for now, I have plugin come with custom fields and as the title, I want to know how to do it. ...
0
votes
1answer
382 views

How to save a Woocomerce metabox input as a metadata field

I have a plugin that adds videos in place of the featured image of Woocoemerce products. The plugin just adds the video URL and saves it within the product. I would like to provide the saved URL via ...
1
vote
1answer
2k views

WordPress nl2br is not converting newline to html line break when saving metabox value

I tried possible solutions to save \n as <br /> from my custom post type <textarea> metabox but it is not working. I am using a custom made theme and there is no additional plugin ...
0
votes
2answers
881 views

Update Post Meta in Front End with a form

How I can update Existing (Back-End) metabox variable from front-End, I tried many times but I don't know why doesn't this work? Showing only old value not update, what i did wrong? This is my Front-...
1
vote
1answer
301 views

Remove meta box for specific page

I'm trying to conditionally remove the 'Page Attributes' meta box for a specific page (or multiple specific pages). For example: function remove_meta_boxes() { if (is_page('contact')) { ...
0
votes
1answer
343 views

Update Post meta with custom variable

I Just want to update (edit existing) the custom meta box variable from front-end. I got a form Front end post editing using a form & process things but in this code post-title i can edit & ...
0
votes
0answers
193 views

How to Edit & Update meta_box values from Front-End user Form

I'm trying to Edit & Update meta_box values from front-End, Following codes are back-end. The problom is i'm fully confused with update post & update meta box. I hardly trying to get $package ...
0
votes
1answer
322 views

How To Tell If a Custom Field Was Made with ACF, Metabox.io, Carbon Fields, Custom Built, etc?

I am working on a plugin that will be using custom fields, but was curious if there was a way to tell which plugin/library created those custom fields. The reason I am trying to find this distinction ...

1 2
3
4 5
33