Skip to content

Instantly share code, notes, and snippets.

@rilwis
Created September 19, 2023 15:11
Show Gist options
  • Save rilwis/af699bcf48cdcd4d17a5c2c402187ed3 to your computer and use it in GitHub Desktop.
Save rilwis/af699bcf48cdcd4d17a5c2c402187ed3 to your computer and use it in GitHub Desktop.
Test WP update button always active
<?php
// This code shows a simple meta box with a simple text, no inputs.
// And the "Update" button in WordPress is always active, e.g. never disabled, even if there's no changes, no updates.
add_action( 'add_meta_boxes', function() {
add_meta_box( 'test', 'Test', 'my_callback_func', 'post' );
} );
function my_callback_func() {
echo 'Just a text, and the Update button is always active.';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment