Skip to main content

All Questions

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

How to consume external API from WordPress post editor and display the response data in the custom field?

I am developing a custom post type called "Team," where I will add some profiles of team members. I am using ACF for the custom field to add personal details of the members (I can also ...
Rousnay's user avatar
0 votes
1 answer
64 views

Saving metabox updates causing fatal error

I'm teaching myself from a plugin tutorial dvd, everything was going fine. I've setup custom_post_types and the metaboxes with no issues. The issue i have is a fatal error when i update/publish the ...
fuzzy2023's user avatar
0 votes
0 answers
64 views

Meta box not displaying on the plugin page

I am working on a plugin and I am creating a meta box on my page using the below code but it's not displaying anything. Any idea where is the issue with my code? class bt_dashboard { function ...
Naren Verma's user avatar
0 votes
1 answer
273 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 ...
user8463989's user avatar
0 votes
2 answers
745 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'] ); ...
Foysal's user avatar
  • 445
0 votes
1 answer
167 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']...
Foysal's user avatar
  • 445
0 votes
0 answers
156 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 ...
user3716433's user avatar
1 vote
1 answer
339 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....
bjovaar's user avatar
  • 21
0 votes
1 answer
315 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 ...
bjovaar's user avatar
  • 21
0 votes
0 answers
186 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 '...
Muhammad Faizan Haidar's user avatar
0 votes
1 answer
26 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 ...
Rohit kc's user avatar
1 vote
1 answer
1k 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 ...
T3mmX's user avatar
  • 23
0 votes
1 answer
101 views

submit two file input fields in the same form

I have a form which has two file input fields, each input should be submitted in different metabox in custom post type, when I try to submit the form it takes only the first one and ignore the second ...
yahya Elgoud's user avatar
0 votes
1 answer
39 views

WP nonce field checkbox prints checked='checked' outside input field

I'm currently creating a custom post type in wich I want to add some custom meta boxes. All the fields just go as expected excepting a checkbox field wich prints on the html checked='checked' after ...
Hugo Montoya Vazquez's user avatar
0 votes
1 answer
34 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. ...
Neeraj Prasad's user avatar
1 vote
1 answer
760 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 ...
Mark's user avatar
  • 11
0 votes
1 answer
29 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', '...
Jason Is My Name's user avatar
0 votes
1 answer
160 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 ...
Daniel's user avatar
  • 11
1 vote
0 answers
34 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 ...
I dont believe you's user avatar
0 votes
1 answer
32 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....
I dont believe you's user avatar
0 votes
1 answer
375 views

WP_List_Table Inside Metabox Not Working on Clicking Search Button

I'm trying to display a WP_List_table inside a metabox. The metabox is for listing registered users to a course(LifterLMS Course Post Type). The table columns contain user_id, user_name, percentage &...
Muhammad Faizan Haidar's user avatar
0 votes
1 answer
40 views

Custom Meta Box returns no HTML

I'm trying to write my first plugin and running into an issue with the callback in add_meta_box(). The meta box appears on the custom post type page however there is no content inside. Here is the ...
Isaac's user avatar
  • 43
0 votes
0 answers
73 views

Wordpress Filesystem create CSS-File - get Shortcode ID for Name

My Script creates an CSS File when i save the post with the shortcode ID at the end of the filename. e.g. (test-293.css) The Problem is, that i need to register this individual File in my frontend and ...
Artisolution's user avatar
3 votes
1 answer
735 views

add_meta_boxes action with refresh on save

I've created a meta box using add_meta_boxes action and it works when I open any post to edit it. add_action('add_meta_boxes', function() { add_meta_box( ... ); }); When WP auto ...
Adriano Castro's user avatar
2 votes
1 answer
957 views

How to get Metabox custom field to show checked if value is updated using post meta query?

I have two radio buttons as custom metabox fields for pages/posts. One radio button has the value of "enable" and the other has the value of "disable". My radio buttons will stay checked only if I ...
Esmond's user avatar
  • 25
0 votes
1 answer
55 views

Getting data from dynamically allocated metaboxes within a custom post

I need to dynamically allocated metaboxes for a data entry type feature. Each Metabox represents a set of data associated with member such as name, address, city etc. Not sure what I am doing ...
Debbie Kurth's user avatar
0 votes
1 answer
398 views

How to save multiple values in custom post type from front end to back end

i created a plugin in WordPress , i created custom post type called "invoices" here it's the code add_action('init', 'invoices_register'); function invoices_register() { $labels = array( '...
user2631855's user avatar
2 votes
2 answers
1k views

Adding Meta Boxes while Registering a Post Type in a Class

I am trying to add a few meta boxes for a Custom Post Type through a Class. I am using the "register_meta_box_cb" parameter while registering the Custom Post Type to specify the callback function for ...
Omkar Totade's user avatar
1 vote
1 answer
2k views

How do I update a field of a meta box?

While parsing data from a CVS file into a custom post type, i would like to parse data into the fields of a meta box, that I created. The meta box fields are normally updated like this: function ...
Dougless's user avatar
0 votes
1 answer
237 views

add_meta_box does not display meta box in Admin

I have two wordpress sites: running on localhost server (PHP7.3) hosted on Bluehost.com (PHP7.2) The metabox gets added on my local website, but the same piece of code does not work on bluehosted ...
Morgan Janjua Crane's user avatar
0 votes
1 answer
183 views

Add Wordpress Meta Box saved form input to Wordpress RSS feed [duplicate]

I'm teaching myself how to build Wordpress plugins. I found a great guide to creating a Wordpress Meta Box and saving the form input from it. https://themefoundation.com/wordpress-meta-boxes-guide/ ...
Paul Henshaw's user avatar
0 votes
1 answer
344 views

Admin metabox with custom post type dropdown option not update choosed input after saving

I'm trying to build a little plugin for wp that add a button to custom post type page http://example.com/events that have a link to another custom post type page that I can choose from a dropdown menu ...
Gianfabio Pezzolla's user avatar
0 votes
1 answer
458 views

How to Use Custom Meta Field Instead of CPT Title in Post URL

I have a custom Post Type which is not using any of WP builtin supports like( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ). Instead I am using my own metaboxes to publish the CPT. ...
Mona Coder's user avatar
0 votes
1 answer
22 views

How to add custom post widgets as tags into wordpress

I want to make same functionality as tags working into a post. I want to add some custom file to be add as downloads, where i can add images/files/pdf from a URL, and it will saved as tags, we can ...
Manish Agarwal's user avatar
2 votes
1 answer
1k 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, ...
Oksana Romaniv's user avatar
1 vote
1 answer
943 views

Save or update data when custom post published

I have metabox on my custom post screen. How to save them when any of them are checked and then use or echo those checked offers to display on single.php? my code for metabox is function ...
Nimesh's user avatar
  • 441
0 votes
0 answers
79 views

set a custom post type to a taxonomy term programmatically in metabox

I have a Custom Post Type called Movies and it has a Custom Taxonomy called Genres. I also have 3 Terms under Genres called ['Action','Comedy','Horror'] Can you please let me know how I can Get and ...
Suffii's user avatar
  • 201
1 vote
1 answer
173 views

Input value from metabox is not found in $_POST after post save

What I want to do is grab the input from a metabox — a number to be exact — in the post editor area and save it to a custom table I have previously created. Here it is my code for declaring the ...
haunted85's user avatar
  • 119
0 votes
1 answer
30 views

Dynamically getting tags in post edit screen

I am trying to dynamically get the post's tags as the user adds them while editting a post, but I have not found any hook related to that action. I know I can make my own hooks, but the thing is that ...
Zeko's user avatar
  • 1
1 vote
1 answer
24 views

How can I make my metabox appear?

I'm fairly new to plugin development but have experience in coding. I've looked into several tutorials and managed to get my post type as slideshows, but I wanted to add a metabox to put an URL in. ...
manoukmade's user avatar
0 votes
1 answer
680 views

How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]

I'm using CMB2 (https://github.com/CMB2/CMB2) for add new meta to post types. I'm trying to add a new custom meta with a list of posts grouped by taxonomy, but I do not know how to save them. I would ...
xechino's user avatar
  • 23
0 votes
1 answer
291 views

php output of generated custom metabox

I have used WordPress Meta Box Generator v2 Beta website to generate a custom meta box to upload a custom image file in to custom post and in admin side everything seems to work fine but I can not to ...
Prusakov's user avatar
  • 125
1 vote
1 answer
347 views

How to inform the user that the save was not successful?

When saving a post, i have a meta box in which the user must put something. If the user input is something when i do not accept, how will i tell him? add_action('save_post' , 'my_save_metaboxe_data');...
Shake-the-World's user avatar
1 vote
1 answer
484 views

How to use TinyMCE Editor for one of my custom post meta field?

I'm registering a new post type register_post_type('datasheet', [ ...., 'register_meta_box_cb' => [ $this, "add_metaboxes" ] ]); Adding metaboxes function add_metaboxes ( $WP_Post ...
realtebo's user avatar
  • 267
0 votes
0 answers
194 views

Custom meta box in editor of custom post type not working

I made a plugin using a custom post type, then I added a shortcode to display a specific post of that type in any page the user wants to. Now I want to put a meta box in the editor page so the user ...
Julián Bonilla's user avatar
5 votes
1 answer
8k views

Save metabox with multiple checkbox array

I have a requirement where the number of checkboxes outputted in the metabox is not fixed. Had it been fixed, I could've followed any one of the tutorials on the internet which suggests I name each ...
Siddharth Thevaril's user avatar
2 votes
2 answers
516 views

How to: add option to add more checkboxes on custom post type

I have created a custom post type where in one of the metaboxes I have checkboxes where author can select what he would like to add on the post. Now, if the author wants to add something that is not ...
Abdul Qadeer's user avatar
0 votes
1 answer
40 views

How to show metabox just in post.php in admin?

I want to show my metabox in post.php?action=edit not in post-new.php. How can I do that?
user3725280's user avatar
3 votes
2 answers
3k views

how to set default value for checkbox in wordpress

I am facing a problem to set default value for the checkbox field in WordPress. I have a checkbox input field (metabox) in a custom post. I want the checkbox to be checked by default. and if user ...
Kamal Ahmed's user avatar
2 votes
3 answers
3k views

Metabox Not Showing on Custom Post Type But On Pages and Post

I have a Custom Post Type like function cpt_Projects() { $labels = array( 'name' => 'Projects', 'singular_name' => 'Project', 'menu_name' ...
Behseini's user avatar
  • 525