Created
February 19, 2021 09:28
-
-
Save Alimir/0d55227ac6e286590213e54309931d05 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// 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' ) ); | |
} ); |
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
Use this custom CSS if you want to place the button next to it.
.wpulike-is-pro { display: inline-flex !important; }