-
-
Save tommcfarlin/356c70c37202d3b93ba31dd5ee981e8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Save the options in the meta box. | |
* | |
* @since 1.0.0 | |
* | |
* @param int $post_id The ID of the current post | |
*/ | |
public function save( $post_id ) { | |
// Note: Guard clauses removed for readability. | |
// Assume $metadata is set earlier in this function. | |
update_post_meta( $post_id, 'acme-custom-meta-data', $metadata ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Save the options in the meta box. Ignore the action if it's coming from the | |
* Bulk Edit screen. | |
* | |
* @since 1.0.0 | |
* | |
* @param int $post_id The ID of the current post | |
*/ | |
public function save( $post_id ) { | |
// Note: Guard clauses removed for readability. | |
// Assume $metadata is set earlier in this function. | |
if ( isset( $_POST['_inline_edit'] ) ) { | |
return; | |
} | |
update_post_meta( $post_id, 'acme-custom-meta-data', $metadata ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment