PluginProbe
Polylang / 2.5
Polylang v2.5
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | modules/sync/sync-post-metas.php +8 -18 3.0.12.5 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 4 * A class to manage copy and synchronization of post metas
8 5 *
@@ -8,13 +5,8 @@
8 5 *
9 6 * @since 2.3
10 7 */
11 8 class PLL_Sync_Post_Metas extends PLL_Sync_Metas {
12 - /**
13 - * Stores the plugin options.
14 - *
15 - * @var array
16 - */
17 9 public $options;
18 10
19 11 /**
20 12 * Constructor
@@ -33,17 +25,17 @@
33 25 add_filter( 'pll_translate_post_meta', array( $this, 'translate_thumbnail_id' ), 10, 3 );
34 26 }
35 27
36 28 /**
37 - * Get the custom fields to copy or synchronize.
29 + * Get the custom fields to copy or synchronize
38 30 *
39 31 * @since 2.3
40 32 *
41 - * @param int $from Id of the post from which we copy informations.
42 - * @param int $to Id of the post to which we paste informations.
43 - * @param string $lang Language slug.
44 - * @param bool $sync True if it is synchronization, false if it is a copy.
45 - * @return string[] List of meta keys.
33 + * @param int $from Id of the post from which we copy informations
34 + * @param int $to Id of the post to which we paste informations
35 + * @param string $lang Language slug
36 + * @param bool $sync True if it is synchronization, false if it is a copy
37 + * @return array List of meta keys
46 38 */
47 39 protected function get_metas_to_copy( $from, $to, $lang, $sync = false ) {
48 40 // Copy or synchronize post metas and allow plugins to do the same
49 41 $metas = get_post_custom( $from );
@@ -64,13 +56,11 @@
64 56 $keys[] = $meta;
65 57 }
66 58 }
67 59
60 + // Random header image
68 61 if ( $this->options['media_support'] ) {
69 - $keys[] = '_wp_attached_file';
70 - $keys[] = '_wp_attachment_metadata';
71 - $keys[] = '_wp_attachment_backup_sizes';
72 - $keys[] = '_wp_attachment_is_custom_header'; // Random header image
62 + $keys[] = '_wp_attachment_is_custom_header';
73 63 }
74 64
75 65 /** This filter is documented in modules/sync/sync-metas.php */
76 66 return array_unique( apply_filters( 'pll_copy_post_metas', $keys, $sync, $from, $to, $lang ) );