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
0 answers
12 views

Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback

I am working with metabox , I have tried to create metabox to a custom post type 'gyms' but I am getting an error , this is my code in functions.php function jaja_location_meta_box() { $screens = ...
user avatar
0 votes
0 answers
12 views

Set parent page based on custom metabox value

I have been working on a code for days already. What I am trying to achieve is I want to assign/set parent page if the value of custom metabox is this. Code for adding my own metabox to the page: ...
user avatar
0 votes
1 answer
23 views

Store custom meta box data as serialized array

I have been trying to find out if it is better to store custom meta box fields for a custom post type individually or as a serialised array. On the web I have seen different approaches but which one ...
user avatar
0 votes
0 answers
13 views

Metabox is not displaying

I am learning plugin development. My code is like below. <?php namespace Inc\Admin; class Admin { public function __construct() add_action( 'admin_menu', [$this,'news_meta_boxes'] ); ...
user avatar
  • 387
0 votes
0 answers
12 views

Wp Meta Query does not work while simple Query Works

I have created a Custom Post Type and added 50+ posts. Now this post type have some meta values which I need to display. Here is how I created the post type: function colorshadescpt() { ...
user avatar
0 votes
2 answers
48 views

Usage of call back function of add_meta_box()

I am learning WordPress Plugin Development. My Code is like below. class Admin { public function __construct() { add_action( 'admin_menu', [$this,'news_meta_boxes'] ); ...
user avatar
  • 387
0 votes
1 answer
38 views

add_post_meta() & update_post_meta()

I am learning WordPress Plugin Development. I need to store Metabox values which are related to Custom Post. In this regard where should I use add_post_meta() & where should I use update_post_meta(...
user avatar
  • 387
0 votes
1 answer
61 views

Display stored value in Meta Box

How to display stored value in Meta Box ? I added Meta Box with below code. add_meta_box('wp_news_settings', 'News Settings', 'news_settings_html', 'news', 'normal', 'default'); My call back function ...
user avatar
  • 387
0 votes
1 answer
52 views

Save Multiple Metabox values

How to Save Multiple Metabox values ? I have 3 fields like below image. Should I use below code ? if (isset($_POST['name'])) { update_post_meta($post_id, 'name', sanitize_text_field($_POST['name']...
user avatar
  • 387
0 votes
0 answers
19 views

Catch metabox values in Plugin

I am learning WordPress Plugin development. I would like to catch values of MetaBox. I found below code in Plugin development Handbook. function wporg_save_postdata( $post_id ) { if ( ...
user avatar
  • 387
0 votes
0 answers
20 views

Save Custom Post Value

I am learning WordPress Plugin Development. I have custom post type News. I am taking input using meta-boxes for this custom post. I added metabox using below code. add_meta_box('news_settings', 'News ...
user avatar
  • 387
0 votes
0 answers
17 views

Publish box in CPT remove 'edit' link

Hello I have a custom post and in the Publish Box I would like to remove the timestamp edit link.
user avatar
0 votes
2 answers
20 views

Have mu-plugin remove meta box ONLY if it isn't already removed in functions.php

I have a mu-plugin that removes a branded "Welcome to X" dashboard meta box placed there by the hosting company I work for. It works fine mostly. However, some of our agency clients are ...
user avatar
  • 1
0 votes
0 answers
11 views

sort metabox columns in listing Single

Hello WordPress community! I modified an existing meta box which is page_attributes. I grafted it to the articles and it allows me to give an order to the posts. I want to add the column to the ...
user avatar
0 votes
0 answers
53 views

want to show CMB2 metabox on woocommerce product data tab

Try to show CMB2 generated metabox on newly created woocommerce product data tab instead of woocommerce_wp_text_input text field function, also added an image that indicate what i want to achive. ...
user avatar
1 vote
1 answer
35 views

Changing custom type name hides the posts [closed]

I created a custom post type. Plugin used is Custom Post Types & Custom Taxonomies plugin which does the job very good. And added some posts to it. But when I modify the name of the newly created ...
user avatar
0 votes
1 answer
27 views

How using the Meta Box plugin, to filter posts by the value of a post type field?

I'm using the Meta Box plugin to create custom post types and fields. There is a record type teachers, and I'm trying to display the lessons associated with him on the page of a certain teacher. The ...
user avatar
  • 1
0 votes
0 answers
24 views

Metaboxes inside Tab

I am learning WordPress Plugin development. In this regard I have to save some settings along with Custom Post in Admin Panel under a Menu. Can I place metaboxes inside tab for this issue like the ...
user avatar
  • 387
0 votes
0 answers
22 views

Why is $_POST empty when saving custom Meta Box?

I'm creating a Meta Box in my custom Plugin where the Administrator can select which users can view a certain post based on their roles. When I select the role and save the meta box content by ...
user avatar
0 votes
1 answer
90 views

Finding the screen id of a page generated with add_menu_page

I'm at a basic level of WordPress + PHP and I'm trying to build a pretty simple plugin. I've set up the plugin correctly, and the plugin page is generated with function wpplugin_settings_page() { ...
user avatar
0 votes
0 answers
17 views

How to avoid saving empty data to sql while using add_meta_box

I'm trying not to save empty data (null) while using add_meta_box function. My code is /** * Register meta boxes. */ function hcf_register_meta_boxes() { add_meta_box( 'hcf-1', __( 'Hello Custom ...
user avatar
0 votes
0 answers
15 views

show a specific metabox dependent on the page template

For a few days I am trying to show a specific metabox dependent on the page template. I can do it but my problem is when I have selected a page template and hit the update button then the metabox does ...
user avatar
0 votes
1 answer
61 views

Meta Box WP_Query array for showing items with a certain relationship

in oxygen I am using a repeater to show posts that have a certain relationship. The advanced query in the relationship is post_type = "custom post type1" and then I add another parameter ...
user avatar
1 vote
1 answer
42 views

Send email button in custom post type backend

I've added a button in the backend of my custom post type editor. I want to send an email using wp_mail() when admin user click a button. I've added this custom form and button to a meta box. See ...
user avatar
0 votes
0 answers
55 views

How to set javascript options for select2 in PHP array of plugin

I'm using two different jQuery plugins that I'm trying to get to work together. It should be possible since they come bundled together. The first plugin is the Metabox.io plugin for creating metaboxes....
user avatar
1 vote
1 answer
56 views

Save / Show multi line text in metabox

In a plugin I have made (Snup Widget) I have made a metabox. In the sample here I have made two line with text. When I want to show the text in output in the widget it shows in one line, without break....
user avatar
  • 21
0 votes
0 answers
22 views

Custom Meta box change size

I a plugin that I have made (SNUP Widget) there is a strange error. When I use widescreen monitor this custom meta box I made looks ok. But with I open browser on my PC with split screen that is not ...
user avatar
  • 21
0 votes
0 answers
11 views

I can not display meta value in extras.php and template-tags.php

I have page template that stores reservation input fields, I would like add link to that specific page using meta box but my meta box doesnt work in extras.php and meta-tags.php, I would like to know ...
user avatar
0 votes
0 answers
38 views

ACF - Hiding metaboxes through screen settings doesn't work

Hiding ACF metaboxes through screen settings seems to be properly saved in user settings (wp_usermeta.meta_key = 'metaboxhidden_{contentType}): +--------+-------+----------------------+----------------...
user avatar
0 votes
0 answers
12 views

Custom Post Type meta data getting deleted on bulk editing taxonomies

I am facing a weird issue while editing custom post types. I created a Custom Post Type and a taxonomy linked to it. Posts are attached to their respective taxonomy terms. I also added some meta data ...
user avatar
0 votes
0 answers
66 views

Add a Metabox checkbox to the Page Edit screen of wp-admin , which only certain roles can see and Makes only certain roles able to Edit said page

UPDATE Please Read Past my Phases to see development and new questions! Currently on Phase 3 PHASE 1 - resolved so far Ive tried to code it myself, and Ive added this into functions.php, but there is ...
user avatar
  • 1
0 votes
1 answer
26 views

Custom Post Meta from custom metaboxes is randomly being deleted

For a while now I've been applying and updating some custom metaboxes that my company re-uses on different sites. (Not the same metaboxes, but the same methodology.) Essentially it allows for the '...
user avatar
  • 1,866
0 votes
0 answers
14 views

Checkbox doesn't save inside metabox

I have a repeatable fields metabox which includes a checkbox input. I have an issue when saving the metabox in the admin. The checkbox value doesn't save. Here is the PHP code: <?php add_action( '...
user avatar
0 votes
0 answers
9 views

Display default matabox of posts(add category) wordpress

I'm trying to make a custom page that will add posts. And I have a little problem. How can I display adding categories in page(in my template) for a post as in the admin panel
user avatar
  • 1
0 votes
0 answers
20 views

Create post meta box that links another post

I have Posts that act as movie reviews. I also have custom post types 'movies' that have detailed information on said movie. What I would like to do is add a custom meta box to the Posts (movie ...
user avatar
  • 101
0 votes
0 answers
40 views

WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit

I'm trying to display a WP_List_table inside a metabox. The metabox is for questions which are from assessment_question custom post type.The metabox is being displayed on an other custom post type '...
user avatar
0 votes
1 answer
14 views

How to insert data into meta box from another plugin?

I have two different plugins. My custom-post-type is on the first plugin and it has some meta boxes. Now in the second plugin, I extracted the email using IMAP and stored it in the post type of the ...
user avatar
0 votes
0 answers
9 views

Select input in metabox not updated

I try to figure it out why my select input did not update the value. I have placed the select input in the header of a metabox, the same what Woocommerce did with the producttype selector. ...
user avatar
0 votes
0 answers
41 views

Save Meta when custom Taxonomy Saves

I am in need of some advice, we are setting up a custom tag for Movies. We want to have it pull from the OMDB Api when it is saved. We have the function setup, but it is not firing, and I am stumped. ...
user avatar
0 votes
1 answer
28 views

how to prevent added meta box from being injected with style="position: fixed; top: 56px;" at scroll down

This is my first attempt to customize WordPress. I added a meta box like this function settings_metabox() { //register custom meta box add_meta_box("mybox-id", "Settings", &...
user avatar
  • 111
1 vote
1 answer
27 views

can i fetch a custom metabox data in another page or post type?

I need to fitch a metabox field data in another page , $headabouttitle1 = get_post_meta(get_the_id(), 'head_title1', true); this is how i fetch it in the same page , I need to fitch it in another ...
user avatar
0 votes
1 answer
40 views

Saving a Custom Post Type with a Meta Box results in a "Updating Failed" error

I have a Custom Post Type (Favourites) which I plan on using to talk about my favourite craft products. The meta box field I want to have is a link to an online store listing, so users can buy the ...
user avatar
0 votes
0 answers
16 views

how to update post content field in wordpress

i have used add meta boxes to customize page content and use wp_update_post to save it. when im creating new page in wordpress it inserts two new record in wp_posts table. one of them has published ...
user avatar
0 votes
0 answers
26 views

meta box pop up upload button wont work

I want to upload multiple images for portfolio, but upload button wont pop up at all, but when I remove PHP codes and add HTML codes instead it works then. I think PHP foreach method has a code error, ...
user avatar
0 votes
0 answers
16 views

Translate dashboard metabox

I create a dashboard metaboxes for the last published and drafted pages below the code i use : #dahsboard metaboxes #Last edited pages add_action( 'wp_dashboard_setup', '...
user avatar
  • 284
0 votes
0 answers
24 views

Dropdown category field inside repeatable metabox

I'm building a repeatable metabox with different fields in the Page editor: Name, Email, Tag, Categories. To display the dropdown category field inside the metabox I use wp_dropdown_categories(); The ...
user avatar
0 votes
0 answers
27 views

Create shortcode for metabox gallery

I have a metabox gallery in a custom post type. Usually I display the gallery in the front end using the following PHP code in my theme: $gallery_images_1 = get_post_meta( $post->ID, '_post-metabox-...
user avatar
0 votes
0 answers
17 views

Preset custom fields

I'm creating a wordpress plugin which will create a custom post with custom fields like "time", "rating" etc whose will be fillable in admin. So far all tutorials I've seen only ...
user avatar
0 votes
0 answers
21 views

Add metabox if there is at least one post available

So I am building a WordPress Dashboard widget which will showcase all posts & pages where a Gutenberg Block is active. The below code does it's job and pulls in an array based on get_posts(). Here ...
user avatar
  • 15
1 vote
1 answer
343 views

update post meta for checkbox in the admin when inserted in the front-end

Here's my problem, I allow a certain user type to create custom post type in the front-end of my site, with the wp_insert_post() function... users can put values within a form and there's couple of ...
user avatar
  • 13

1
2 3 4 5
33