PluginProbe
WP Ultimate Post Grid / 2.4.0
WP Ultimate Post Grid v2.4.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
← All changes | helpers/post_save.php +11 -1 1.72.4.0 View file →
@@ -4,10 +4,17 @@
4 4
5 5 public function __construct()
6 6 {
7 7 add_action( 'save_post', array( $this, 'save' ), 10, 2 );
8 + add_action( 'edit_attachment', array( $this, 'save_attachment' ) );
8 9 }
9 10
11 + public function save_attachment( $post_id )
12 + {
13 + $post = get_post( $post_id );
14 + $this->save( $post_id, $post );
15 + }
16 +
10 17 public function save( $post_id, $post )
11 18 {
12 19 if( $post->post_type != WPUPG_POST_TYPE )
13 20 {
@@ -16,9 +23,12 @@
16 23 }
17 24
18 25 // Basic metadata
19 26 $fields = array(
20 - 'wpupg_custom_link'
27 + 'wpupg_custom_link',
28 + 'wpupg_custom_link_behaviour',
29 + 'wpupg_custom_image',
30 + 'wpupg_custom_image_id',
21 31 );
22 32
23 33 foreach ( $fields as $field )
24 34 {