| @@ -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 | |