Forked from femiyb/my-pmpro-change-seat-to-student.php
Last active
January 13, 2022 19:36
-
-
Save kimwhite/38a76098c5254750ccaf68ec0ebe253a to your computer and use it in GitHub Desktop.
Change the word "Seat(s)" to "student(s)" for Paid Memberships Pro Sponsored Members Add On.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do not copy this line. | |
/** | |
* This will change all instances of seat(s) to student(s) for the Sponsored Members Add On | |
* https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/ | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_change_seat_to_student( $output_text, $input_text, $domain ) { | |
if ( 'pmpro-sponsored-members' === $domain ) { | |
$output_text = str_replace( 'seats', 'students', $output_text ); | |
$output_text = str_replace( 'Seats', 'Students', $output_text ); | |
$output_text = str_replace( 'seat', 'student', $output_text ); | |
} | |
return $output_text; | |
} | |
add_filter( 'gettext', 'my_pmpro_change_seat_to_student', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment