Skip to content

Commit 8d8baec

Browse files
author
Maxime CULEA
committed
Merge branch 'export-import-title-handle'
2 parents d013055 + f6a7c1e commit 8d8baec

File tree

7 files changed

+1207
-1203
lines changed

7 files changed

+1207
-1203
lines changed

classes/admin/class-import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function __construct() {
99
}
1010

1111
public static function admin_menu() {
12-
$hook = add_submenu_page('edit.php?post_type=member', __('Import / Export members', 'mpt'), __('Import / Export members', 'mpt'), 'manage_options', 'member-import-export', array( __CLASS__, 'page' ));
12+
$hook = add_submenu_page('edit.php?post_type=member', MPT_Admin_Post_Type::get_import_export_title_page(), MPT_Admin_Post_Type::get_import_export_title_page(), 'manage_options', 'member-import-export', array( __CLASS__, 'page' ));
1313
add_action( 'admin_head-'.$hook, array( __CLASS__ , 'admin_head' ) );
1414
}
1515

classes/admin/class-post-type.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,27 @@ public static function redirect_post_location( $location, $post_id ) {
320320
public static function get_connection_type(){
321321
return apply_filters( 'mpt_connection_type', array( 'default' => __( 'Username / Mail', 'mpt' ) ) );
322322
}
323+
324+
/**
325+
* Get the import/export page title depending on which part is activated
326+
*
327+
* @author Maxime CULEA
328+
*
329+
* @since 0.5.10
330+
*
331+
* @return string
332+
*/
333+
public static function get_import_export_title_page() {
334+
$title = _x( 'members', 'Members title part on "Import / Export members" page', 'mpt' );
335+
336+
$title_parts = array();
337+
if( ! apply_filters( 'mpt_admin_hide_import', false ) ) {
338+
$title_parts[] = _x( 'Import', 'Import title part on "Import / Export members" page', 'mpt' );
339+
}
340+
if( ! apply_filters( 'mpt_admin_hide_export', false ) ) {
341+
$title_parts[] = _x( 'Export', 'Export title part on "Import / Export members" page', 'mpt' );
342+
}
343+
344+
return esc_html( ! empty( $title_parts ) ? implode( $title_parts, ' / ' ) . ' ' . $title : $title );
345+
}
323346
}

languages/mpt-fr_FR.mo

-34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)