• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack_Gravatar_Profile_Widget::widget() – This filter is documented in modules/widgets/facebook-likebox.php

You appear to be a bot. Output may be restricted

Description

This filter is documented in modules/widgets/facebook-likebox.php

Usage

Jetpack_Gravatar_Profile_Widget::widget( $args, $instance );

Parameters

$args
( mixed ) required –
$instance
( mixed ) required –

Returns

void

Source

File name: jetpack/modules/widgets/gravatar-profile.php
Lines:

1 to 100 of 108
  function widget( $args, $instance ) {
    
/**
 * Fires when an item is displayed on the front end.
 *
 * Can be used to track stats about the number of displays for a specific item
 *
 * @module widgets, shortcodes
 *
 * @since 1.6.0
 *
 * @param string widget_view Item type (e.g. widget, or embed).
 * @param string grofile     Item description (e.g. grofile, goodreads).
 */
    do_action( 'jetpack_stats_extra', 'widget_view', 'grofile' );

    $instance = wp_parse_args(
      $instance, array(
        'title' => '',
        'email' => '',
      )
    );

    
/** This filter is documented in core/src/wp-includes/default-widgets.php */
    $title = apply_filters( 'widget_title', $instance['title'] );

    if ( ! $instance['email'] ) {
      if ( current_user_can( 'edit_theme_options' ) ) {
        echo $args['before_widget'];
        if ( ! empty( $title ) ) {
          echo $args['before_title'] . $title . $args['after_title'];
        }
        echo '<p>' . sprintf( __( 'You need to select what to show in this <a href="%s">Gravatar Profile widget</a>.', 'jetpack' ), admin_url( 'widgets.php' ) ) . '</p>';
        echo $args['after_widget'];
      }
      return;
    }

    echo $args['before_widget'];
    if ( ! empty( $title ) ) {
      echo $args['before_title'] . $title . $args['after_title'];
    }

    $profile = $this->get_profile( $instance['email'] );

    if ( ! empty( $profile ) ) {
      $profile      = wp_parse_args(
        $profile, array(
          'thumbnailUrl' => '',
          'profileUrl'   => '',
          'displayName'  => '',
          'aboutMe'      => '',
          'urls'         => array(),
          'accounts'     => array(),
        )
      );
      $gravatar_url = add_query_arg( 's', 320, $profile['thumbnailUrl'] ); // the default grav returned by grofiles is super small

      // Enqueue front end assets.
      $this->enqueue_scripts();

      ?>
			<img src="<?php echo esc_url( $gravatar_url ); ?>" class="grofile-thumbnail no-grav" alt="<?php echo esc_attr( $profile['displayName'] ); ?>" />
			<div class="grofile-meta">
				<h4><a href="<?php echo esc_url( $profile['profileUrl'] ); ?>"><?php echo esc_html( $profile['displayName'] ); ?></a></h4>
				<p><?php echo wp_kses_post( $profile['aboutMe'] ); ?></p>
			</div>

			<?php

      if ( $instance['show_personal_links'] ) {
        $this->display_personal_links( (array) $profile['urls'] );
      }

      if ( $instance['show_account_links'] ) {
        $this->display_accounts( (array) $profile['accounts'] );
      }

      ?>

			<p><a href="<?php echo esc_url( $profile['profileUrl'] ); ?>" class="grofile-full-link">
				<?php
        echo esc_html(
          
/**
 * Filter the Gravatar Profile widget's profile link title.
 *
 * @module widgets
 *
 * @since 2.8.0
 *
 * @param string $str Profile link title.
 */
          apply_filters(
            'jetpack_gravatar_full_profile_title',
            __( 'View Full Profile &rarr;', 'jetpack' )
          )
        );
        ?>
			</a></p>

			<?php
 
[1] [2] Next »

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 27 November 2019 | Last updated: 27 November 2019

Primary Sidebar

Information

Function name: Jetpack_Gravatar_Profile_Widget::widget
Class ref: Jetpack_Gravatar_Profile_Widget
Plugin ref: Jetpack
Version: 9.2
Sourcefile: modules/widgets/gravatar-profile.php
File ref: modules/widgets/gravatar-profile.php
Deprecated?: No
API Letters: G,J,P,W

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites