'1', 'version' => 'v2.8', // 'appId' => '150302815027430', ); // if ( empty( $instance['appId'] ) ) { // $data['appId'] = $instance['appId']; // } echo sprintf( '
', str_replace( '-', '_', get_bloginfo( 'language' ) ), http_build_query( $data ) ); } /** * Function description * * @param array $instance [description]. * * @return string [description] */ public function render( array $instance = array() ) { if ( empty( $instance['href'] ) ) { return sprintf( '

%s

', __( 'You have to add the name of yor Facebook page in the settings.', 'italystrap' ) ); } // $instance = wp_parse_args( $instance, array( // 'href' => 'https://www.facebook.com/facebook', // 'width' => '380', // 'height' => '214', // 'tabs' => array( 'timeline', 'events', 'messages' ), // 'hide-cover' => 'false', // 'show-facepile' => 'true', // 'hide-cta' => 'false', // 'small-header' => 'false', // 'adapt-container-width' => 'true', // 'align' => 'none', // ) ); // wp_parse_args( $args, $defaults ); $attr = array( 'class' => 'fb-page', 'data-href' => false !== strpos( $instance['href'], 'facebook.com' ) ? esc_url( $instance['href'] ) : 'https://facebook.com/' . esc_attr( $instance['href'] ), 'data-width' => absint( $instance['width'] ), 'data-height' => absint( $instance['height'] ), 'data-tabs' => implode( ',', (array) $instance['tabs'] ), 'data-hide-cover' => esc_attr( $instance['hide-cover'] ), 'data-show-facepile' => esc_attr( $instance['show-facepile'] ), 'data-hide-cta' => esc_attr( $instance['hide-cta'] ), 'data-small-header' => esc_attr( $instance['small-header'] ), 'data-adapt-container-width' => esc_attr( $instance['adapt-container-width'] ), ); $output = sprintf( '', ' style="text-align:' . esc_attr( $instance['align'] ) . ';max-width: ' . absint( $instance['width'] ) . 'px;height: ' . absint( $instance['height'] ) . 'px;"', Core\get_attr( 'facebook_page', $attr, false, null ) ); return $output; } /** * Function description * * @param string $value [description] * @return string [description] */ public function output() { echo $this->render( array() ); } }