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
1answer
21 views

How to improve my non-unique metadata MySQL entries?

I'm working on a plugin for WooCommerce which uses a cpt called Restock. In a Restock post you can enter products ( id ) plus restock. The user can add as many product restock pairs as they want per ...
0
votes
0answers
7 views

display failed status on post edit

I created a meta box in the post edit interface that modifies a portion of a post on update (publish/pending/update/etc.) It's working great. I have tried a number of things to invoke a failed status ...
1
vote
1answer
23 views

how can i do metabox [closed]

how can I make a metabox like in the picture episode title : Episodes 1 Serie Name : The Seven Deadly Sins AirDate : gg.aa.yyyy
0
votes
0answers
13 views

how can I make this metabox area

how can I make this metabox area function bolumler_metabox() { $screens = ['post', 'page']; foreach ($screens as $screen) { add_meta_box( 'episodes', // Benzersiz ID ...
0
votes
1answer
4 views

Wordpress default post categories meta box widget

I have a plugin that automatically selects the categories in the wordpress post editor, sadly after installing the Rank Math - SEO plugin the default metabox of the post editor has changed and the ...
1
vote
0answers
9 views

Visual editor issue by having multiple tiny mce editors in a CPT

I have a custom post type in which I have added multiple wysiwyg editors, when I click on visual, the content of the editor (button, text, title) get inside of the wysiwyg editor.. it's odd. It looks ...
0
votes
0answers
10 views

How to show cmb_meta_boxes in a seperated page?

I am using cmb_meta_boxes v1 I need to know the best way to show $meta_boxes fields automatically in a separated page for every post if exists. For example : I am creating a new post The permalink of ...
0
votes
0answers
16 views

Taxonomy custom check box meta field not getting saved

I am trying to add a simple checkbox to the category page but it not getting saved for some reason. Please help to fix the code below. Basically, I registered a meta then created check box. CheckBox ...
0
votes
0answers
20 views

meta box image responsive srcset and sizes attributes value

I create meta box and and save it's value update_post_meta( $post_id, 'cover_image', sanitize_text_field( wp_unslash( $_POST['cover_image'] ) ) ); I use it in template - <?php global $wp_query; ...
1
vote
1answer
23 views

Custom Metabox data slow query on Admin init

recently my database got very large either in posts and postmeta, and when accessing the WP admin it loaded on init something like 700mb of data, and it was slowing down the entire backend. I found ...
0
votes
1answer
11 views

Show a custom post title in another custom post type in Meta box

I have created two custom post type. Suppose A and B. I would like to fetch A custom post title in B in meta box in a drop-down. I am not getting any solution. Is anybody help me to find the solution. ...
0
votes
1answer
11 views

Set class if a meta value is set within post archive

I'm attempting to add a class to posts when the meta key 'checkbox' is clicked. Here's what I have: <?PHP $checkbox = get_post_meta($post->ID, 'checkbox', true); if (!empty($checkbox)){ $...
0
votes
0answers
14 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
6 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
215 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
31 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
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
25 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
18 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
33 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
52 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
24 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
29 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
28 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
104 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
34 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
45 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
17 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
26 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
78 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
46 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
18 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
31 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
34 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
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
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
58 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
9 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
110 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
33 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
43 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
91 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
2 3 4 5
32