Skip to content

Commit

Permalink
fix: access Give_Donor_Wall class object with get_instance
Browse files Browse the repository at this point in the history
ref #3546
  • Loading branch information
ravinderk committed Sep 18, 2018
1 parent 6c5e3e7 commit 784a0fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions blocks/donor-wall/class-give-donor-wall.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ public function render_block( $attributes ) {
'show_comments' => $attributes['showComments'],
);

$donor_wall = new Give_Donor_Wall();

return $donor_wall->render_shortcode( $parameters );
return Give_Donor_Wall::get_instance()->render_shortcode( $parameters );
}
}

Expand Down
4 changes: 1 addition & 3 deletions includes/api/class-give-api-v2.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ public function get_donation_grid( $request ) {
public function get_donor_wall( $request ) {
$parameters = $request->get_params();

$donor_wall = new Give_Donor_Wall();

return $donor_wall->render_shortcode( $parameters );
return Give_Donor_Wall::get_instance()->render_shortcode( $parameters );
}

/**
Expand Down
4 changes: 1 addition & 3 deletions includes/class-give-donor-wall-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ public function widget( $args, $instance ) {
echo $before_title . $title . $after_title;
}

$gravatars = new Give_Donor_Wall();

echo $gravatars->gravatars( get_the_ID(), null ); // remove title
echo Give_Donor_Wall::get_instance()->gravatars( get_the_ID(), null ); // remove title

// Used by themes. Closes the widget
echo $after_widget;
Expand Down
2 changes: 1 addition & 1 deletion includes/donors/class-give-donor-wall.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Give_Donor_Wall {
* @since 2.2.0
* @access private
*/
public function __construct() {
private function __construct() {
}


Expand Down

0 comments on commit 784a0fd

Please sign in to comment.