本文整理汇总了PHP中get_currentuserinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP get_currentuserinfo函数的具体用法?PHP get_currentuserinfo怎么用?PHP get_currentuserinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_currentuserinfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: save_keyword
/**
* Saves keyword and referer info to db
*
*
*/
function save_keyword($keyword, $referer)
{
global $wpdb;
if (!$keyword) {
return false;
}
$date = date('YmdHi');
$referer_info = parse_url($referer);
$mySearch =& new WP_Query("s={$keyword} & showposts=-1");
$NumResults = $mySearch->post_count;
if (is_user_logged_in()) {
global $current_user;
get_currentuserinfo();
$user = $current_user->ID;
} else {
$user = 'Non-Registered';
}
$search_count = search_count($keyword, $user);
$repeat_coount = repeat_count($keyword, $user);
if ($repeat_coount != null) {
if (is_numeric($user)) {
$row = $wpdb->get_var("SELECT id FROM " . SS_TABLE . " WHERE keywords = '" . mysql_escape_string($keyword) . "' and user='" . mysql_escape_string($user) . "'");
} else {
$row = $wpdb->get_var("SELECT id FROM " . SS_TABLE . " WHERE keywords = '" . mysql_escape_string($keyword) . "'");
}
$wpdb->update(SS_TABLE, array('query_date' => $date, 'repeat_count' => ++$repeat_coount, 'search_count' => $NumResults), array('id' => $row), array('%s', '%s', '%s', '%s', '%s', '%d', '%d'));
} else {
$wpdb->insert(SS_TABLE, array('keywords' => $keyword, 'query_date' => $date, 'source' => $referer_info['host'], 'user' => $user, 'agent' => $_SERVER['HTTP_USER_AGENT'], 'repeat_count' => 0, 'search_count' => $NumResults), array('%s', '%s', '%s', '%s', '%s', '%d', '%d'));
}
}
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:35,代码来源:ss-keyword-trace.php
示例2: jobman_store_comment
function jobman_store_comment()
{
global $current_user;
get_currentuserinfo();
$comment = array('comment_post_ID' => $_REQUEST['interview'], 'comment_content' => $_REQUEST['comment'], 'user_id' => $current_user->ID);
wp_insert_comment($comment);
}
开发者ID:pduobert,项目名称:wordpress-job-manager,代码行数:7,代码来源:admin-comments.php
示例3: get_user_info
function get_user_info($i)
{
// return meta_key value
global $current_user;
get_currentuserinfo();
return $current_user->{$i};
}
开发者ID:keyshames,项目名称:tcm2016,代码行数:7,代码来源:functions.php
示例4: sendTestEmail
function sendTestEmail()
{
global $current_user, $wpdb;
get_currentuserinfo();
//from site settings
$thisBlogName = get_bloginfo('name');
$thisBlogUrl = site_url();
$test_adminmail = $current_user->user_email;
//fabricated for testing
$test_username = 'test_username';
$test_password = 'test_password';
//posted vars from ajax
$test_fromreply = $_POST['test_email'];
$test_loginurl = $_POST['test_loginurl'];
$test_mailsubject = $_POST['test_mailhead'];
$test_mailtext = $_POST['test_mailtext'];
//replace instances of shortcodes
$emailkeywords = array('[sitename]', '[siteurl]', '[siteloginurl]', '[username]', '[password]', '[useremail]', '[fromreply]');
$emailreplaces = array($thisBlogName, '<a href="' . $thisBlogUrl . '">' . $thisBlogUrl . '</a>', '<a href="' . $test_loginurl . '">' . $test_loginurl . '</a>', $test_username, $test_password, $test_fromreply, $test_fromreply);
$subject = str_replace($emailkeywords, $emailreplaces, $test_mailsubject);
$message = str_replace($emailkeywords, $emailreplaces, $test_mailtext);
//create valid header
$headers = 'From: ' . $test_fromreply . ' <' . $test_fromreply . '>' . "\r\n";
//filter to create html email
add_filter('wp_mail_content_type', create_function('', 'return "text/html"; '));
//send email
wp_mail($test_adminmail, $subject, $message, $headers);
exit;
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:29,代码来源:ajaxfunctions.php
示例5: comments_template
function comments_template($file = '/comments.php')
{
global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity;
if (is_single() || is_page() || $withcomments) {
$req = get_settings('require_name_email');
$comment_author = isset($_COOKIE['comment_author_' . COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_' . COOKIEHASH])) : '';
$comment_author_email = isset($_COOKIE['comment_author_email_' . COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_email_' . COOKIEHASH])) : '';
$comment_author_url = isset($_COOKIE['comment_author_url_' . COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_url_' . COOKIEHASH])) : '';
if (empty($comment_author)) {
$comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_post_ID = '{$post->ID}' AND comment_approved = '1' ORDER BY comment_date");
} else {
$author_db = $wpdb->escape($comment_author);
$email_db = $wpdb->escape($comment_author_email);
$comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_post_ID = '{$post->ID}' AND ( comment_approved = '1' OR ( comment_author = '{$author_db}' AND comment_author_email = '{$email_db}' AND comment_approved = '0' ) ) ORDER BY comment_date");
}
get_currentuserinfo();
define('COMMENTS_TEMPLATE', true);
$include = apply_filters('comments_template', TEMPLATEPATH . $file);
if (file_exists($include)) {
require $include;
} else {
require ABSPATH . 'wp-content/themes/default/comments.php';
}
}
}
开发者ID:robertlange81,项目名称:Website,代码行数:25,代码来源:comment-functions.php
示例6: jakoblist_add
function jakoblist_add()
{
/*####################################################################################
# This function provides add end edit functionality. If there's an ID in the URL the #
# corrensponding database entry will be edited; if there's no ID a new entry is #
# created. #
#####################################################################################*/
global $wpdb;
//Important! DBQueries don't work without this!
global $current_user;
get_currentuserinfo();
$id = $_GET["id"];
$thetitle = $_POST["title"];
$theauthor = $_POST["author"];
$thepublisher = $_POST["publisher"];
$theinfo = $_POST["info"];
$theprice = str_replace(',', '.', $_POST["price"]);
$thecreation = current_time('mysql');
$thecreator = $current_user->user_login;
$themodification = current_time('mysql');
$themodificator = $current_user->user_login;
$table_name = $wpdb->prefix . "jakoblist";
$_POST['active'] ? $active = 1 : ($active = 0);
if (!$id == '1') {
$wpdb->insert($table_name, array('created' => $thecreation, 'createdby' => $thecreator, 'title' => $thetitle, 'author' => $theauthor, 'publisher' => $thepublisher, 'info' => $theinfo, 'price' => $theprice, 'active' => $active));
} else {
$wpdb->update($wpdb->prefix . 'jakoblist', array('title' => $thetitle, 'modifiedby' => $themodificator, 'modified' => $themodification, 'author' => $theauthor, 'publisher' => $thepublisher, 'info' => $theinfo, 'price' => $theprice, 'active' => $active), array('id' => $id));
}
}
开发者ID:Jutosa,项目名称:Jakoblist,代码行数:29,代码来源:jakoblist.php
示例7: get_current_user
/**
* Gets the current logged in user's profile
*
* @return object
*/
private function get_current_user()
{
global $current_user;
get_currentuserinfo();
// no need to check return value - we know a user is logged in
return $current_user;
}
开发者ID:RA2WP,项目名称:RA2WP,代码行数:12,代码来源:my_profile_controller.php
示例8: cpm_mail_new
/**
* Sends a message to subscribed users informing them of a new PM
*
* @global $current_user
* @param $message_id
*/
function cpm_mail_new($message_id)
{
global $current_user;
get_currentuserinfo();
$message = cpm_getMessageInfo($message_id);
foreach ($message['users'] as $user_id) {
if ($current_user->ID != $user_id && cpm_userCheckSubscription($user_id, $message['thread_id'])) {
$user = get_user_by('id', $user_id);
if ($user) {
$to = $user->user_email;
//$to = '[email protected]'; /** @todo Remove this: DEBUG */
$from_name = get_option('cpm_email_from_name');
$from_email = get_option('cpm_email_from_email');
$subject = get_option('cpm_email_subject');
$contents = nl2br(get_option('cpm_email_body'));
$replace['%sender%'] = $current_user->display_name;
$replace['%subject%'] = $message['subject'];
$replace['%recipient%'] = $user->display_name;
$replace['%blog_name%'] = get_bloginfo('name');
$replace['%blog_email%'] = get_bloginfo('admin_email');
$replace['%pm_link%'] = cpm_buildURL(array('cpm_action' => 'read', 'cpm_id' => $message['thread_id'])) . '#cpm-message-' . $message['id'];
$replace['%message%'] = $message['message'];
list($from_name, $from_email, $subject, $contents) = str_replace(array_keys($replace), $replace, array($from_name, $from_email, $subject, $contents));
$headers = "MIME-Version: 1.0\n" . 'From: ' . $from_name . ' <' . $from_email . '>' . "\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
wp_mail($to, $subject, $contents, $headers);
do_action('cpm_mail', $message_id, $user->ID);
}
}
}
}
开发者ID:alphaomegahost,项目名称:FIN,代码行数:36,代码来源:cpm_email.php
示例9: wppa_get_user
function wppa_get_user($type = 'login')
{
global $current_user;
if (is_user_logged_in()) {
get_currentuserinfo();
switch ($type) {
case 'login':
return $current_user->user_login;
break;
case 'display':
return $current_user->display_name;
break;
case 'id':
return $current_user->ID;
break;
case 'firstlast':
return $current_user->user_firstname . ' ' . $current_user->user_lastname;
break;
default:
wppa_dbg_msg('Un-implemented type: ' . $type . ' in wppa_get_user()', 'red', 'force');
return '';
}
} else {
return $_SERVER['REMOTE_ADDR'];
}
}
开发者ID:billadams,项目名称:forever-frame,代码行数:26,代码来源:wppa-users.php
示例10: wpmp_add_product
function wpmp_add_product()
{
if (wp_verify_nonce($_POST['__product_wpmp'], 'wpmp-product') && $_POST['task'] == '') {
if ($_POST['post_type'] == "wpmarketplace") {
global $current_user, $wpdb;
get_currentuserinfo();
$my_post = array('post_title' => $_POST['product']['post_title'], 'post_content' => $_POST['product']['post_content'], 'post_excerpt' => $_POST['product']['post_excerpt'], 'post_status' => "draft", 'post_author' => $current_user->ID, 'post_type' => "wpmarketplace");
//echo $_POST['id'];
if ($_POST['id']) {
//update post
$my_post['ID'] = $_REQUEST['id'];
wp_update_post($my_post);
$postid = $_REQUEST['id'];
} else {
//insert post
$postid = wp_insert_post($my_post);
}
update_post_meta($postid, "wpmp_list_opts", $_POST['wpmp_list']);
foreach ($_POST['wpmp_list'] as $k => $v) {
update_post_meta($postid, $k, $v);
}
//echo $_POST['wpmp_list']['fimage'];
if ($_POST['wpmp_list']['fimage']) {
$wp_filetype = wp_check_filetype(basename($_POST['wpmp_list']['fimage']), null);
$attachment = array('post_mime_type' => $wp_filetype['type'], 'post_title' => preg_replace('/\\.[^.]+$/', '', basename($_POST['wpmp_list']['fimage'])), 'post_content' => '', 'guid' => $_POST['wpmp_list']['fimage'], 'post_status' => 'inherit');
$attach_id = wp_insert_attachment($attachment, $_POST['wpmp_list']['fimage'], $postid);
set_post_thumbnail($postid, $attach_id);
}
}
//echo $_SERVER['HTTP_REFERER'];
header("Location: " . $_SERVER['HTTP_REFERER']);
die;
}
}
开发者ID:tvolmari,项目名称:hammydowns,代码行数:34,代码来源:functions_old.php
示例11: GenerateCSV
function GenerateCSV()
{
# constructor
global $current_user;
get_currentuserinfo();
$this->current_user = $current_user;
$this->month = mysql_real_escape_string($_GET['month']);
// MM-YYYY
if ($this->month == '') {
$this->month = $this->get_current_month_year();
}
$userid = $this->get_userid(mysql_real_escape_string($_GET['user']));
if ($userid != '') {
$this->user = $userid;
// username
} else {
$this->user = $this->current_user->ID;
}
$this->last_x_months = mysql_real_escape_string($_GET['last']);
if ($this->last_x_months == '') {
$this->last_x_months = 6;
} else {
if ($this->last_x_months < 2) {
$this->last_x_months = 2;
} else {
if ($this->last_x_months > 12) {
$this->last_x_months = 12;
}
}
}
$this->view();
}
开发者ID:hewu,项目名称:blogwp,代码行数:32,代码来源:generate_csv.php
示例12: wpsc_google_checkout_submit
/**
* WP eCommerce checkout class
*
* These are the class for the WP eCommerce checkout
* The checkout class handles dispaying the checkout form fields
*
* @package wp-e-commerce
* @subpackage wpsc-checkout-classes
*/
function wpsc_google_checkout_submit()
{
global $wpdb, $wpsc_cart, $current_user;
$wpsc_checkout = new wpsc_checkout();
$purchase_log_id = $wpdb->get_var("SELECT `id` FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid` IN('" . $_SESSION['wpsc_sessionid'] . "') LIMIT 1");
//$purchase_log_id = 1;
get_currentuserinfo();
// exit('<pre>'.print_r($current_user, true).'</pre>');
if ($current_user->display_name != '') {
foreach ($wpsc_checkout->checkout_items as $checkoutfield) {
// exit(print_r($checkoutfield,true));
if ($checkoutfield->unique_name == 'billingfirstname') {
$checkoutfield->value = $current_user->display_name;
}
}
}
if ($current_user->user_email != '') {
foreach ($wpsc_checkout->checkout_items as $checkoutfield) {
// exit(print_r($checkoutfield,true));
if ($checkoutfield->unique_name == 'billingemail') {
$checkoutfield->value = $current_user->user_email;
}
}
}
$wpsc_checkout->save_forms_to_db($purchase_log_id);
$wpsc_cart->save_to_db($purchase_log_id);
$wpsc_cart->submit_stock_claims($purchase_log_id);
}
开发者ID:kasima,项目名称:wp-e-commerce-ezp,代码行数:37,代码来源:checkout.class.php
示例13: ymind_activate
function ymind_activate()
{
get_currentuserinfo();
global $current_user, $wpdb;
if (!get_option('ymind_redirect_url')) {
//delete cookie and log ou5
$url = get_option('siteurl') . '/wp-login.php';
$mail_subject = '' . __('Multiple Users Detected on user account', 'ymind') . '';
$mail_message = '' . __('Your User Account was accessed from two seperate IP addresses at the same time. Click the following link to reactivate your account:', 'ymind') . ' [activation_link]';
$email_offender = '0';
$timeout_minutes = 5;
$timeout_logins = 2;
$lockout_option = 1;
$lockout_minutes = 5;
$login_error = '' . __('Your account has been locked out.', 'ymind') . '';
$activation_url = get_option('siteurl') . '/wp-login.php';
add_option('ymind_redirect_url', $url);
add_option('ymind_email_offender', $email_offender);
add_option('ymind_mail_subject', $mail_subject);
add_option('ymind_mail_message', $mail_message);
add_option('ymind_timeout_minutes', $timeout_minutes);
add_option('ymind_timeout_logins', $timeout_logins);
add_option('ymind_lockout_option', $lockout_option);
add_option('ymind_locked_out_error', $login_error);
add_option('ymind_lockout_minutes', $lockout_minutes);
add_option('ymind_activate_redirect', $activation_url);
}
ymind_mysql_import(YMIND_SQL_IMPORT_FILE);
}
开发者ID:AdultStack,项目名称:ap-members,代码行数:29,代码来源:ymind_initialise.include.php
示例14: get_wp_login_form
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;
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:34,代码来源:simple-login.php
示例15: edd_pl_get_file_purchases
/**
* Gets the number of purchases for a variably priced download
*
* @since 1.0.6
* @param int $download_id The ID for this download
* @param int $price_id The price ID for this item
* @param string $user_email The email for the purchaser
* @return mixed $purchases
*/
function edd_pl_get_file_purchases($download_id = 0, $price_id = 0, $user_email = false)
{
global $post;
$post_old = $post;
$scope = edd_get_option('edd_purchase_limit_scope') ? edd_get_option('edd_purchase_limit_scope') : 'site-wide';
// Retrieve all sales of this download
$query_args = array('download' => $download_id, 'number' => -1);
// Override global search if site-wide isn't selected
if ($scope != 'site-wide') {
if (!$user_email) {
get_currentuserinfo();
}
$query_args['s'] = $user_email;
}
// Get all purchases for this download
$query = new EDD_Payments_Query($query_args);
$payments = $query->get_payments();
$purchased = 0;
// Count purchases
foreach ($payments as $payment_id => $payment_data) {
foreach ($payment_data->cart_details as $cart_item) {
if (isset($cart_item['item_number']['options']['price_id']) && (int) $cart_item['item_number']['options']['price_id'] == (int) $price_id) {
$purchased++;
}
}
}
wp_reset_postdata();
$post = $post_old;
return $purchased;
}
开发者ID:brashrebel,项目名称:EDD-Purchase-Limit,代码行数:39,代码来源:functions.php
示例16: userAccessManagerAP
/**
* Creates the filters and actions for the admin panel
*
* @return null;
*/
function userAccessManagerAP()
{
global $userAccessManager, $current_user;
if (!isset($userAccessManager)) {
return;
}
$userAccessManager->setAtAdminPanel();
$uamOptions = $userAccessManager->getAdminOptions();
if ($userAccessManager->isDatabaseUpdateNecessary()) {
$link = 'admin.php?page=uam_setup';
add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . sprintf(TXT_UAM_NEED_DATABASE_UPDATE, $link) . '</strong></p></div>\';'));
}
get_currentuserinfo();
$curUserdata = get_userdata($current_user->ID);
$uamAccessHandler = $userAccessManager->getAccessHandler();
if ($uamAccessHandler->checkUserAccess() || $uamOptions['authors_can_add_posts_to_groups'] == 'true') {
//Admin actions
if (function_exists('add_action')) {
add_action('admin_print_styles', array(&$userAccessManager, 'addStyles'));
add_action('wp_print_scripts', array(&$userAccessManager, 'addScripts'));
add_action('manage_posts_custom_column', array(&$userAccessManager, 'addPostColumn'), 10, 2);
add_action('manage_pages_custom_column', array(&$userAccessManager, 'addPostColumn'), 10, 2);
add_action('save_post', array(&$userAccessManager, 'savePostData'));
add_action('manage_media_custom_column', array(&$userAccessManager, 'addPostColumn'), 10, 2);
//Actions are only called when the attachment content is modified so we can't use it.
//add_action('add_attachment', array(&$userAccessManager, 'savePostData'));
//add_action('edit_attachment', array(&$userAccessManager, 'savePostData'));
add_action('edit_user_profile', array(&$userAccessManager, 'showUserProfile'));
add_action('profile_update', array(&$userAccessManager, 'saveUserData'));
add_action('edit_category_form', array(&$userAccessManager, 'showCategoryEditForm'));
add_action('create_category', array(&$userAccessManager, 'saveCategoryData'));
add_action('edit_category', array(&$userAccessManager, 'saveCategoryData'));
}
//Admin filters
if (function_exists('add_filter')) {
//The filter we use instead of add|edit_attachment action, reason see top
add_filter('attachment_fields_to_save', array(&$userAccessManager, 'saveAttachmentData'));
add_filter('manage_posts_columns', array(&$userAccessManager, 'addPostColumnsHeader'));
add_filter('manage_pages_columns', array(&$userAccessManager, 'addPostColumnsHeader'));
add_filter('manage_users_columns', array(&$userAccessManager, 'addUserColumnsHeader'), 10);
add_filter('manage_users_custom_column', array(&$userAccessManager, 'addUserColumn'), 10, 3);
add_filter('manage_edit-category_columns', array(&$userAccessManager, 'addCategoryColumnsHeader'));
add_filter('manage_category_custom_column', array(&$userAccessManager, 'addCategoryColumn'), 10, 3);
}
if ($uamOptions['lock_file'] == 'true') {
add_action('media_meta', array(&$userAccessManager, 'showMediaFile'), 10, 2);
add_filter('manage_media_columns', array(&$userAccessManager, 'addPostColumnsHeader'));
}
}
//Clean up at deleting should be always done.
if (function_exists('add_action')) {
add_action('update_option_permalink_structure', array(&$userAccessManager, 'updatePermalink'));
add_action('wp_dashboard_setup', array(&$userAccessManager, 'setupAdminDashboard'));
add_action('delete_post', array(&$userAccessManager, 'removePostData'));
add_action('delete_attachment', array(&$userAccessManager, 'removePostData'));
add_action('delete_user', array(&$userAccessManager, 'removeUserData'));
add_action('delete_category', array(&$userAccessManager, 'removeCategoryData'), 10, 2);
}
$userAccessManager->noRightsToEditContent();
}
开发者ID:nealmcc,项目名称:mirror-WP-user-access-manager,代码行数:65,代码来源:user-access-manager.php
示例17: getEntryOptionKeyForGF
function getEntryOptionKeyForGF($entry)
{
global $current_user;
get_currentuserinfo();
$option_key = $current_user->user_login . '_GF_' . $form['id'] . '_entry';
return $option_key;
}
开发者ID:healthcommcore,项目名称:osnap,代码行数:7,代码来源:persistent_multipage_forms.php
示例18: shiftnav_basic_user_profile
function shiftnav_basic_user_profile($atts)
{
extract(shortcode_atts(array('id' => -1), $atts));
$_user = '';
if ($id == -1) {
$id = get_current_user_id();
if ($id == 0) {
return '';
}
global $current_user;
get_currentuserinfo();
$_user = $current_user;
} else {
$_user = get_userdata($id);
}
if (!$_user) {
return '';
}
$html = '<div class="shiftnav-basic-user-profile shiftnav-basic-user-profile-' . $id . '">';
$default = '';
$html .= get_avatar($id, 40, $default, 'User Profile Image');
$html .= '<span class="shiftnav-basic-user-profile-name">' . $_user->display_name . '</span>';
$html .= '</div>';
return $html;
}
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:25,代码来源:shiftnav.pro.php
示例19: get_forms
/**
* A custom function to get the entries and sort them
*
* @since 1.2
* @returns array() $cols SQL results
*/
function get_forms($orderby = 'form_id', $order = 'ASC', $per_page, $offset = 0, $search = '')
{
global $wpdb, $current_user;
get_currentuserinfo();
// Save current user ID
$user_id = $current_user->ID;
// Get the Form Order type settings, if any
$user_form_order_type = get_user_meta($user_id, 'vfb-form-order-type', true);
// Get the Form Order settings, if any
$user_form_order = get_user_meta($user_id, 'vfb-form-order');
foreach ($user_form_order as $form_order) {
$form_order = implode(',', $form_order);
}
$where = '';
// Forms type filter
$where .= $this->get_form_status() && 'all' !== $this->get_form_status() ? $wpdb->prepare(' AND forms.form_status = %s', $this->get_form_status()) : '';
// Always display all forms, unless an Form Type filter is set
if (!$this->get_form_status() || in_array($this->get_form_status(), array('all', 'draft'))) {
$where .= $wpdb->prepare(' AND forms.form_status IN("%s", "%s")', 'publish', 'draft');
}
$sql_order = sanitize_sql_orderby("{$orderby} {$order}");
if (in_array($user_form_order_type, array('order', ''))) {
$sql_order = isset($form_order) ? "FIELD( form_id, {$form_order} )" : sanitize_sql_orderby('form_id DESC');
} else {
$sql_order = sanitize_sql_orderby('form_title ASC');
}
$cols = $wpdb->get_results("SELECT forms.form_id, forms.form_title, forms.form_status FROM {$this->form_table_name} AS forms WHERE 1=1 {$where} {$search} ORDER BY {$sql_order}");
return $cols;
}
开发者ID:adrianjonmiller,项目名称:animalhealth,代码行数:35,代码来源:class-forms-order.php
示例20: run
function run()
{
get_remote_help();
if (isset($_POST['epl_load_feedback_form']) && isset($_POST['epl_load_feedback_form']) == 1) {
global $current_user;
get_currentuserinfo();
$data = array();
$data['name'] = $current_user->first_name . ' ' . $current_user->last_name;
$data['email'] = $current_user->user_email;
$data['section'] = $_POST['section'];
$r = $this->epl->load_view('admin/feedback-form', $data, true);
} elseif (isset($_POST['epl_send_feedback']) && isset($_POST['epl_send_feedback']) == 1) {
$headers = 'From: ' . $_POST['name'] . "<{$_POST['email']}>" . "\r\n" . 'Reply-To: ' . "<{$_POST['email']}>" . "\r\n" . 'X-Mailer: PHP/' . phpversion();
$_POST['section'] = str_replace('_section__', '', $_POST['section']);
$r = wp_mail('[email protected]', 'Events Planner Feedback: ' . $_POST['reason'] . ': ' . $_POST['section'], esc_attr($_POST['message']), $headers);
if ($r) {
$r = 'Mail Sent, thank you very much. We will get back to you soon!';
} else {
$r = 'Sorry but something went wrong. Please try again.';
echo $this->epl_util->epl_invoke_error(0);
die;
}
} elseif ($_REQUEST['epl_action'] == 'epl_pricing_type') {
$this->pricing_type = (int) $_REQUEST['_epl_pricing_type'];
$r = $this->time_price_section();
} elseif ($_POST['epl_action'] == 'recurrence_preview' || $_POST['epl_action'] == 'recurrence_process') {
$this->r_mode = $_POST['epl_action'];
$this->erm = $this->epl->load_model('epl-recurrence-model');
$r = $this->erm->recurrence_dates_from_post($this->fields, $this->data['values'], $this->r_mode);
}
echo $this->epl_util->epl_response(array('html' => $r));
die;
}
开发者ID:Kemitestech,项目名称:WordPress-Skeleton,代码行数:33,代码来源:epl-event-manager.php
注:本文中的get_currentuserinfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论