Support » Plugin: Site Reviews » post_id fpr widgets

  • Resolved Kapsonfire

    (@kapsonfire)


    First of all, the ‘SiteReviews’ Widget doesnt check for post_id in ‘assigned_to’ – i added the code like the ‘SiteReviewsForm’ to check for it.

    public function widget( $args, $instance )
    	{
    		$defaults = [
    			'assigned_to' => '',
    			'category'    => '',
    			'class'       => '',
    			'count'       => '5', // count
    			'display'     => '',
    			'hide'        => [],
    			'rating'      => '1', // rating
    			'title'       => '',
    		];
    
    		$instance = shortcode_atts( $defaults, $instance );
    
            if( $instance['assigned_to'] == 'post_id' ) {
                $instance['assigned_to'] = intval( get_the_ID() );
            }

    So it works proper.

    Then the SiteReviewsForm Widget checks for page_id in ‘assign_to’, but there’s only a number allowed so it can never be ‘post_id’ – i changed the code to check for page_id 0

    public function widget( $args, $instance )
    	{
    		$defaults = [
    			'assign_to'   => '',
    			'category'    => '',
    			'class'       => '',
    			'description' => '',
    			'hide'        => [],
    			'title'       => '',
    		];
    
    		// custom widget attributes
    		$instance = shortcode_atts( $defaults, $instance );
    
    		if( $instance['assign_to'] == 0 ) {
    			$instance['assign_to'] = intval( get_the_ID() );
    		}

    These fixed my problems… i hope you gonna fix it in your next release

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    @kapsonfire Thank you for pointing this out!

    I will release an update today to fix it.

    Plugin Author Gemini Labs

    (@geminilabs)

    Please update to Site Reviews v2.7.3

    Also note that the “Submit a Site Review” widget allows you now to enter “post_id” instead of only a number. If you previously set the widget assign_to value to “0”, you may want to set it now to “post_id”.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘post_id fpr widgets’ is closed to new replies.