Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'streamtube/core/mycred/button_donate', function( $args ){
- $args['button_classes'][] = 'ms-sm-auto';
- return $args;
- }, 10, 2 );
- add_action( 'streamtube/core/mycred/button_donate/before', function( $args ){
- $author = 0;
- if( is_singular( 'video' ) ){
- global $post;
- $author = $post->post_author;
- }
- if( is_author() ){
- $author = get_queried_object_id();
- }
- $total_points = mycred_display_users_balance( $author );
- if( $total_points ){
- ?>
- <span class="total-points d-block mb-2 text-secondary">
- <?php
- printf(
- esc_html__( '%s collected %s', 'streamtube-child' ),
- '<strong class="text-secondary">'. get_userdata( $author )->display_name .'</strong>',
- '<strong class="text-info">$'. number_format_i18n( $total_points ) .'</strong>'
- );
- ?>
- </span>
- <?php
- }
- }, 10, 1 );
- add_action( 'wp_footer', function(){
- ?>
- <style type="text/css">
- @media (max-width: 768px){
- body.author .button-donate-wrap{
- text-align: center;
- }
- body.author .button-donate-wrap .button-group button{
- margin: 0 auto!important;
- }
- }
- </style>
- <?php
- } );
Add Comment
Please, Sign In to add comment