Skip to content

Commit 28c6f44

Browse files
committed
Add link to mismatches on the plugins page
1 parent 4c66dfa commit 28c6f44

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

plugins/bcc-keep-translated-posts-status-same-as-original/bcc-keep-translated-posts-status-same-as-original.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* Plugin Name: BCC – Keep translated posts' status same as original
4-
* Description: Ensures translated posts imported from Phrase (and any WPML saves) inherit the source post's status (e.g. draft, publish). This is done to avoid the use-case when an email is sent to post groups in e.g. English before Norwegian is ready to go (published). In addition, this plugin creates a settings page where admins can see which translated posts have different post statuses than the original posts.
4+
* Description: Ensures translated posts imported from Phrase (and any WPML saves) inherit the source post's status (e.g. draft, publish). This is done to avoid the use-case when an email is sent to post groups in e.g. English before Norwegian is ready to be published. In addition, this plugin creates a settings page where admins can see which translated posts have different post statuses than the original posts.
55
* Author: BCC IT
66
* Version: 1.6.5
77
*/
@@ -35,6 +35,7 @@ private function __construct() {
3535
add_filter( 'wp_insert_post_data', array( $this, 'bcc_filter_on_wp_insert_post_data' ), 20, 2 );
3636
add_action( 'wpml_pro_translation_completed', array( $this, 'bcc_action_wpml_translation_completed' ), 20 );
3737
add_action( 'admin_menu', array( $this, 'bcc_post_status_mismatch_settings_page' ) );
38+
add_filter( 'plugin_action_links_' . $this->plugin, array( $this, 'add_mismatches_link' ) );
3839
}
3940

4041
/**
@@ -137,6 +138,15 @@ function bcc_post_status_mismatch_settings_page() {
137138
);
138139
}
139140

141+
/**
142+
* Add settings link to plugin actions on plugins page.
143+
*/
144+
function add_mismatches_link( $links ) {
145+
$settings_link = '<a href="' . admin_url( 'options-general.php?page=bcc-post-status-mismatch' ) . '">' . __( 'Mismatches' ) . '</a>';
146+
array_unshift( $links, $settings_link );
147+
return $links;
148+
}
149+
140150
/**
141151
* Helper: get source post for a given translated post ID.
142152
*/

0 commit comments

Comments
 (0)