Questions tagged [metabox]

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

Filter by
Sorted by
Tagged with
2
votes
4answers
15k views

Check if meta key value already exists

Let's say that I have few posts with meta key "videoid". Value of that meta key is different for every post (and has to be different). When adding new post, how can I check if videoid with that exact ...
0
votes
0answers
11 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 ...
1
vote
1answer
507 views

Translating custom post type metaboxes

Is it possible to translate custom post type metaboxes (label not values of metaboxes fields) with localization? Or do I have to use some plugin like WPML? Thank you in advance. I have read this ...
0
votes
2answers
508 views

Remove All in One Seo from Posts for Contributors

I am using latest version of All In One Seo Package. How can I remove metaboxes from posts for User Role: "Contributors"?
0
votes
1answer
40 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 ...
0
votes
0answers
25 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 ...
-1
votes
1answer
13 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
22 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
7 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 ...
-1
votes
0answers
11 views

I want to customize tables in WordPress to appear for custom member ranks as well as MetaBox

I want to customize tables in WordPress to appear for custom member ranks as well as MetaBox In the first picture, as shown in the MetaBox for shipment status, I do not want the box to appear for ...
0
votes
0answers
14 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
1answer
658 views

Get a different size of Image thumbnail while working with custom metabox

I am using custom metabox for a page in my new project, I am using it for uploading image, and attaching it to the page. It's working fine, I can select image or upload the image using WordPress' ...
0
votes
0answers
23 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 ...
0
votes
1answer
927 views

Add other all taxonomies as meta boxes to custom post type

I have a custom post type which comes with a category taxonomy. This taxonomy shows as a meta box at the side. Pretty basic so far. Now I want to add additional meta boxes below the content on the "...
4
votes
6answers
16k views

How do I get attachment_id?

This is trivial, but I can't really find an answer, I've seen some hints like search in database etc., but this is madness. Basically, I have a metabox with upload button that allows you to upload or ...
1
vote
1answer
17 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
694 views

after checked the checkbox in backend, dont show social link on frontend

I want to do something like if I checked/unchecked a checkbox in admin then all social links in the page footer on fronted hide/show. function add_custom_meta_box() {add_meta_box("demo-meta-box", "...
5
votes
4answers
26k views

How to add add_meta_box to specific Page Template?

I want to add add_meta_box to specific page type like Page Template, Like Product Template. I am using this article http://wp.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes-wordpress/ ...
0
votes
1answer
13 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 ...
1
vote
1answer
700 views

Best choice of options/settings framework for plugin/theme development

My question is what is the best options/settings framework out there now to safely build custom plugin/theme upon? I found the similar question here, but it was asked 7 years ago and definitely, ...
0
votes
1answer
804 views

Adding Meta Box to Specific Submenu Page

I've created this page: function wpdocs_register_my_setting() { add_submenu_page( 'edit.php?post_type=task', 'View Tasks', 'View Tasks', 'manage_options', '...
0
votes
1answer
532 views

Adding to an array & passing it through do_action/apply_filters

For exercise I am working through a PHP class to add meta boxes I found on GitHub. I just copied the code and now I am playing around with it to understand it. It works like this: The file ...
0
votes
1answer
672 views

Metabox value for post loop?

I created metabox.If the checkbox is checked if the posts are listed. How do I browse the posts marked with checkbox ? Metabox Code. Metabox output:
0
votes
2answers
33 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( $...
0
votes
1answer
594 views

Custom metabox does not store data

I'm troubled with a custom metabox, could someone give me a helping hand? I've got a custom post type which uses it, but unfortunately it's not storing the data into the database. Any clue? ...
1
vote
0answers
14 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 ...
1
vote
1answer
562 views

How do you List all Sidebars in a Metabox

I know this question has been answered many times before, including here where i came from so it'll probably be real simple. I've registered my sidebars as normal function wmw_sidebars() { // ...
0
votes
1answer
28 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
17 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
12 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
16 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
vote
1answer
224 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 ...
0
votes
1answer
602 views

saving dropdown menu data on custom post type

I'm following this tutorial on how to make a custom field. I already used it before and it worked, but I only did it for text inputs. Now I'd like to make a drop down menu and I'm unable. The thing ...
0
votes
1answer
666 views

save metabox with new values _wp_page_template

I created a metabox to display the page templates and select a different one with a radiobutton selection. This is a replacement for the current page attributes metabox. I'm missing something with ...
0
votes
1answer
660 views

How to add a custom meta box below publish box in CPT that is like publish meta box and can contains html?

How can i add a custom meta box below publish box in CPT that will be like publish meta box and contain some html code? See the attached shot for more info.
-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 ...
2
votes
1answer
4k views

add_meta_box does not go 'side'

I'm trying to add some metabox to my custom post type. So I add this: add_meta_box( 'my_custom_meta_box_id', 'My-meta-box-title', 'my_custom_meta_box_callback', 'my-custom-post-type'...
1
vote
1answer
589 views

Custom Meta Box (SELECT) Not Saving

I am trying to create a meta box with select options for each page with home-page-template.php assigned to it. I have got that functionality working correctly. I also want it above the editor, below ...
1
vote
2answers
838 views

Wordpress from url get external source title

Hi I am building a news website. I am trying to automate it. News url (metabox) Title Content area Image (featured image option on wordpress) When paste the site url I would like the other metabox ...
41
votes
12answers
60k views

meta_query with meta values as serialize arrays

I'm working on a project in which I'm creating a custom post type and custom data entered via meta boxes associated with my custom post type. For whatever reason I decided to code the meta boxes in ...
1
vote
1answer
662 views

Custom Post Type with Templates using Meta Boxes?

I have this issue where I need a CPT to have several layout options and use templates. Originally, WP does not support templates for custom posts, however I know its possible to do it manually via ...
0
votes
2answers
31 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

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
0answers
17 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
24 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 ...
4
votes
3answers
2k views

Removing panels (meta boxes) in the Block Editor

When the Block Editor was added to WordPress, custom and core meta boxes became legacy, meaning, using the remove_meta_box() function won't work when removing meta boxes/panels displayed on the post ...
1
vote
1answer
28 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
18 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
2 3 4 5
32