function show_avatar_on_admin($current_member)
{
    $avatar_url = get_member_avatar_url($current_member);
    $avatar_img = '<a class="link--name" href="' . get_author_posts_url($current_member->ID, $current_member->user_nicename) . '">';
    if ($avatar_url) {
        $avatar_img .= '<img src="' . $avatar_url . '" /></a>';
    } else {
        $avatar_img .= '<img src="' . get_template_directory_uri() . '/build/img/member.png" /></a>';
    }
    return $avatar_img;
}
function remind_to_do()
{
    if (!is_plugin_active('co-authors-plus/co-authors-plus.php')) {
        echo '<div class="error"> <p>Należy zainstalować wtyczkę Co-Authors Plus</p></div>';
    }
    if (!is_plugin_active('wp-users-media/index.php')) {
        echo '<div class="error"> <p>Należy zainstalować wtyczkę WP Users Media</p></div>';
    }
    if (!is_plugin_active('custom-upload-dir/custom_upload_dir.php')) {
        echo '<div class="error"> <p>Należy zainstalować wtyczkę Custom Upload Dir</p></div>';
    }
    if (!is_plugin_active('carbon-fields/carbon-fields-plugin.php')) {
        echo '<div class="error"> <p>Należy zainstalować wtyczkę Carbon Fields</p></div>';
    }
    $current_member = wp_get_current_user();
    if (!get_member_avatar_url($current_member)) {
        echo '<div class="error"> <p>Dodaj zdjęcie profilowe!</p><img src="' . get_template_directory_uri() . '/build/img/b.jpg"/></div>';
    }
}
function opengraph()
{
    global $post;
    global $wp;
    $current_url = home_url(add_query_arg(array(), $wp->request));
    if (is_single() || is_page() && !is_front_page()) {
        if (has_post_thumbnail($post->ID)) {
            $img_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'large');
        } else {
            $img_src[0] = get_template_directory_uri() . '/build/img/main-og-img.png';
        }
        $description = my_excerpt($post->post_content, $post->post_excerpt);
        $description = strip_tags($description);
        $description = str_replace('"', "'", $description);
        ?>
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:site" value="@MKNMSynergia" />
    <meta name="twitter:title" property="og:title" content="<?php 
        echo the_title();
        ?>
"/>
    <meta name="twitter:description" property="og:description" content="<?php 
        echo $description;
        ?>
"/>
    <meta property="og:type" content="article"/>
    <meta name="twitter:url" property="og:url" content="<?php 
        echo the_permalink();
        ?>
"/>
    <meta property="og:site_name" content="<?php 
        echo get_bloginfo('name');
        ?>
"/>
    <meta name="twitter:image" property="og:image" content="<?php 
        echo $img_src[0];
        ?>
"/>

<?php 
    } else {
        if (is_front_page()) {
            ?>
      <meta name="twitter:card" content="summary_large_image" />
      <meta name="twitter:site" value="@MKNMSynergia" />
      <meta name="twitter:title" property="og:title" content="<?php 
            echo get_bloginfo('name');
            ?>
"/>
      <meta name="twitter:description" property="og:description" content="<?php 
            echo get_bloginfo('description');
            ?>
"/>
      <meta property="og:type" content="website"/>
      <meta name="twitter:url" property="og:url" content="<?php 
            echo get_bloginfo('url');
            ?>
"/>
      <meta property="og:site_name" content="<?php 
            echo get_bloginfo('name');
            ?>
"/>
      <meta name="twitter:image" property="og:image" content="<?php 
            echo get_template_directory_uri() . '/build/img/main-og-img.png';
            ?>
"/>
<?php 
        } elseif (is_author()) {
            global $wp_query;
            $current_member = $wp_query->get_queried_object();
            ?>
      <meta name="twitter:card" content="summary" />
      <meta name="twitter:site" value="@MKNMSynergia" />
      <meta name="twitter:title" property="og:title" content="<?php 
            echo $current_member->display_name;
            ?>
"/>
      <meta name="twitter:description" property="og:description" content="<?php 
            echo show_membership_status($current_member);
            ?>
"/>
      <meta property="og:type" content="website"/>
      <meta name="twitter:url" property="og:url" content="<?php 
            echo $current_url;
            ?>
"/>
      <meta property="og:site_name" content="<?php 
            echo get_bloginfo('name');
            ?>
"/>
      <meta name="twitter:image" property="og:image" content="<?php 
            echo get_member_avatar_url($current_member);
            ?>
"/>
      <?php 
            if ($current_member->twitter_profile) {
                echo '<meta name="twitter:creator" content="' . $current_member->twitter_profile . '" />';
            }
        }
    }
}
function show_member_summary()
{
    $current_member = wp_get_current_user();
    ?>
  <div id="col-container" class="summary_wrap">
    <div id="col-left">
      <div class="col-wrap">
        <div class="buttons-wrap">
          <a class="button-primary button-big" href="<?php 
    echo get_site_url();
    ?>
/wp-admin/post-new.php?post_type=project" title="<?php 
    esc_attr_e('Dodaj nowy projekt');
    ?>
"><?php 
    esc_attr_e('Dodaj projekt');
    ?>
</a>
          <a class="button-primary button-big" href="<?php 
    echo get_site_url();
    ?>
/wp-admin/post-new.php" title="<?php 
    esc_attr_e('Dodaj nowy wpis');
    ?>
"><?php 
    esc_attr_e('Dodaj wpis');
    ?>
</a>
        </div>
      </div>
    </div>
    <div id="col-right">
      <div class="col-wrap">
        <a href="<?php 
    echo get_site_url();
    ?>
/wp-admin/profile.php">
          <img src="<?php 
    echo get_member_avatar_url($current_member);
    ?>
"/>
        </a>
        <h1><?php 
    echo $current_member->display_name;
    ?>
</h1>
        <a href="<?php 
    echo get_site_url();
    ?>
/wp-admin/edit.php?post_type=project">
        Projekty: <b><?php 
    echo $current_member->number_of_finished_projects;
    ?>
</b>
        (<?php 
    echo $current_member->number_of_in_progress_projects;
    ?>
)</a>
      </div>
    </div>
  </div>
  <?php 
}