PluginProbe
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more / 3.7.2
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more v3.7.2
3.7.2 3.7.1 3.7.0 3.6.0 3.6.1 3.5.2 trunk 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.6.0 2.6.1 All 73 releases
← All changes | src/class-stockpackcaptions.php +15 -0 3.6.0 → 3.7.2 View file →
@@ -59,8 +59,9 @@
59 59 public function filters() {
60 60 add_filter( 'stockpack_caption', array( $this, 'add_caption_to_premium' ), 10, 2 );
61 61 add_filter( 'attachment_fields_to_edit', array( $this, 'add_caption_fields' ), 10, 2 );
62 62 add_filter( 'attachment_fields_to_save', array( $this, 'save_caption_fields' ), 10, 2 );
63 + add_filter( 'attachment_fields_to_edit', array( $this, 'add_license_history_link' ), 20, 2 );
63 64 }
64 65
65 66 /**
66 67 *
@@ -151,8 +152,22 @@
151 152 'value' => get_post_meta( $post->ID, 'stockpack_extra', true ),
152 153 'helps' => 'You can use this field to add further description. It will show up first and create a new line',
153 154 );
154 155
156 +
157 + return $form_fields;
158 + }
159 +
160 + public function add_license_history_link( $form_fields, $post ) {
161 + if ( ! get_post_meta( $post->ID, 'stockpack_id', true ) ) {
162 + return $form_fields;
163 + }
164 +
165 + $form_fields['stockpack_license_history'] = array(
166 + 'label' => 'StockPack',
167 + 'input' => 'html',
168 + 'html' => '<a href="' . esc_url( $this->query->dashboard_url( 'license-history?source=plugin' ) ) . '" target="_blank" rel="noopener">' . esc_html__( 'License history', 'stockpack' ) . '</a>',
169 + );
155 170
156 171 return $form_fields;
157 172 }
158 173