BP_Core_Network_Posts_Widget::form( array $instance )

Output the Members widget options form.

Description

Parameters

$instance

(Required) Widget instance settings.

Return

(void)

Source

File: bp-core/classes/class-bp-core-network-posts-widget.php

	public function form( $instance ) {

		// Get widget settings.
        $title		 = isset( $instance[ 'title' ] ) ? esc_attr( $instance[ 'title' ] ) : __( 'Recent Networkside Posts', 'buddyboss' );
        $number		 = isset( $instance[ 'number' ] ) ? absint( $instance[ 'number' ] ) : 1;
        $show_date	 = isset( $instance[ 'show_date' ] ) ? (bool) $instance[ 'show_date' ] : true;
        $show_image	 = isset( $instance[ 'show_image' ] ) ? (bool) $instance[ 'show_image' ] : true;
        ?>
        <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'buddyboss' ); ?></label>
            <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>

        <p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to show for each blog:', 'buddyboss' ); ?></label>
            <input class="tiny-text" id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="number" step="1" min="1" value="<?php echo $number; ?>" size="3" /></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />
            <label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display post date?', 'buddyboss' ); ?></label></p>

        <p><input class="checkbox" type="checkbox"<?php checked( $show_image ); ?> id="<?php echo $this->get_field_id( 'show_image' ); ?>" name="<?php echo $this->get_field_name( 'show_image' ); ?>" />
            <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Display post featured image?', 'buddyboss' ); ?></label></p>

	<?php
	}

Changelog

Changelog
Version Description
1.0.3 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.