Skip to content

Instantly share code, notes, and snippets.

@LC43
Created March 1, 2024 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LC43/8114af146e750cb99ccf43937bb36e9d to your computer and use it in GitHub Desktop.
Save LC43/8114af146e750cb99ccf43937bb36e9d to your computer and use it in GitHub Desktop.
meta box
/** button actions */
function render_point_actions_meta_box( $post ) {
// Display the save button
$button = sprintf(
'<input type="submit" name="save_custom" id="save_custom" class="" value="%1$s">',
esc_html__( 'Save', 'iglobes' )
);
printf( '<div class="custom-save-button">%1$s</div>', $button );
}
add_action( 'add_meta_boxes', 'iglobes_point_meta' );
function iglobes_point_meta() {
add_meta_box(
'point_actions_meta_box', // id
'Actions', // title
'render_point_actions_meta_box', // callback
'iglobe_points', // screen
'side', // context
'high' // priority
);
}
/*
or, to add to the settings:
in src/models/points.php:80
'save' => array(
'type' => 'callback',
'function' => 'render_consultation_actions_meta_box',
),
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment