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
31 views

Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)

I am developing custom theme from scratch and creates a custom post type and getting this warning while editing custom post type. I also design custom Meta box with two input fields and using nonce in ...
0
votes
1answer
30 views

get_post_meta giving errors while creating a metabox

i was following atutorial on how to make a custom metabox to wordpress post but its giving errors here is my full code //Add Metabox function diwp_custom_metabox(){ //add_meta_box(metabox_id,...
-1
votes
0answers
13 views

How can I do metabox filtering?

I have a post type. I have a private domain within this post type. My special area is a date. I want to filter by post type and end date. How can I do that? Thank you in advance for your help.
0
votes
0answers
7 views

Metaboxes in custom post type disappear on save/publish

I'm maintaining a friend's website, and after updgrading to WP 5.5 some custom metaboxes on custom post type edit pages stared disappearing on save, but not all. There's a custom post type - 'Releases'...
0
votes
0answers
16 views

Nested Repeaters In functions.php

I've a repeater and I want to put another repeater inside of it, but I don't know how! So I want to have a repeater that is inside of another repeater. I'm using it for a trailer I think. And I want ...
0
votes
0answers
16 views

Don't know why post meta doesn't work even no error is thrown

I am having a problem with post meta. I have a custom meta box for posts. But when I select the option it doesn't work. Neither does this code throw any error. One week ago it worked like charm. Here ...
0
votes
0answers
27 views

Add and create multiple meta boxes for a custom post type

I'm trying to save the input from the 3 meta boxes I created. Here is my code below. What am I missing since I am only saving the smashing-post-class 3 times. /* Fire our meta box setup function on ...
1
vote
1answer
30 views

Getting List of all registered Dashboard Widgets

I am trying to get a list of all registered meta boxes in the wordpress admin, specifically the Dashboard widgets. Now this is easily achieved with the global variable $wp_meta_boxes and does exactly ...
0
votes
0answers
14 views

Save a loop of single meta box data from selected dropdown lists

The layout of my edit post page I have 193 countries in Afghanistan post and in every single post "passport". I want add post meta data for "Visa Status" for each country of the ...
0
votes
1answer
21 views

Adding custom meta boxes to specified custom post type

In previous situations I have been able to add a custom meta field to posts, the code was this: function website_add_meta_box() { add_meta_box( 'website-website', __('Website', '...
0
votes
1answer
27 views

Is it preferable to use custom code to create metaboxes instead of plugins (such as ACF) and if so why? [closed]

Currently I have a custom coded plugin with helper functions to easily create new metadata fields for posts and taxonomies programatically. Recently I've been extending these to include settings ...
0
votes
0answers
27 views

Have get_the_post_thumbnail output different image if custom meta exists

I have a meta box on each post where a user is able to select another image from the media library. I want this image to override the output whenever get_the_post_thumbnail is used across the whole ...
0
votes
0answers
48 views

Multiple Select on Gutenberg Sidebar as metakey

I want to show a multiple select element in the sidebar when editing a page in admin, where I can save the selected values in a metakey. Of course also load the selected values upon load of page-edit ...
0
votes
0answers
28 views

How to avoid duplicate posts queried from custom meta?

I'm querying custom posts taken from a custom metabox where you pick which posts to display to be used as criteria for filtering. How do I avoid duplicates? Current code (displays all authors - the ...
0
votes
1answer
44 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 ...
-1
votes
1answer
14 views

How we insert values into database using metabox Wordpress?

function Review_Form(){ ?> <form action="" method="post"> <div class="container"> <h1>Add Review</h1> <hr> <label for=&...
0
votes
0answers
25 views

A better way to add a meta box to custom post types

Id like to customize the UI for adding and editing a custom post type such that each custom field is included as a separate input field on the "new post" and "edit post" forms (as ...
0
votes
0answers
11 views

Display custom Metaboxes

I have an admin plugin where I created my own meta boxes. I need to know how do I display the meta box information on a page? When I edit the post all of the fields are populated with what I put in ...
0
votes
0answers
38 views

How to Grab Anime info using Jikan API and fill the value in Metabox

I want to create an Anime website. But I find it less effective if I have to manually copy & paste Anime information from MyAnimeList. So I want to create a system where users must enter the Anime ...
0
votes
0answers
27 views

Add forms dynamically in admin pages?

I'm developing a WP plugin and I need that each time the user press a button in the metaboxes field, the form appears bellow the first one, so the user can add as many as they need WITHOUT RELOAD THE ...
1
vote
1answer
19 views

metabox wordpress show in frontend

Hello I have a metabox field called name this returns an iframe that I have placed but it returns all the code of the iframe and it was not executed. What is missing in my code to show it in the ...
0
votes
1answer
17 views

Saving multiple fields (dropdown and text) in custom metabox

I have seen this question asked a bunch but nothing seems to work. I have a simple metabox within a CPT that needs to save two values. It needs to save a dropdown of pages and a url text field. I can ...
0
votes
2answers
35 views

$post->ID not working in combination with a custom query

What is the reason that $post->ID is not working in metabox_callback after adding a custom query. How can I avoid this? Should I use $post_id = isset( $_GET['post'] ) ? $_GET['post'] : ( isset( $...
1
vote
0answers
21 views

Hide Polylang metabox from the post edit sidebar

I need to have the ability to hide the Polylang metabox from the post edit page programmatically. I only want to show it to a few users, but hide it to people who do not have enough privileges. There ...
0
votes
1answer
30 views

Values from meta-box not on $_POST

I have a meta-box for a cpt and can't get the values from the form to update_post_meta cpt declaration: function hgod_fichas() { $labels = array( … ); $args = array( ...
0
votes
0answers
24 views

How can I convert a metabox to components panel in block editor?

I added a custom side meta box to a custom post type in WordPress using addmetabox and I noticed that the UI is different from the default in the block editor. How can I make it resemble the default ...
0
votes
0answers
15 views

Create Repeter Meta Filed Group with custom code without plugin

Anyone help me basic method code example. We want to create a meta field with repeater group. https://generatewp.com/the-meta-box-generator/ We have reviewed this one but not any option for repeater.
0
votes
1answer
18 views

Add post meta data date to event

I created a post metabox that uses the datepicker to pick a date value. I got as far as adding the metabox and getting the datepicker to work but other than that im struggling to get the data saved ...
-1
votes
2answers
19 views

Show search for data extracted from metabox

In custom post type book I have several books published I just want to show data obtained from metabox field but I have not been able to help me the code that I am showing does not work <?php $...
0
votes
0answers
12 views

Which one is better to create an image uploader for posts and pages? meta_box or custom_field?

I created an image uploader for a settings page that I just created to my site. I used register_setting to do that. I already created an image uploader for posts as banner. The Image uploader is ...
0
votes
0answers
42 views

saving custom meta fields multidimensional array

I have dynamic meta fields with multi select option each field contains select menu with multiple select feature user can add as much options as they can so i want to save it in the db but not sure ...
0
votes
0answers
8 views

Metabox for searching/selecting arbitrary pages?

I'd like to create a meta box for my pages that allows me to declare arbitrary links to one or more related pages, with the idea being that I could then render these after the page content. E.g. "If ...
0
votes
2answers
61 views

Orderby my needs in foreach loop like by title or something?

in a cpt i can check some values (checkboxes) in a metabox. i can access this values by $meta = get_post_meta(get_the_ID(), '_custom-meta-box', true ); after that, i do a foreach loop: foreach ($...
0
votes
0answers
24 views

How to store and retrieve custom metabox data as json in wordpress api

I am trying to store metabox data as json in wordpress and then get it using wp-json api. What i tried $current = array( 'id' => "in json object", 'name' => 'name in json object' ); $...
0
votes
1answer
35 views

Save meta box data from selected dropdown list in bbpress reply form

I hope to customize bbpress reply form area with dropdown selection list. I could not find any previous post reporting similar case in bbpress. Referring to post "Save meta box data from selected ...
0
votes
0answers
19 views

Custom Metabox Info Not Saving

I have a custom metabox on a custom post type, and the input data disappears after I save/update the post. I've read through a bunch of similar questions but can't find an answer that fixes it for me. ...
1
vote
1answer
60 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 ...
0
votes
0answers
15 views

Check if any meta on the post has value then display content

I know how to use the conventional get_post_meta, and I usually call it with each field separately. Is there a way to use them all at once? For example, use an if statement to display content if any ...
0
votes
0answers
18 views

create a “add icon” field in taxonomies page

Similar to this post but not quite, I have a Wordpress theme with free Fontawesome already installed and I wish to add a field in the "create Categories" box where I could type in and choose an icon ...
0
votes
1answer
37 views

save_post_{$post->post_type} action firing on second save

I have custom metabox checkbox on CPT in my plugin. I want to fire an action and save new option when I save this post. But no matter how many times I tried it's saving option value only on second ...
0
votes
0answers
23 views

Metabox collapsed by default

I need to make a metabox of a WordPress Plugin called "post expirator" collapsed by default. Right now it is open. actually when i open a page : My need : That is the part of the code adding ...
0
votes
0answers
9 views

custom metabox content not saved into database

I have added some metaboxes to my wordpress theme. I'm facing the issue that the data will not be saved inside the database and I get only empty field in the backend. I've inspected the ajax response, ...
0
votes
0answers
10 views

How to save custom metabox tinymce content and preserve gallery attached to it

I have a class that will register some metaboxes in my custom theme and i need to fix some small problems with it. I have added a tinymce instance inside some metaboxes. I want to add also a text ...
1
vote
0answers
31 views

what is the difference between these phares?

I have mutli input fields in custom metabox.However, only 2-3 array items show on page, others doesnt seem.For example, "text-ruby" shows but "textname" doesnt show.Why? What is the difference between ...
0
votes
1answer
18 views

Metabox types list

For example, in below code snippet, there are some types for custom metabox input fields such as text and textarea.So, I want to learn other types.I searched it on google also w.se.com but I couldnt....
0
votes
0answers
13 views

Not able to show entered value for a text input in a meta box

So I've searched for weeks and I know there are a lot of questions about this topic but I cannot figure out how to show the value that a user inputs into a text field in a custom meta box. I get the ...
0
votes
0answers
21 views

Wordpress action not working inside another action

I am developing a plugin where I want to add some script only when the metabox will add . So I tried following code add_meta_box( $args['id'], $args['...
0
votes
0answers
24 views

How to add html to the meta box display area?

I am a blogger, don't know much about code. I have created a meta box follow the instruction Article source link for posts. However, it cannot insert a href link and , . Code: /* Define the ...
0
votes
0answers
13 views

How to save and retrieve the metabox select options values

I am facing a problem with my metabox dropdown list populated with custom post types, i am unable to save and display the selected option and when i checked by enabling custom fields from the screen ...
0
votes
0answers
19 views

How to make footer with custom post type?

I have a question in mind that How to make footer/header with custom post type using wpbaker? I mean can we make a layout with custom post type and assign separate layout to the separate pages. Do you ...

1
2 3 4 5
32