Performing the metadata update
This commit is contained in:
1 parent
338b69d4f1
commit
c490219f75
2 files changed
+11
-4
No files matched your search
+8
-1
@@ -57,7 +57,14 @@ function wpdfh_enqueue_admin_scripts() {
|
||||
|
||||
add_action( "wp_ajax_wpdfh_set_print_metadata", "wpdfh_set_print_metadata" );
|
||||
function wpdfh_set_print_metadata(){
|
||||
error_log("PHP: wpdfh_set_print_metadata", 0);
|
||||
error_log("PHP: wpdfh_set_print_metadata, \$_POST:".print_r($_POST, true), 0);
|
||||
$post_id = $_POST['post_id'];
|
||||
$checked = $_POST['checked'];
|
||||
if ($checked == 'true') {
|
||||
update_post_meta($post_id, 'wpdfh.print', 'always');
|
||||
} else {
|
||||
delete_post_meta($post_id, 'wpdfh.print');
|
||||
}
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user