Skip to content

Instantly share code, notes, and snippets.

@Alimir
Created February 19, 2021 09:28
Show Gist options
  • Save Alimir/0d55227ac6e286590213e54309931d05 to your computer and use it in GitHub Desktop.
Save Alimir/0d55227ac6e286590213e54309931d05 to your computer and use it in GitHub Desktop.
<?php
// Add text/html before button
add_action( 'wp_ulike_before_template', function(){
echo sprintf( '<span>%s</span>', __( 'Like me', 'wp-ulike' ) );
} );
// Add text/html after button
add_action( 'wp_ulike_after_template', function(){
echo sprintf( '<span>%s</span>', __( 'Like me', 'wp-ulike' ) );
} );
@Alimir
Copy link
Author

Alimir commented Mar 25, 2021

Here is another example to limit to a specific type. (you can also use: comment, activity, topic values)

add_action( 'wp_ulike_after_template', function( $args ){
	if( $args['type'] === 'post' ){
		echo sprintf( '<span>%s</span>', __( 'Like me', 'wp-ulike' ) );
	}
} );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment