• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_usermeta函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_usermeta函数的典型用法代码示例。如果您正苦于以下问题:PHP get_usermeta函数的具体用法?PHP get_usermeta怎么用?PHP get_usermeta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_usermeta函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: SOF_set_comment_karma

function SOF_set_comment_karma()
{
    global $wpdb, $current_user;
    if (!$_POST || !isset($_POST["commentID"]) || empty($_POST["commentID"])) {
        return;
    }
    $comment_id = $_POST["commentID"];
    // Cogemos datos del usuario
    get_currentuserinfo();
    $user_ID = $current_user->ID;
    if ($user_ID == 0 && get_option('SOF_register') == 'true') {
        die("Debes registrarte para poder votar");
    } else {
        if ($user_ID == 0) {
            $user_ID = str_replace(array('.', ':', ' '), "", SOF_getIp());
        }
    }
    $karma = get_usermeta($user_ID, "karma");
    // No puedes votarte a ti mismo.
    $sql = $wpdb->prepare("SELECT user_id FROM {$wpdb->comments} WHERE comment_ID = %d LIMIT 1", $comment_id);
    $commentUser = $wpdb->get_var($sql);
    if ($user_ID == (int) $commentUser) {
        die("No te puede votar a ti mismo");
    }
    // No puedes votar 2 veces
    if (get_usermeta($user_ID, "vote_" . $comment_id) == true) {
        die("No puedes votar dos veces el mismo comentario");
    }
    // Añadimos voto
    $newKarma = 1;
    // + $karma;
    if ($_POST["vote"] === '+') {
        $query = $wpdb->prepare("UPDATE {$wpdb->comments} SET comment_karma = comment_karma + {$newKarma} WHERE comment_ID = %d LIMIT 1", $comment_id);
    } else {
        if ($_POST["vote"] == '-') {
            $query = $wpdb->prepare("UPDATE {$wpdb->comments} SET comment_karma = comment_karma - {$newKarma} WHERE comment_ID = %d LIMIT 1", $comment_id);
        } else {
            return;
        }
    }
    $wpdb->query($query);
    // KARMA COMMENT
    if ($commentUser) {
        $karmaCommentUser = get_usermeta($commentUser, "karma");
        if ($_POST["vote"] === '+') {
            update_usermeta($commentUser, "karma", $karmaCommentUser + get_option('SOF_bonoOK'));
        } else {
            if ($_POST["vote"] === '-') {
                update_usermeta($commentUser, "karma", $karmaCommentUser + get_option('SOF_bonoKO'));
            }
        }
    }
    // Karma Voto
    if ($user_ID) {
        update_usermeta($user_ID, "karma", $karma + get_option('SOF_bonoVOTE'));
        update_usermeta($user_ID, "vote_" . $comment_id, true);
    }
    wp_redirect('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    exit;
}
开发者ID:gigikiri,项目名称:bcnAutoWallpaperSite,代码行数:60,代码来源:answers.php


示例2: affiliate_new_subscription

function affiliate_new_subscription($tosub_id, $tolevel_id, $to_order, $user_id)
{
    if (function_exists('get_user_meta')) {
        $aff = get_user_meta($user_id, 'affiliate_referred_by', true);
        $paid = get_user_meta($user_id, 'affiliate_paid', true);
    } else {
        $aff = get_usermeta($user_id, 'affiliate_referred_by');
        $paid = get_usermeta($user_id, 'affiliate_paid');
    }
    if (empty($aff)) {
        $aff = false;
    }
    if ($aff && $paid != 'yes') {
        $whole = get_option("membership_whole_payment_" . $tosub_id, 0);
        $partial = get_option("membership_partial_payment_" . $tosub_id, 0);
        if (!empty($whole) || !empty($partial)) {
            $amount = $whole . '.' . $partial;
        } else {
            $amount = 0;
        }
        do_action('affiliate_purchase', $aff, $amount);
        if (defined('AFFILIATE_PAYONCE') && AFFILIATE_PAYONCE == 'yes') {
            if (function_exists('update_user_meta')) {
                update_user_meta($user_id, 'affiliate_paid', 'yes');
            } else {
                update_usermeta($user_id, 'affiliate_paid', 'yes');
            }
        }
    }
}
开发者ID:hscale,项目名称:webento,代码行数:30,代码来源:membership.php


示例3: id_get_user_meta

function id_get_user_meta($id, $val)
{
    if (function_exists('get_user_meta')) {
        return get_user_meta($id, $val, true);
    }
    return get_usermeta($id, $val);
}
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:7,代码来源:intensedebate.php


示例4: xprofile_record_wire_post_notification

/**
 * xprofile_record_wire_post_notification()
 *
 * Records a notification for a new profile wire post to the database and sends out a notification
 * email if the user has this setting enabled.
 * 
 * @package BuddyPress XProfile
 * @param $wire_post_id The ID of the wire post
 * @param $user_id The id of the user that the wire post was sent to
 * @param $poster_id The id of the user who wrote the wire post
 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
 * @global $current_user WordPress global variable containing current logged in user information
 * @uses bp_is_home() Returns true if the current user being viewed is equal the logged in user
 * @uses get_usermeta() Get a user meta value based on meta key from wp_usermeta
 * @uses BP_Wire_Post Class Creates a new wire post object based on ID.
 * @uses site_url Returns the site URL
 * @uses wp_mail Sends an email
 */
function xprofile_record_wire_post_notification($wire_post_id, $user_id, $poster_id)
{
    global $bp, $current_user;
    if ($bp->current_component == $bp->wire->slug && !bp_is_home()) {
        bp_core_add_notification($poster_id, $user_id, 'xprofile', 'new_wire_post');
        if (!get_usermeta($bp->loggedin_user->id, 'notification_profile_wire_post') || 'yes' == get_usermeta($bp->loggedin_user->id, 'notification_profile_wire_post')) {
            $poster_name = bp_fetch_user_fullname($poster_id, false);
            $wire_post = new BP_Wire_Post($bp->profile->table_name_wire, $wire_post_id, true);
            $ud = get_userdata($user_id);
            $wire_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/wire';
            $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
            // Set up and send the message
            $to = $ud->user_email;
            $subject = '[' . get_blog_option(1, 'blogname') . '] ' . sprintf(__('%s posted on your wire.', 'buddypress'), stripslashes($poster_name));
            $message = sprintf(__('%s posted on your wire:

"%s"

To view your wire: %s

---------------------
', 'buddypress'), $poster_name, stripslashes($wire_post->content), $wire_link);
            $message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
            // Send it
            wp_mail($to, $subject, $message);
        }
    }
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:46,代码来源:bp-xprofile-notifications.php


示例5: Medieteknik_post_tweet

function Medieteknik_post_tweet($tweet, $hashtag)
{
    //get current user
    global $user_ID;
    get_currentuserinfo();
    //get the saved token for this user
    $token = get_usermeta($user_ID, 'twitter_token');
    $secret = get_usermeta($user_ID, 'twitter_token_secret');
    $oauth = new TwitterOAuth($token, $secret);
    $url = 'http://api.twitter.com/1/statuses/update.xml';
    if ($hashtag && strpos(strtolower($tweet), '#medieteknik') == false) {
        //add the hashtag
        $tweet = rtrim($tweet) . ' #medieteknik';
    }
    $params = array('status' => $tweet);
    $reply = $oauth->oauth_request($url, 'POST', $params);
    //Check our request came out ok
    if ($reply['status'] != 200) {
        if ($reply['status'] == 403) {
            die('Twitter tillåter endast 150 statusuppdateringar i timmen. Försök igen senare');
        } else {
            die('Något är galet med twitter. Försök igen senare eller kontakta sidansvarig');
        }
    }
    header('location: index.php');
}
开发者ID:jakbob,项目名称:medieteknik.org,代码行数:26,代码来源:twitter_post_status.php


示例6: user_columns

 /**
  * This function will add the expiration date to the users table
  * 
  * @return string
  */
 function user_columns($empty, $column, $userid)
 {
     //in case we want to add more columns later
     switch ($column) {
         case 'subscription_expiration':
             return get_usermeta($userid, 'subscription_expiration');
             break;
         case 'subscription_startdate':
             return get_usermeta($userid, 'subscription_startdate');
             break;
         case 'subscription_name':
             return get_usermeta($userid, 'subscription_name');
             break;
         case 'subscription_streetaddress':
             return get_usermeta($userid, 'subscription_streetaddress');
             break;
         case 'subscription_city':
             return get_usermeta($userid, 'subscription_city');
             break;
         case 'subscription_state':
             return get_usermeta($userid, 'subscription_state');
             break;
         case 'subscription_zip':
             return get_usermeta($userid, 'subscription_zip');
             break;
         case 'subscription_country':
             return get_usermeta($userid, 'subscription_country');
             break;
     }
     return '';
 }
开发者ID:Jonathonbyrd,项目名称:Member-Pro,代码行数:36,代码来源:siteclass.php


示例7: action_show_user_profile

    function action_show_user_profile($user)
    {
        if (function_exists('get_user_meta')) {
            $tweetbutton_twitter = get_user_meta($user->ID, 'tweetbutton_twitter', true);
            $tweetbutton_twitter_desc = get_user_meta($user->ID, 'tweetbutton_twitter_desc', true);
        } else {
            $tweetbutton_twitter = get_usermeta($user->ID, 'tweetbutton_twitter');
            $tweetbutton_twitter_desc = get_usermeta($user->ID, 'tweetbutton_twitter_desc');
        }
        ?>
    <h3>Twitter Info (Will be used on WP-TweetButton)</h3>

    <table class="form-table">
    <tr>
        <th><label for="tweetbutton_twitter">Twitter User name</label></th> 
        <td><input type="text" name="tweetbutton_twitter" id="tweetbutton_twitter" value="<?php 
        echo esc_attr($tweetbutton_twitter);
        ?>
" />
        <td><span class="description">Please enter your Twitter username.Don't add a link or @</span></td>
    </tr>
        <tr>
        <th><label for="tweetbutton_twitter_desc">Twitter Bio</label></th>
        <td><input type="text" name="tweetbutton_twitter_desc" id="tweetbutton_twitter_desc" value="<?php 
        echo esc_attr($tweetbutton_twitter_desc);
        ?>
" />
        <td><span class="description">Please enter a small Bio, ideally your Twitter Bio</span></td>
    </tr>
    </table>
    <?php 
    }
开发者ID:nunomorgadinho,项目名称:widgilabs.com,代码行数:32,代码来源:wp-tweetbutton.php


示例8: friends_notification_accepted_request

function friends_notification_accepted_request($friendship_id, $initiator_id, $friend_id)
{
    global $bp;
    $friendship = new BP_Friends_Friendship($friendship_id, false, false);
    $friend_name = bp_fetch_user_fullname($friend_id, false);
    if ('no' == get_usermeta((int) $initiator_id, 'notification_friends_friendship_accepted')) {
        return false;
    }
    $ud = get_userdata($initiator_id);
    $friend_ud = get_userdata($friend_id);
    $friend_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $friend_ud->user_login;
    $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
    // Set up and send the message
    $to = $ud->user_email;
    $subject = '[' . get_blog_option(1, 'blogname') . '] ' . sprintf(__('%s accepted your friendship request', 'buddypress'), $friend_name);
    $message = sprintf(__('%s accepted your friend request.

To view %s\'s profile: %s

---------------------
', 'buddypress'), $friend_name, $friend_name, $friend_link);
    $message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
    // Send it
    wp_mail($to, $subject, $message);
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:25,代码来源:bp-friends-notifications.php


示例9: get_user_meta

 function get_user_meta($user_ID, $meta_key)
 {
     if (function_exists('get_user_meta')) {
         return get_user_meta($user_ID, $meta_key, true);
     } else {
         return get_usermeta($user_ID, $meta_key);
     }
 }
开发者ID:AhmeddSayed,项目名称:MM_Portal,代码行数:8,代码来源:TouAppHelper.php


示例10: login_site_redirect

function login_site_redirect($redirect_to)
{
    global $user;
    $primary_blog_id = get_usermeta($user->ID, 'primary_blog');
    $blog_details = get_blog_details($primary_blog_id);
    $redirect_url = $blog_details->siteurl;
    return $redirect_url;
}
开发者ID:sburns90,项目名称:WP-MS-Login-Redirector,代码行数:8,代码来源:ms-login-redirector.php


示例11: bp_forums_setup

function bp_forums_setup()
{
    global $bp, $bbpress_live;
    if ('' == get_usermeta($bp->loggedin_user->id, 'bb_capabilities')) {
        bp_forums_make_user_active_member($bp->loggedin_user->id);
    }
    $bp->version_numbers->forums = BP_FORUMS_VERSION;
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:8,代码来源:bp-forums.php


示例12: testUpdateUserPerms

 function testUpdateUserPerms()
 {
     $admin = new WhatDidTheySayAdmin();
     $admin->_set_up_capabilities();
     update_usermeta(1, 'transcript_capabilities', array('submit_transcriptions' => true));
     $admin->_update_user_perms(1, array('approve_transcriptions' => 'yes'));
     $this->assertEquals(array('approve_transcriptions' => true), get_usermeta(1, 'transcript_capabilities'));
 }
开发者ID:johnbintz,项目名称:what-did-they-say,代码行数:8,代码来源:WhatDidTheySayAdminTest.php


示例13: cf_affiliate_new_paid

function cf_affiliate_new_paid($affiliate_settings, $user_id, $billing_type)
{
    global $blog_id, $site_id;
    if (empty($user_id)) {
        $user_id = get_current_user_id();
    }
    //echo 'in '. __FILE__ .': '. __FUNCTION__ .': '. __LINE__ .'<br />';
    //echo "affiliate_settings<pre>"; print_r($affiliate_settings); echo "</pre>";
    //echo "user_id[". $user_id ."]<br />";
    //echo "billing_type[". $billing_type ."<br />";
    //die();
    if (function_exists('get_user_meta')) {
        $aff = get_user_meta($user_id, 'affiliate_referred_by', true);
        $paid = get_user_meta($user_id, 'affiliate_paid', true);
    } else {
        $aff = get_usermeta($user_id, 'affiliate_referred_by');
        $paid = get_usermeta($user_id, 'affiliate_paid');
    }
    //echo "aff[". $aff ."]<br />";
    //echo "paid[". $paid ."]<br />";
    if (empty($aff)) {
        $aff = false;
    }
    if ($aff && $paid != 'yes') {
        if ('recurring' == $billing_type) {
            $whole = isset($affiliate_settings['cf_recurring_whole_payment']) ? $affiliate_settings['cf_recurring_whole_payment'] : '0';
            $partial = isset($affiliate_settings['cf_recurring_partial_payment']) ? $affiliate_settings['cf_recurring_partial_payment'] : '0';
            $note = __('Classifieds recurring', 'affiliate');
        } elseif ('one_time' == $billing_type) {
            $whole = isset($affiliate_settings['cf_one_time_whole_payment']) ? $affiliate_settings['cf_one_time_whole_payment'] : '0';
            $partial = isset($affiliate_settings['cf_one_time_partial_payment']) ? $affiliate_settings['cf_one_time_partial_payment'] : '0';
            $note = __('Classifieds one time', 'affiliate');
        } else {
            $whole = '0';
            $partial = '0';
            $note = __('Classifieds', 'affiliate') . ' ' . $billing_type;
        }
        //echo "whole[". $whole ."]<br />";
        //echo "partial[". $partial ."]<br />";
        if (!empty($whole) || !empty($partial)) {
            $amount = $whole . '.' . $partial;
        } else {
            $amount = 0;
        }
        if ($amount > 0) {
            //echo "amount[". $amount ."]<br />";
            $meta = array('affiliate_settings' => affiliate_settings, 'user_id' => $user_id, 'billing_type' => $billing_type, 'blog_id' => $blog_id, 'site_id' => $site_id, 'current_user_id' => get_current_user_id(), 'LOCAL_URL' => (is_ssl() ? 'https://' : 'http://') . esc_attr($_SERVER['HTTP_HOST']) . esc_attr($_SERVER['REQUEST_URI']), 'IP' => isset($_SERVER['HTTP_X_FORWARD_FOR']) ? esc_attr($_SERVER['HTTP_X_FORWARD_FOR']) : esc_attr($_SERVER['REMOTE_ADDR']));
            do_action('affiliate_purchase', $aff, $amount, 'paid:classifieds', $user_id, $note, $meta);
            if (defined('AFFILIATE_PAYONCE') && AFFILIATE_PAYONCE == 'yes') {
                if (function_exists('update_user_meta')) {
                    update_user_meta($user_id, 'affiliate_paid', 'yes');
                } else {
                    update_usermeta($user_id, 'affiliate_paid', 'yes');
                }
            }
        }
    }
}
开发者ID:vilmark,项目名称:vilmark_main,代码行数:58,代码来源:classifieds.php


示例14: wiziapp_handle_column

function wiziapp_handle_column($curr_val, $column_name, $user_id)
{
    if (strpos($column_name, 'wiziapp_') !== FALSE) {
        $val = get_usermeta($user_id, $column_name);
        return $val != '' ? $val : 'NO';
    }
    // We are here so it wasn't our column, return the current value
    return $curr_val;
}
开发者ID:sajidsan,项目名称:sajidsan.github.io,代码行数:9,代码来源:users_list.php


示例15: pf_get_vars

function pf_get_vars($id)
{
    $uinfo = get_userdata($id);
    foreach ($uinfo as $key => $value) {
        $vars[$key] = $value;
    }
    //let's see if this works any better than strictly using $vars['wp_capabilities']
    $vars['wp_capabilities'] = get_usermeta($id, 'wp_capabilities');
    return $vars;
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:10,代码来源:profiler.php


示例16: constantTest

 protected function constantTest()
 {
     $time = microtime(true);
     for ($i = 0; $i < $this->runNumber; $i++) {
         $user_id = 1;
         get_usermeta($user_id);
     }
     $time = microtime(true) - $time;
     $this->enterResult($time);
 }
开发者ID:AkimBolushbek,项目名称:wordpress-soc-2007,代码行数:10,代码来源:UserAndAuthorFunctions.php


示例17: populate

 /**
  * populate()
  *
  * Populate the instantiated class with data based on the User ID provided.
  * 
  * @package BuddyPress Core
  * @global $userdata WordPress user data for the current logged in user.
  * @uses bp_core_get_userurl() Returns the URL with no HTML markup for a user based on their user id
  * @uses bp_core_get_userlink() Returns a HTML formatted link for a user with the user's full name as the link text
  * @uses bp_core_get_user_email() Returns the email address for the user based on user ID
  * @uses get_usermeta() WordPress function returns the value of passed usermeta name from usermeta table
  * @uses bp_core_get_avatar() Returns HTML formatted avatar for a user
  * @uses bp_profile_last_updated_date() Returns the last updated date for a user.
  */
 function populate()
 {
     $this->user_url = bp_core_get_userurl($this->id);
     $this->user_link = bp_core_get_userlink($this->id);
     $this->fullname = bp_fetch_user_fullname($this->id, false);
     $this->email = bp_core_get_user_email($this->id);
     $this->last_active = bp_core_get_last_activity(get_usermeta($this->id, 'last_activity'), __('active %s ago', 'buddypress'));
     $this->avatar = bp_core_get_avatar($this->id, 2);
     $this->avatar_thumb = bp_core_get_avatar($this->id, 1);
     $this->avatar_mini = bp_core_get_avatar($this->id, 1, 25, 25, false);
 }
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:25,代码来源:bp-core-classes.php


示例18: rwi_user_profile_website_action

function rwi_user_profile_website_action($user_id)
{
    $website = get_usermeta($user_id, 'user_url');
    if ($website) {
        $status = true;
    } else {
        $status = false;
    }
    global $SimpleCondition;
    $SimpleCondition->check('rwi_user_profile_website', $user_id, $status);
}
开发者ID:ryanimel,项目名称:simple-points,代码行数:11,代码来源:user-has-website.php


示例19: messages_ajax_close_notice

function messages_ajax_close_notice()
{
    global $userdata;
    if (!isset($_POST['notice_id'])) {
        echo "-1[[split]]" . __('There was a problem closing the notice.', 'buddypress');
    } else {
        $notice_ids = get_usermeta($userdata->ID, 'closed_notices');
        $notice_ids[] = (int) $_POST['notice_id'];
        update_usermeta($userdata->ID, 'closed_notices', $notice_ids);
    }
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:11,代码来源:bp-messages-ajax.php


示例20: wpsc_display_product_form

function wpsc_display_product_form($product_id = 0)
{
    global $wpdb, $wpsc_product_defaults;
    $product_id = absint($product_id);
    //$variations_processor = new nzshpcrt_variations;
    if ($product_id > 0) {
        $product_data = $wpdb->get_row("SELECT * FROM `" . WPSC_TABLE_PRODUCT_LIST . "` WHERE `id`='{$product_id}' LIMIT 1", ARRAY_A);
        $product_data['meta']['dimensions'] = get_product_meta($product_id, 'dimensions', true);
        $product_data['meta']['external_link'] = get_product_meta($product_id, 'external_link', true);
        $product_data['meta']['merchant_notes'] = get_product_meta($product_id, 'merchant_notes', true);
        $product_data['meta']['sku'] = get_product_meta($product_id, 'sku', true);
        $product_data['meta']['hires_url'] = get_product_meta($product_id, 'hires_url', true);
        $product_data['meta']['engrave'] = get_product_meta($product_id, 'engraved', true);
        $product_data['meta']['can_have_uploaded_image'] = get_product_meta($product_id, 'can_have_uploaded_image', true);
        $product_data['meta']['table_rate_price'] = get_product_meta($product_id, 'table_rate_price', true);
        $sql = "SELECT `meta_key`, `meta_value` FROM " . WPSC_TABLE_PRODUCTMETA . " WHERE `meta_key` LIKE 'currency%' AND `product_id`=" . $product_id;
        $product_data['newCurr'] = $wpdb->get_results($sql, ARRAY_A);
        //echo "<pre>".print_r($product_data,true)."</pre>";
        if (function_exists('wp_insert_term')) {
            $term_relationships = $wpdb->get_results("SELECT * FROM `{$wpdb->term_relationships}` WHERE object_id = '{$product_id}'", ARRAY_A);
            foreach ((array) $term_relationships as $term_relationship) {
                $tt_ids[] = $term_relationship['term_taxonomy_id'];
            }
            foreach ((array) $tt_ids as $tt_id) {
                $term_ids[] = $wpdb->get_var("SELECT `term_id` FROM `{$wpdb->term_taxonomy}` WHERE `term_taxonomy_id` = '{$tt_id}' AND `taxonomy` = 'product_tag' LIMIT 1");
            }
            foreach ((array) $term_ids as $term_id) {
                if ($term_id != NULL) {
                    $tags[] = $wpdb->get_var("SELECT `name` FROM `{$wpdb->terms}` WHERE `term_id`='{$term_id}' LIMIT 1");
                }
            }
            if ($tags != NULL) {
                $imtags = implode(',', $tags);
            }
        }
        //exit('got called<pre>'.print_r($imtags,true).'</pre>');
        $check_variation_value_count = $wpdb->get_var("SELECT COUNT(*) as `count` FROM `" . WPSC_TABLE_VARIATION_VALUES_ASSOC . "` WHERE `product_id` = '{$product_id}'");
    } else {
        if (isset($_SESSION['wpsc_failed_product_post_data']) && count($_SESSION['wpsc_failed_product_post_data']) > 0) {
            $product_data = array_merge($wpsc_product_defaults, $_SESSION['wpsc_failed_product_post_data']);
            $_SESSION['wpsc_failed_product_post_data'] = null;
        } else {
            $product_data = $wpsc_product_defaults;
        }
    }
    $product_data = apply_filters('wpsc_display_product_form_get', $product_data);
    $current_user = wp_get_current_user();
    // we put the closed postboxes array into the product data to propagate it to each form without having it global.
    $product_data['closed_postboxes'] = (array) get_usermeta($current_user->ID, 'closedpostboxes_store_page_wpsc-edit-products');
    $product_data['hidden_postboxes'] = (array) get_usermeta($current_user->ID, 'metaboxhidden_store_page_wpsc-edit-products');
    if (count($product_data) > 0) {
        wpsc_product_basic_details_form($product_data);
    }
}
开发者ID:kasima,项目名称:wp-e-commerce-ezp,代码行数:54,代码来源:display-items-functions.php



注:本文中的get_usermeta函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_username函数代码示例发布时间:2022-05-15
下一篇:
PHP get_userlevel函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap