function getUserListing($curuser)
{
    $html = '<div class="uyd-user ' . ($curuser->ID === 'GUEST' ? 'guest' : '') . '">';
    /* Gravatar */
    if (function_exists('get_wp_user_avatar')) {
        $display_gravatar = get_wp_user_avatar($curuser->user_email, 32);
    } else {
        $display_gravatar = get_avatar($curuser->user_email, 32);
        if ($display_gravatar === false) {
            //Gravatar is disabled, show default image.
            $display_gravatar = '<img src="' . USEYOURDRIVE_ROOTPATH . '/css/images/usericon.png"/>';
        }
    }
    $html .= "<div class=\"uyd-avatar\"><a title=\"{$curuser->display_name}\">{$display_gravatar}</a></div>\n";
    $html .= "<div class=\"uyd-userinfo\" data-userid=\"" . $curuser->ID . "\">";
    /* name */
    $html .= "<div class=\"uyd-name\"><a href=\"" . ($curuser->ID === 'GUEST' ? '#' : get_edit_user_link($curuser->ID)) . "\"title=\"{$curuser->display_name}\">{$curuser->display_name}</a></div>\n";
    /* Current link */
    if ($curuser->ID === 'GUEST') {
        $curfolder = get_site_option('use_your_drive_guestlinkedto');
    } else {
        $curfolder = get_user_option('use_your_drive_linkedto', $curuser->ID);
    }
    $nolink = true;
    if (empty($curfolder) || !is_array($curfolder) || !isset($curfolder['foldertext'])) {
        $curfolder = __('Not yet linked to a folder', 'useyourdrive');
    } else {
        $curfolder = $curfolder['foldertext'];
        $nolink = false;
    }
    $html .= "<div class=\"uyd-linkedto\">{$curfolder}</div>\n";
    $html .= "<input class='uyd-linkbutton button-primary' type='submit' title='" . __('Link to folder', 'useyourdrive') . "' value='" . __('Link to folder', 'useyourdrive') . "'>";
    $html .= "<input class='uyd-unlinkbutton button-secondary " . ($nolink ? 'disabled' : '') . "' type='submit' title='" . __('Remove link', 'useyourdrive') . "' value='" . __('Remove link', 'useyourdrive') . "'>";
    $html .= "</div>";
    $html .= '</div>';
    return $html;
}
 public function ajax_get_customers_per_period()
 {
     $customers_num = isset($_POST['product_num']) ? $_POST['product_num'] : 10;
     $start_date = isset($_POST['start_date']) ? $_POST['start_date'] : null;
     $end_date = isset($_POST['end_date']) ? $_POST['end_date'] : null;
     $stats = $this->get_customers_per_period($customers_num, $start_date, $end_date);
     //wcds_var_dump($stats);
     /* Format:
     			array(2) {
     			  [0]=>
     			  array(4) {
     				["order_total"]=>
     				string(4) "15.6"
     				["order_num"]=>
     				string(1) "2"
     				["name"]=>
     				string(8) "Domenico"
     				["last_name"]=>
     				string(6) "Lagudi"
     				["customer_id"] =>
     				int 1234123
     			  }
     			  */
     foreach ($stats as $index => $customer) {
         $stats[$index]['total_spent'] = round($customer['total_spent'], 2);
         $stats[$index]['permalink'] = $customer['customer_id'] > 0 ? get_edit_user_link($customer['customer_id']) : 'none';
     }
     echo json_encode($stats);
     wp_die();
 }
        protected function get_wp_login_form($args = array())
        {
            $defaults = array('echo' => false, 'redirect' => (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'form_id' => 'loginform', 'label_username' => _x('Username', 'shortcode simple login', 'the7mk2'), 'label_password' => _x('Password', 'shortcode simple login', 'the7mk2'), 'label_remember' => _x('Remember Me', 'shortcode simple login', 'the7mk2'), 'label_log_in' => _x('Log In', 'shortcode simple login', 'the7mk2'), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'remember' => true, 'value_username' => '', 'value_remember' => false);
            $args = wp_parse_args($args, apply_filters('login_form_defaults', $defaults));
            if (is_user_logged_in()) {
                global $user_identity;
                get_currentuserinfo();
                $form = '<p class="logged-in-as">' . sprintf(_x('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'shortcode simple login', 'the7mk2'), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</p>';
            } else {
                $login_form_top = apply_filters('login_form_top', '', $args);
                $login_form_middle = apply_filters('login_form_middle', '', $args);
                $login_form_bottom = apply_filters('login_form_bottom', '', $args);
                $form = '
					<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url(site_url('wp-login.php', 'login_post')) . '" method="post">
						' . $login_form_top . '
						<p class="login-username">
							<label class="assistive-text" for="' . esc_attr($args['id_username']) . '">' . esc_html($args['label_username']) . '</label>
							<input type="text" name="log" placeholder="' . esc_attr($args['label_username']) . '" id="' . esc_attr($args['id_username']) . '" class="input" value="' . esc_attr($args['value_username']) . '" size="20" />
						</p>
						<p class="login-password">
							<label class="assistive-text" for="' . esc_attr($args['id_password']) . '">' . esc_html($args['label_password']) . '</label>
							<input type="password" name="pwd" placeholder="' . esc_attr($args['label_password']) . '" id="' . esc_attr($args['id_password']) . '" class="input" value="" size="20" />
						</p>
						' . $login_form_middle . '
						' . ($args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr($args['id_remember']) . '" value="forever"' . ($args['value_remember'] ? ' checked="checked"' : '') . ' /> ' . esc_html($args['label_remember']) . '</label></p>' : '') . '
						<p class="login-submit">
							<input type="submit" name="wp-submit" id="' . esc_attr($args['id_submit']) . '" class="button-primary" value="' . esc_attr($args['label_log_in']) . '" />
							<input type="hidden" name="redirect_to" value="' . esc_url($args['redirect']) . '" />
						</p>
						' . $login_form_bottom . '
					</form>';
            }
            return $form;
        }
function sumobi_edd_customer_details_username($payment_id)
{
    $user_info = edd_get_payment_meta_user_info($payment_id);
    $customer_id = $user_info['id'];
    if (!$customer_id) {
        return;
    }
    $user_data = get_userdata($customer_id);
    $user_name = $user_data->user_login;
    ?>
	<div class="column-container" style="margin-top: 20px;">
		<div class="column">
			<strong><?php 
    _e('Username:'******'edd');
    ?>
</strong><br />
			<a href="<?php 
    echo get_edit_user_link($customer_id);
    ?>
"><?php 
    echo $user_name;
    ?>
</a>
		</div>
	</div>
	<?php 
}
Example #5
0
function ellak_social_links()
{
    ?>
	<div class="header-login">
				<?php 
    if (is_user_logged_in()) {
        ?>
				<a href="<?php 
        echo esc_url(get_edit_user_link());
        ?>
"><?php 
        _e('Ο λογαριασμός μου', 'gpchild-ellak');
        ?>
</a>
				<a href="<?php 
        echo esc_url(wp_logout_url(get_permalink()));
        ?>
"><?php 
        _e('Αποσύνδεση', 'gpchild-ellak');
        ?>
</a>

				<?php 
    } else {
        if (get_option('users_can_register')) {
            ?>
				<a href="<?php 
            echo esc_url(wp_registration_url());
            ?>
"><?php 
            _e('Εγγραφή', 'gpchild-ellak');
            ?>
</a>
				<?php 
        }
        // get_option
        ?>

				<a href="<?php 
        echo esc_url(wp_login_url());
        ?>
"><?php 
        _e('Συνδεση', 'gpchild-ellak');
        ?>
</a>

				<?php 
    }
    // is_user_logged_in
    ?>
			</div>
	<div class="header-social-links">
		<ul class="social-links">
			<li class="social-link-facebook"><a href="https://www.facebook.com/CreativeCommonsGreece" target="_blank"><span>Facebook</span></a></li>
			<li class="social-link-twitter"><a href="https://www.twitter.com/cc_greece" target="_blank"><span>Twitter</span></a></li>
			<li class="social-link-rss"><a href="https://ellak.gr/rss-feeds/" target="_blank"><span>RSS</span></a></li>
		</ul>
	</div><!-- .header-social-links -->
<?php 
}
 /**
  * Get column content, this is called once per column, per row item ($order)
  * returns the content to be rendered within that cell.
  *
  * @see WP_List_Table::single_row_columns()
  * @since 1.0
  * @param object $log_entry one row (item) in the table
  * @param string $column_name the column slug
  * @return string the column content
  */
 public function column_default($log_entry, $column_name)
 {
     switch ($column_name) {
         case 'customer':
             $customer_email = null;
             if ($log_entry->user_id) {
                 $customer_email = get_user_meta($log_entry->user_id, 'billing_email', true);
             }
             if ($customer_email) {
                 $column_content = sprintf('<a href="%s">%s</a>', get_edit_user_link($log_entry->user_id), $customer_email);
             } else {
                 $user = get_user_by('id', $log_entry->user_id);
                 $column_content = sprintf('<a href="%s">%s</a>', get_edit_user_link($log_entry->user_id), $user ? $user->user_login : __('Unknown', 'wc_points_rewards'));
             }
             break;
         case 'points':
             // add a '+' sign when needed
             $column_content = ($log_entry->points > 0 ? '+' : '') . $log_entry->points;
             break;
         case 'event':
             $column_content = $log_entry->description;
             break;
         case 'date':
             $column_content = '<abbr title="' . esc_attr($log_entry->date_display) . '">' . esc_html($log_entry->date_display_human) . '</abbr>';
             break;
         default:
             $column_content = '';
             break;
     }
     return $column_content;
 }
Example #7
0
function wphacks_edit_user_profile_add_banned_option($profile_user)
{
    ?>
<table class="form-table">
	<tr class="wphacks-user-banned">
		<th scope="row"><label><?php 
    echo __('Banned?', 'wphacks');
    ?>
</label></th>
		<td>
		<?php 
    $banned = get_user_meta($profile_user->ID, '_wphacks_banned', true);
    $banning_user = get_user_meta($profile_user->ID, '_wphacks_banned_by', true);
    ?>
		<input type="checkbox" name="_wphacks_banned" <?php 
    checked(1, $banned, true);
    ?>
 value="1"?> <?php 
    echo $banned ? '<p>Banned on ' . date('r', get_user_meta($profile_user->ID, '_wphacks_banned_timestamp', true)) . (get_user_by('id', $banning_user) ? ' by <a href="' . get_edit_user_link($banning_user) . '">' . get_user_by('id', $banning_user)->display_name . '</a>' : '') . '</p>' : '';
    ?>
		<p class="description">If checked, the user will be unable to log in.</p>
		</td>
	</tr>
</table>
<?php 
}
    /**
     * Displays an admin notice when backup codes have run out.
     *
     * @since 0.1-dev
     */
    public function admin_notices()
    {
        $user = wp_get_current_user();
        // Return if the provider is not enabled.
        if (!in_array(__CLASS__, Two_Factor_Core::get_enabled_providers_for_user($user->ID))) {
            return;
        }
        // Return if we are not out of codes.
        if ($this->is_available_for_user($user)) {
            return;
        }
        ?>
		<div class="error">
			<p>
				<span><?php 
        esc_html_e('Two-Factor: You are out of backup codes and need to ');
        ?>
<span>
				<a href="<?php 
        echo esc_url(get_edit_user_link($user->ID) . '#two-factor-backup-codes');
        ?>
"><?php 
        esc_html_e('regenerate!');
        ?>
</a>
			</p>
		</div>
		<?php 
    }
Example #9
0
 public static function getUserLink($customer)
 {
     if ($customer instanceof Guest) {
         return $customer->getName();
     }
     return sprintf('<a href="%s">%s</a>', get_edit_user_link($customer->getId()), $customer->getName());
 }
Example #10
0
 public function change_link_to_admin($link, $item)
 {
     $cpt = rtbiz_get_contact_post_type();
     if ($cpt == get_current_screen()->post_type && $cpt . '_to_user' === $item->p2p_type && current_user_can('edit_users')) {
         return get_edit_user_link($item->ID);
     }
     return $link;
 }
 /**
  * Add action links to Stream drop row in admin list screen
  *
  * @filter wp_stream_action_links_{connector}
  *
  * @param array $links   Previous links registered
  * @param Record $record Stream record
  *
  * @return array Action links
  */
 public function action_links($links, $record)
 {
     if ($record->object_id) {
         if ($link = get_edit_user_link($record->object_id)) {
             $links[esc_html__('Edit User', 'stream')] = $link;
         }
     }
     return $links;
 }
Example #12
0
 public static function action_links($links, $record)
 {
     if ($record->object_id) {
         if ($link = get_edit_user_link($record->object_id)) {
             $links[__('Edit User', 'default')] = $link;
         }
     }
     return $links;
 }
Example #13
0
 function edit($id)
 {
     if (is_object($id)) {
         $id = $id->id;
     }
     // redirect to WP admin user edit
     $link = get_edit_user_link($id);
     $this->redirect($link);
     exit;
 }
Example #14
0
function upme_wpmember_validate_profile_visibility($params)
{
    $args = $params;
    extract($args);
    if (!upme_validate_wpmember()) {
        return $params;
    }
    if ('INACTIVE' == get_user_meta($user_id, 'upme_wpmember_profile_status', true) && !user_can($user_id, 'manage_options')) {
        $params['status'] = false;
        $params['info'] = __('Please purchase a package to continue. Click ', 'upme') . '<a href="' . get_edit_user_link($user_id) . '">' . __('Here', 'upme') . '</a>';
    }
    return $params;
}
    function admin_page_cpfs_print_user($user_id)
    {
        $userinfo = get_userdata($user_id);
        ?>
        <a href="<?php 
        echo get_edit_user_link($user_id);
        ?>
"><?php 
        echo $userinfo->user_email;
        ?>
</a>
        <?php 
    }
Example #16
0
/**
 * Add a logout link, edit profile and add new articles etc links for logged in users
 */
function add_logout_link($items, $args)
{
    if ($args->theme_location == 'main-nav') {
        if (is_user_logged_in()) {
            $items .= '<li class="has-submenu is-dropdown-submenu-parent"><a href="#">Add Content</a><ul class="menu submenu is-dropdown-submenu first-sub vertical">';
            $items .= '<li><a href="' . admin_url() . 'post-new.php">Add Blog Post</a></li>';
            // $items .= '<li><a href="' . admin_url() . 'post-new.php?post_type=resource">Add Resource</a></li>';
            // $items .= '<li><a href="' . admin_url() . 'post-new.php?post_type=news">Add News Report</a></li>';
            $items .= '<li><a href="' . get_edit_user_link() . '">Edit Profile</a></li></ul></li>';
            $items .= '<li class="logout"><a href="' . wp_logout_url(home_url()) . '">Log Out</a></li>';
        }
    }
    return $items;
}
function hocwp_theme_translation_comment_form_defaults($defaults)
{
    $commenter = wp_get_current_commenter();
    $user = wp_get_current_user();
    $user_identity = $user->exists() ? $user->display_name : '';
    $format = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml';
    $format = apply_filters('hocwp_comment_form_format', $format);
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $html_req = $req ? " required='required'" : '';
    $required_text = sprintf(' ' . 'Những mục bắt buộc được đánh dấu %s', '<span class="required">*</span>');
    $html5 = 'html5' === $format;
    $defaults = array('comment_field' => '<p class="comment-form-comment"><label for="comment">' . 'Nội dung' . '</label> <textarea id="comment" name="comment" cols="45" rows="8"  aria-required="true" required="required"></textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf('Bạn phải <a href="%s">đăng nhập</a> trước khi có thể đăng bình luận.', wp_login_url(apply_filters('the_permalink', get_permalink(get_the_ID())))) . '</p>', 'logged_in_as' => '<p class="logged-in-as">' . sprintf('Bạn đang đăng nhập với tài khoản <a href="%1$s">%2$s</a>. <a href="%3$s" title="Thoát khỏi tài khoản này">Thoát?</a>', get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink(get_the_ID())))) . '</p>', 'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . 'Địa chỉ email của bạn sẽ được giữ bí mật.' . '</span>' . ($req ? $required_text : '') . '</p>', 'title_reply' => '<span class="title-text">' . 'Gửi bình luận' . '</span>', 'title_reply_to' => 'Gửi trả lời cho %s', 'cancel_reply_link' => 'Nhấn vào đây để hủy trả lời.', 'label_submit' => 'Gửi bình luận');
    return $defaults;
}
Example #18
0
function hocwp_comment_form_defaults($defaults)
{
    $commenter = wp_get_current_commenter();
    $user = wp_get_current_user();
    $user_identity = $user->exists() ? $user->display_name : '';
    $format = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml';
    $format = apply_filters('hocwp_comment_form_format', $format);
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $html_req = $req ? " required='required'" : '';
    $required_text = sprintf(' ' . __('Required fields are marked %s', 'hocwp-theme'), '<span class="required">*</span>');
    $html5 = 'html5' === $format;
    $defaults = array('comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x('Comment', 'comment field label', 'hocwp-theme') . '</label> <textarea id="comment" name="comment" cols="45" rows="8"  aria-required="true" required="required"></textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'hocwp-theme'), wp_login_url(apply_filters('the_permalink', get_permalink(get_the_ID())))) . '</p>', 'logged_in_as' => '<p class="logged-in-as">' . sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'hocwp-theme'), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink(get_the_ID())))) . '</p>', 'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __('Your email address will not be published.', 'hocwp-theme') . '</span>' . ($req ? $required_text : '') . '</p>', 'comment_notes_after' => '', 'id_form' => 'commentform', 'id_submit' => 'submit', 'class_submit' => 'submit', 'name_submit' => 'submit', 'title_reply' => '<span class="title-text">' . __('Leave a Reply', 'hocwp-theme') . '</span>', 'title_reply_to' => __('Leave a Reply to %s', 'hocwp-theme'), 'cancel_reply_link' => __('Click here to cancel reply.', 'hocwp-theme'), 'label_submit' => __('Post Comment', 'hocwp-theme'), 'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />', 'submit_field' => '<p class="form-submit">%1$s %2$s</p>', 'format' => 'html5');
    return $defaults;
}
 public function admin_register_clients_table()
 {
     $table = new Table('users', 'ID');
     $table->setup_column('Avatar', __('Avatar', 'wpk15'), function ($item, $key) {
         return get_avatar($item['user_email']);
     });
     $table->setup_general_column('display_name', __('Name', 'wpk15'), null, $sortable = true, $searchable = true);
     $table->setup_column('user_email', __('Email', 'wpk15'), null, $sortable = true, $searchable = true);
     $table->setup_column('user_registered', __('Registered', 'wpk15'), null, $sortable = true);
     $table->add_action('View', function ($action, $item) {
         wp_redirect(get_edit_user_link($item));
         exit;
     });
     $admin_page = new TablePage('clients', __('Clients', 'wpk15'), 'users.php');
     $admin_page->set_table($table);
 }
 public function column_default($item, $column_name)
 {
     switch ($column_name) {
         case 'subject':
         case 'activity_type':
         case 'created':
         case 'crm_actions':
             return $item[$column_name];
         case 'user_id':
             $user_info = get_userdata($item[$column_name]);
             return '<a href="' . get_edit_user_link($item[$column_name]) . '">' . $user_info->display_name . '</a>';
         default:
             return print_r($item, true);
             //Show the whole array for troubleshooting purposes
     }
 }
 /**
  * Print the columns information
  *
  * @param $rec  \YITH_Commission
  * @param $column_name
  *
  * @return string
  */
 public function column_default($rec, $column_name)
 {
     switch ($column_name) {
         case 'user':
             if (empty($rec->display_name)) {
                 return "<em>" . __('User deleted', 'yith_wc_product_vendors') . "</em>";
             }
             $user_url = get_edit_user_link($rec->ID);
             $user_name = $rec->display_name;
             return !empty($user_url) ? "<a href='{$user_url}' target='_blank'>{$user_name}</a>" : $user_name;
             break;
         case 'vendor':
             $vendor = yith_get_vendor($rec->ID, 'user');
             if (!$vendor->is_valid()) {
                 return "<em>" . __('Vendor deleted', 'yith_wc_product_vendors') . "</em>";
             }
             $vendor_url = get_edit_term_link($vendor->id, $vendor->taxonomy);
             $vendor_name = $vendor->name;
             return !empty($vendor_url) ? "<a href='{$vendor_url}' target='_blank'>{$vendor_name}</a>" : $vendor_name;
             break;
         case 'amount':
             $amount = get_user_meta($rec->ID, '_vendor_commission_credit', true);
             return wc_price($amount);
             break;
         case 'user_actions':
             if ($this->_vendor->is_super_user()) {
                 printf('<a class="button tips pay" href="%1$s" data-tip="%2$s">%2$s</a>', esc_url(wp_nonce_url(add_query_arg(array('action' => 'pay_commission', 'commission_id' => $rec->ID), admin_url('admin.php')), 'yith-vendors-pay-commission')), __('Pay', 'yith_wc_product_vendors'));
             }
             break;
         case 'oldest_commission':
             $commissions = YITH_Commissions()->get_commissions(array('user_id' => $rec->ID, 'fields' => 'last_edit', 'order' => 'ASC'));
             $oldest_commission_date = array_shift($commissions);
             $t_time = date_i18n(__('Y/m/d g:i:s A'), mysql2date('U', $oldest_commission_date));
             $m_time = $oldest_commission_date;
             $time = mysql2date('G', $oldest_commission_date);
             $time_diff = time() - $time;
             if ($time_diff > 0 && $time_diff < DAY_IN_SECONDS) {
                 $h_time = sprintf(__('%s ago'), human_time_diff($time));
             } else {
                 $h_time = mysql2date(__('Y/m/d'), $m_time);
             }
             return $h_time ? '<abbr title="' . $t_time . '">' . $h_time . '</abbr>' : '<small class="meta">-</small>';
             break;
     }
     return null;
 }
Example #22
0
function aione_user_welcome_shortcode($atts)
{
    // Attributes
    extract(shortcode_atts(array('class' => '', 'text' => 'Welcome'), $atts));
    $output = "";
    if (is_user_logged_in()) {
        $current_user = wp_get_current_user();
        if ($current_user->display_name != "") {
            $user_welcome = $current_user->display_name;
        } elseif ($current_user->user_firstname != '' && $current_user->user_lastname != '') {
            $user_welcome = $current_user->user_firstname . ' ' . $current_user->user_lastname;
        } else {
            $user_welcome = $current_user->user_login;
        }
        $output .= '<div id="user_welcome" class="user-links user-welcome ' . $class . '">';
        $output .= $text . ' <a href="' . get_edit_user_link($current_user->ID) . '" title="' . $text . ' ' . $user_welcome . '">' . $user_welcome . '</a>';
        $output .= '</div>';
    }
    return $output;
}
Example #23
0
 /**
  * Build output for the subscriptions column.
  *
  * @see manage_users_custom_column filter trigger
  *
  * @param string $value
  * @param string $column_name
  * @param int $user_id
  * @return string column content
  */
 public static function subscriptions_column($value, $column_name, $user_id)
 {
     if (self::$subscriptions_column_name !== $column_name) {
         return $value;
     }
     $column_content = '';
     $edit_url = esc_url(add_query_arg('wp_http_referer', urlencode(wp_unslash($_SERVER['REQUEST_URI'])), get_edit_user_link($user_id)));
     $signup_lists = Prompt_Subscribing::get_signup_lists();
     foreach ($signup_lists as $signup_list) {
         $column_content .= self::signup_list_column_content($user_id, $signup_list, $edit_url);
     }
     $author_count = count(Prompt_User::subscribed_object_ids($user_id));
     if ($author_count > 0) {
         $column_content .= html('a', array('href' => $edit_url . '#prompt-author-subscriptions'), sprintf(_n('%d Author', '%d authors', $author_count), $author_count), '<br/>');
     }
     $post_count = count(Prompt_Post::subscribed_object_ids($user_id));
     if ($post_count > 0) {
         $column_content .= html('a', array('href' => $edit_url . '#prompt-post-subscriptions'), sprintf(_n('%d Conversations', '%d Conversations', $post_count), $post_count), '<br/>');
     }
     return $column_content;
 }
        public static function ui($post)
        {
            $assigned = rtbiz_get_entity_meta($post->ID, 'assgin_to', true);
            $assignedHTML = '';
            if ($assigned && !empty($assigned)) {
                $author = get_user_by('id', $assigned);
                $assignedHTML = "<li id='assign-auth-" . $author->ID . "' class='contact-list'>" . get_avatar($author->user_email, 24) . "<a href='#removeAssign' class='delete_row'>×</a>" . "<br/><a target='_blank' class='assign-title heading' title='" . $author->display_name . "' href='" . get_edit_user_link($author->ID) . "'>" . $author->display_name . '</a>' . "<input type='hidden' name='assign_to' value='" . $author->ID . "' /></li>";
            }
            $emps = rtbiz_get_module_employee(RTBIZ_TEXT_DOMAIN);
            $arrSubscriberUser = array();
            foreach ($emps as $author) {
                $arrSubscriberUser[] = array('id' => $author->ID, 'label' => $author->display_name, 'imghtml' => get_avatar($author->user_email, 24), 'user_edit_link' => get_edit_user_link($author->ID));
            }
            ?>
			<div>
				<span class="prefix"
				      title="<?php 
            __('Assign to');
            ?>
"><label><strong><?php 
            __('Assign to');
            ?>
</strong></label></span>
				<script>
					var arr_assign_user =<?php 
            echo json_encode($arrSubscriberUser);
            ?>
;
				</script>
				<input type="text" placeholder="Type assignee name to select" id="assign_user_ac"/>
				<ul id="divAssignList" class="">
					<?php 
            echo balanceTags($assignedHTML);
            ?>
				</ul>
			</div> <?php 
            do_action('rtbiz_metabox_assignee', $post, $post->post_type);
        }
	/**
	 * Displays an admin notice when backup codes have run out.
	 *
	 * @since 0.1-dev
	 */
	public function admin_notices() {
		$user = wp_get_current_user();

		// Return if the provider is not enabled.
		if ( ! in_array( __CLASS__, Two_Factor_Core::get_enabled_providers_for_user( $user->ID ) ) ) {
			return;
		}

		// Return if we are not out of codes.
		if ( $this->is_available_for_user( $user ) ) {
			return;
		}
		?>
		<div class="error">
			<p>
				<span><?php printf( // WPCS: XSS OK.
					__( 'Two-Factor: You are out of backup codes and need to <a href="%s">regenerate!</a>', 'it-l10n-ithemes-security-pro' ),
					esc_url( get_edit_user_link( $user->ID ) . '#two-factor-backup-codes' )
				); ?><span>
			</p>
		</div>
		<?php
	}
 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 public function get_value($post_id)
 {
     $value = '';
     if ($user_id = $this->get_raw_value($post_id)) {
         $value = $this->get_display_name($user_id);
     }
     switch ($this->get_option('user_link_to')) {
         case 'edit_user':
             $link = get_edit_user_link($user_id);
             break;
         case 'view_user_posts':
             $link = add_query_arg(array('post_type' => get_post_field('post_type', $post_id), 'author' => get_the_author_meta('ID')), 'edit.php');
             break;
         case 'view_author':
             $link = get_author_posts_url($user_id);
             break;
         default:
             $link = '';
     }
     if ($link) {
         $value = '<a href="' . esc_url($link) . '">' . $value . '</a>';
     }
     return $value;
 }
 function column_default($item, $column_name)
 {
     $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     switch ($column_name) {
         case 'auction_id':
             return '<a href="' . get_permalink($item[$column_name]) . '">' . get_the_title($item[$column_name]) . '</a>';
         case 'bid':
             return wc_price($item[$column_name]);
         case 'date':
             return $item[$column_name];
         case 'userid':
             $userdata = get_userdata($item[$column_name]);
             if ($userdata) {
                 $filter = esc_attr(add_query_arg('userid', $item[$column_name], $url));
                 return '<a href="' . get_edit_user_link($item[$column_name]) . '">' . esc_attr($userdata->user_nicename) . '</a> <a href="' . $filter . '" class="user-filter"></a>';
             } else {
                 return 'User id:' . $item[$column_name];
             }
         case 'proxy':
             return $item[$column_name] == 1 ? 'Yes' : '';
         default:
             return $item[$column_name];
     }
 }
Example #28
0
        }
        // Update the email address in signups, if present.
        if (is_multisite()) {
            $user = get_userdata($user_id);
            if ($user->user_login && isset($_POST['email']) && is_email($_POST['email']) && $wpdb->get_var($wpdb->prepare("SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login))) {
                $wpdb->query($wpdb->prepare("UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST['email'], $user_login));
            }
        }
        // Update the user.
        $errors = edit_user($user_id);
        // Grant or revoke super admin status if requested.
        if (is_multisite() && is_network_admin() && !IS_PROFILE_PAGE && current_user_can('manage_network_options') && !isset($super_admins) && empty($_POST['super_admin']) == is_super_admin($user_id)) {
            empty($_POST['super_admin']) ? revoke_super_admin($user_id) : grant_super_admin($user_id);
        }
        if (!is_wp_error($errors)) {
            $redirect = add_query_arg('updated', true, get_edit_user_link($user_id));
            if ($wp_http_referer) {
                $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
            }
            wp_redirect($redirect);
            exit;
        }
    default:
        $profileuser = get_user_to_edit($user_id);
        if (!current_user_can('edit_user', $user_id)) {
            wp_die(__('You do not have permission to edit this user.'));
        }
        $sessions = WP_Session_Tokens::get_instance($profileuser->ID);
        include ABSPATH . 'wp-admin/admin-header.php';
        ?>
Example #29
0
    /**
     * Comment form
     */
    function zee_comment_form($args = array(), $post_id = null)
    {
        if (null === $post_id) {
            $post_id = get_the_ID();
        } else {
            $id = $post_id;
        }
        $commenter = wp_get_current_commenter();
        $user = wp_get_current_user();
        $user_identity = $user->exists() ? $user->display_name : '';
        if (!isset($args['format'])) {
            $args['format'] = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml';
        }
        $req = get_option('require_name_email');
        $aria_req = $req ? " aria-required='true'" : '';
        $html5 = 'html5' === $args['format'];
        $fields = array('author' => '
        <div class="form-group">
        <div class="col-sm-6 comment-form-author">
        <input   class="form-control"  id="author" 
        placeholder="' . __('Name', ZEETEXTDOMAIN) . '" name="author" type="text" 
        value="' . esc_attr($commenter['comment_author']) . '" ' . $aria_req . ' />
        </div>', 'email' => '<div class="col-sm-6 comment-form-email">
        <input id="email" class="form-control" name="email" 
        placeholder="' . __('Email', ZEETEXTDOMAIN) . '" ' . ($html5 ? 'type="email"' : 'type="text"') . ' 
        value="' . esc_attr($commenter['comment_author_email']) . '" ' . $aria_req . ' />
        </div>
        </div>', 'url' => '<div class="form-group">
        <div class=" col-sm-12 comment-form-url">' . '<input  class="form-control" placeholder="' . __('Website', ZEETEXTDOMAIN) . '"  id="url" name="url" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_url']) . '"  />
        </div></div>');
        $required_text = sprintf(' ' . __('Required fields are marked %s', ZEETEXTDOMAIN), '<span class="required">*</span>');
        $defaults = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_field' => '
    <div class="form-group comment-form-comment">
    <div class="col-sm-12">
    <textarea class="form-control" id="comment" name="comment" placeholder="' . _x('Comment', 'noun', ZEETEXTDOMAIN) . '" rows="8" aria-required="true"></textarea>
    </div>
    </div>
    ', 'must_log_in' => '


    <div class="alert alert-danger must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</div>', 'logged_in_as' => '<div class="alert alert-info logged-in-as">' . sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', ZEETEXTDOMAIN), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</div>', 'comment_notes_before' => '<div class="alert alert-info comment-notes">' . __('Your email address will not be published.', ZEETEXTDOMAIN) . ($req ? $required_text : '') . '</div>', 'comment_notes_after' => '<div class="form-allowed-tags">' . sprintf(__('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s', ZEETEXTDOMAIN), ' <code>' . allowed_tags() . '</code>') . '</div>', 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __('Leave a Reply', ZEETEXTDOMAIN), 'title_reply_to' => __('Leave a Reply to %s', ZEETEXTDOMAIN), 'cancel_reply_link' => __('Cancel reply', ZEETEXTDOMAIN), 'label_submit' => __('Post Comment', ZEETEXTDOMAIN), 'format' => 'xhtml');
        $args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults));
        if (comments_open($post_id)) {
            ?>

<?php 
            do_action('comment_form_before');
            ?>

<div id="respond" class="comment-respond">

    <h3 id="reply-title" class="comment-reply-title">
        <?php 
            comment_form_title($args['title_reply'], $args['title_reply_to']);
            ?>
 
        <small><?php 
            cancel_comment_reply_link($args['cancel_reply_link']);
            ?>
</small>
    </h3>

    <?php 
            if (get_option('comment_registration') && !is_user_logged_in()) {
                ?>

    <?php 
                echo $args['must_log_in'];
                ?>

    <?php 
                do_action('comment_form_must_log_in_after');
                ?>

    <?php 
            } else {
                ?>

    <form action="<?php 
                echo site_url('/wp-comments-post.php');
                ?>
" method="post" id="<?php 
                echo esc_attr($args['id_form']);
                ?>
" 
        class="form-horizontal comment-form"<?php 
                echo $html5 ? ' novalidate' : '';
                ?>
 role="form">
        <?php 
                do_action('comment_form_top');
                ?>

        <?php 
                if (is_user_logged_in()) {
                    ?>

        <?php 
                    echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity);
                    ?>

        <?php 
                    do_action('comment_form_logged_in_after', $commenter, $user_identity);
                    ?>

        <?php 
                } else {
                    ?>

        <?php 
                    echo $args['comment_notes_before'];
                    ?>

        <?php 
                    do_action('comment_form_before_fields');
                    foreach ((array) $args['fields'] as $name => $field) {
                        echo apply_filters("comment_form_field_{$name}", $field) . "\n";
                    }
                    do_action('comment_form_after_fields');
                }
                echo apply_filters('comment_form_field_comment', $args['comment_field']);
                echo $args['comment_notes_after'];
                ?>

    <div class="form-submit">
        <input class="btn btn-danger btn-lg" name="submit" type="submit" id="<?php 
                echo esc_attr($args['id_submit']);
                ?>
" value="<?php 
                echo esc_attr($args['label_submit']);
                ?>
" />
        <?php 
                comment_id_fields($post_id);
                ?>
    </div>

    <?php 
                do_action('comment_form', $post_id);
                ?>

</form>

<?php 
            }
            ?>

</div><!-- #respond -->
<?php 
            do_action('comment_form_after');
        } else {
            do_action('comment_form_comments_closed');
        }
    }
Example #30
-1
 /**
  * @see CPAC_Column::get_value()
  * @since 2.4.7
  */
 public function get_value($id)
 {
     $raw_value = $this->get_raw_value($id);
     // Get page to link to
     switch ($this->get_option('post_link_to')) {
         case 'edit_post':
             $link = get_edit_post_link($raw_value);
             break;
         case 'view_post':
             $link = get_permalink($raw_value);
             break;
         case 'edit_author':
             $link = get_edit_user_link(get_post_field('post_author', $raw_value));
             break;
         case 'view_author':
             $link = get_author_posts_url(get_post_field('post_author', $raw_value));
             break;
     }
     // Get property of post to display
     switch ($this->get_option('post_property_display')) {
         case 'author':
             $label = get_the_author_meta('display_name', get_post_field('post_author', $raw_value));
             break;
         case 'id':
             $label = $raw_value;
             break;
         default:
             $label = get_the_title($raw_value);
             break;
     }
     $value = $link ? "<a href='{$link}'>{$label}</a>" : $label;
     return $value;
 }