Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // atbdp_import_listing on tools.php
- foreach ($metas as $index => $value) {
- $meta_value = $post[$value] ? $post[$value] : '';
- $meta_value = $this->maybe_unserialize_csv_string($meta_value);
- // if ($index == 'social_facebook' && !empty($meta_value)) {
- // $social = array(
- // array(
- // 'id' => 'facebook',
- // 'url' => $meta_value
- // )
- // );
- // $index = 'social';
- // $meta_value = $social;
- // }
- if ($index == 'social') continue;
- if (strpos($index, 'social_') !== false) {
- $social_key = substr($index, strpos($index, "social_") + 7);
- $social_info = get_post_meta($post_id, '_social', true) ? get_post_meta($post_id, '_social', true) : array();
- array_push(
- $social_info,
- array(
- 'id' => $social_key,
- 'url' => $meta_value
- )
- );
- $index = 'social';
- $meta_value = $social_info;
- }
- if ($meta_value) {
- update_post_meta($post_id, '_' . $index, $meta_value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment