Skip to content

Commit

Permalink
added new function wpt_get_base64_post_meta( $post_id )
Browse files Browse the repository at this point in the history
  • Loading branch information
codersaiful committed May 10, 2021
1 parent 879ad2e commit 14dacf7
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions admin/post_metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,18 @@ function wpt_shortcode_metabox_render(){
function wpt_export_import_metabox_render(){
global $post;
$post_id = $post->ID;
//update_post_meta($post_id, $meta_key, $post_id);
$meta = get_post_meta($post_id);
unset($meta['_edit_lock']);
unset($meta['_edit_last']);

$meta = array_map('array_filter', $meta);
$meta = array_filter($meta);

$serialize_meta = serialize($meta);
$base64_meta = base64_encode($serialize_meta);
// The following code has Transferred to admin/functions.php
// $meta = get_post_meta($post_id);
// unset($meta['_edit_lock']);
// unset($meta['_edit_last']);
//
// $meta = array_map('array_filter', $meta);
// $meta = array_filter($meta);
//
// $serialize_meta = serialize($meta);
// $base64_meta = base64_encode($serialize_meta);

$base64_meta = wpt_get_base64_post_meta( $post_id );

$post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/',"$1", $post->post_title );
?>
Expand Down

0 comments on commit 14dacf7

Please sign in to comment.