Skip to content

Instantly share code, notes, and snippets.

@afragen
Created March 16, 2022 01:29
Show Gist options
  • Save afragen/4574e1ce54a621351e5eb18ac686f8f3 to your computer and use it in GitHub Desktop.
Save afragen/4574e1ce54a621351e5eb18ac686f8f3 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: GlotPress for Git Updater
* Plugin URI: https://gist.github.com/afragen/4574e1ce54a621351e5eb18ac686f8f3
* Description: This plugin is used for site testing.
* Version: 0.1
* Author: Andy Fragen
* License: MIT
* Requires at least: 5.2
* Requires PHP: 7.1
* Gist Plugin URI: https://gist.github.com/afragen/4574e1ce54a621351e5eb18ac686f8f3
* Requires Plugins: glotpress
*/
add_filter(
'gp_nav_menu_items',
function( $items, $location ) {
$arr = [ '/wp-admin/' => 'Dashboard' ];
if ( 'side' === $location ) {
$items = array_merge( $arr, $items );
}
return $items;
},
10,
2
);
add_filter(
'gp_home_title',
function() {
return 'GlotPress for Git Updater';
}
);
add_action(
'gp_after_notices',
function() {
printf(
'<div class="notice-info notice" style="text-align:center;"><p>'
/* translators: 1: email link */
. esc_html__( 'If you wish to be a language validator, please email with your user name and the language locale(s) at %s' )
. '</p></div>',
'<a href="mailto:andy@git-updater.com?subject=Git Updater GlotPress Validator Request">Request to be a Validator</a>'
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment