Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
How the fuck do i save metabox input value in database.
This is my code:
add_action( 'add_meta_boxes', 'Wp_metabox' );
add_action('save_post', 'wp_custom_save');
function Wp_metabox()
{
add_meta_box(
'wp_custom__metabox',
'Custom Meta Box Title',
'wp_custom_metabox_callback',
'slider',
'advanced',
);
}
function WP_custom_metabox_callback($post)
{
<input id="text"
type="text" value="text" />
}
function wp_custom_save($post_id)
{
$text = sanitize_text_field($_POST['text']);
update_post_meta($post_id, '_text', $text);
}
How in the fuking world do i get the input value of the field and then save the value in database? There is no documentation for this shit.
question
metabox
wordpress