Questions tagged [metabox]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Adding text box with add_meta_box

This is my code: $configuracoes = register_post_type( 'configuracoes', $args ); $configuracoes->add_meta_box( 'dados', 'Personalize os dados de impressão', array( 'tabs', ...
0
votes
0answers
7 views

Activating metabox from admin not working

i was following a youtube tutorial of how to make wordpress admin option but stuck at a point i am trying to activate or show a metabox on all pages only when a contact form setting is activated from ...
1
vote
1answer
664 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
32 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,...
0
votes
0answers
10 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
41 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
19 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
37 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
127 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
43 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
30 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
30 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
355 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
46 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
59 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
23 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
31 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
188 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
117 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
24 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
22 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
36 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
44 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
31 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
1answer
19 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
2answers
258 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
1answer
74 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
191 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
30 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
50 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 ...
1
vote
0answers
32 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
25 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
72 views

How to get custom post type with dynamic ID

I want to show a custom post type chosen from the meta box dropdown list but i am getting this error Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-content\themes\...
1
vote
1answer
73 views

PHP basics help in WP context - remove a class/function?

(Disclaimer: I am a designer by choice and a programmer only by necessity. Meaning I can somewhat read PHP code, but I have a harder time writing it myself. I wish I could be better though, and this ...
1
vote
0answers
39 views

Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?

I'm currently working on a website that has a custom post type ("schedules") that requires custom hierarchal taxonomies (named "location" and "servicetype" in this case) to be displayed as radio ...
1
vote
1answer
33 views

Need Help Fixing My Iframes [closed]

i have this code that shows different servers to watch a videos on the code: <div class="container-disable"> <ul class="tabs-ul nav-justified clearfix"> <?php $repeatable_fields = ...
0
votes
0answers
26 views

how to Add Meta Box with featured image settings and To Edit Post Screen For Inline Styles (css box)?

How can i make this meta box please help? function add_custom_meta_box1() { add_meta_box( 'meta-box1', 'Featured Image Settings ', '...
0
votes
0answers
107 views

Wordpress Blocks, setAttributes not saving

My block seems to work correctly, unfortunately none of my metadata gets saved after saving the article. You can find source code for my block in this repository. It simply adds a toggle to set a ...
0
votes
3answers
295 views

How to get checkbox by default true in metabox?

Can't get my checkbox for metafield set true by default. Everything is working fine, except default value. I know there is a lot of questions and answers for it, But I tried everything and still ...
0
votes
1answer
286 views

PHP Notice: Undefined index: mytheme_meta_box_nonce

There is a bug about my metaboxes in debug.log: [12-Mar-2020 13:00:05 UTC] PHP Notice: Undefined index: mytheme_meta_box_nonce in /home/deniztas/migrate666.deniz-tasarim.site/wp-content/themes/...
0
votes
1answer
41 views

I have added a metabox and inside it i added a secondary title and a text editor but if i write anything it does not save it or show it on my page

functions.php file: function add_custom_meta_box2() { add_meta_box( 'meta-box2', 'SD Extra Page/Post Options ', 'custom_meta_box_markup2', ...
0
votes
2answers
51 views

Using Customizer API vs Custom Meta Box for custom content

I just started diving into the wordpress world and i'm trying to add custom content to a website, i looked at the Customizer API and Meta box and they seem to be both able to add what i want which is ...
0
votes
1answer
105 views

Get or set values in post meta

I've built this theme option, based on the following tutorial https://rudrastyh.com/gutenberg/plugin-sidebars.html#registerPlugin but now I'm having trouble figuring out how to send the post/page ...
0
votes
0answers
319 views

non-unique #_ajax_nonce id in browser console

I have added multiple custom fields through a meta-box, and i have used wp_nonce_field function that generates a nonce for each field and every thing is working for This meta box, but also WP renders ...
1
vote
2answers
264 views

Meta box html is not updating after saving

I have some meta boxes setup, some are my own, some are initialized in plugins. As the title indicates, these meta boxes are not updating graphically after the post has been submitted. Here's an ...

1
2
3 4 5
33