Пример #1
0
                    <h1 class="post-title main-title"><?php 
        the_title();
        ?>
</h1>
                    <div class="table">
                        <div class="table-cell entry-meta">
                            <?php 
        buddyboss_entry_meta();
        ?>
                        </div>
                        <div class="table-cell">
                            <!-- Socials -->
                            <div class="btn-group social">

                            <?php 
        foreach (buddyboss_get_user_social_array() as $social => $name) {
            $url = buddyboss_get_user_social(get_the_author_meta('ID'), $social);
            ?>

                            <?php 
            if (!empty($url)) {
                ?>
			
                            <a class="btn" href="<?php 
                echo $url;
                ?>
" title="<?php 
                echo esc_attr($name);
                ?>
"><i class="alt-social-icon alt-<?php 
                echo $social;
Пример #2
0
/**
 * Save the user social fields data
 * @since Boss 1.0.0
 **/
function buddyboss_user_social_fields_save($user_id, $posted_field_ids, $errors)
{
    if (empty($user_id)) {
        // no user ah! skip it then.
        return;
    }
    $socials = get_user_meta($user_id, "user_social_links", true);
    if (!is_array($socials)) {
        $socials = array();
    }
    if ($_POST["buddyboss_user_social"] == "1") {
        foreach (buddyboss_get_user_social_array() as $social => $name) {
            $url = $_POST["buddyboss_" . $social];
            //check if its valid URL
            if (filter_var($url, FILTER_VALIDATE_URL) || empty($url)) {
                $socials[$social] = $url;
            }
        }
        update_user_meta($user_id, "user_social_links", $socials);
        //update it
    }
}