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

PHP get_user_meta函数代码示例

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

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



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

示例1: load_user

 public function load_user()
 {
     if ($this->id > 0) {
         $current_user = get_user_by('ID', $this->id);
     } elseif (function_exists('is_user_logged_in') && is_user_logged_in()) {
         $current_user = wp_get_current_user();
     }
     if (isset($current_user) && $current_user) {
         $this->id = $current_user->ID;
         $this->first_name = $current_user->user_firstname;
         $this->last_name = $current_user->user_lastname;
         $this->email = $current_user->user_email;
         $this->address = get_user_meta($current_user->ID, 'address', TRUE);
         $this->is_on_mailing_list = get_user_meta($current_user->ID, 'mailing_list', TRUE);
         $this->is_on_mailing_list = $this->is_on_mailing_list == 1 ? TRUE : FALSE;
         $neighborhood_id = get_user_meta($current_user->ID, 'neighborhood_id', TRUE);
         if (!empty($neighborhood_id) && $neighborhood_id > 0) {
             $args = array('post_type' => 'wbb_neighborhood', 'post_status' => 'publish');
             $query = new \WP_Query($args);
             while ($query->have_posts()) {
                 $query->the_post();
                 if (get_the_ID() == $neighborhood_id) {
                     $this->neighborhood = new Neighborhood();
                     $this->neighborhood->post_id = get_the_ID();
                     $this->neighborhood->title = get_the_title();
                     break;
                 }
             }
         }
         $this->get_locations();
     }
 }
开发者ID:TonyDeStefano,项目名称:Walk-Bike-Bus-Plugin,代码行数:32,代码来源:User.php


示例2: is_notification_dismissed

 /**
  * Check if the user has dismissed a notification
  *
  * @param Yoast_Notification $notification The notification to check for dismissal.
  * @param null|int           $user_id      User ID to check on.
  *
  * @return bool
  */
 public static function is_notification_dismissed(Yoast_Notification $notification, $user_id = null)
 {
     $user_id = !is_null($user_id) ? $user_id : get_current_user_id();
     $dismissal_key = $notification->get_dismissal_key();
     $current_value = get_user_meta($user_id, $dismissal_key, $single = true);
     return !empty($current_value);
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:15,代码来源:class-yoast-notification-center.php


示例3: test_update_metadata_by_mid

 function test_update_metadata_by_mid()
 {
     // Setup
     $meta = get_metadata_by_mid('user', $this->meta_id);
     // Update the meta value
     $this->assertTrue(update_metadata_by_mid('user', $this->meta_id, 'meta_new_value'));
     $meta = get_metadata_by_mid('user', $this->meta_id);
     $this->assertEquals('meta_new_value', $meta->meta_value);
     // Update the meta value
     $this->assertTrue(update_metadata_by_mid('user', $this->meta_id, 'meta_new_value', 'meta_new_key'));
     $meta = get_metadata_by_mid('user', $this->meta_id);
     $this->assertEquals('meta_new_key', $meta->meta_key);
     // Update the key and value
     $this->assertTrue(update_metadata_by_mid('user', $this->meta_id, 'meta_value', 'meta_key'));
     $meta = get_metadata_by_mid('user', $this->meta_id);
     $this->assertEquals('meta_key', $meta->meta_key);
     $this->assertEquals('meta_value', $meta->meta_value);
     // Update the value that has to be serialized
     $this->assertTrue(update_metadata_by_mid('user', $this->meta_id, array('first', 'second')));
     $meta = get_metadata_by_mid('user', $this->meta_id);
     $this->assertEquals(array('first', 'second'), $meta->meta_value);
     // Let's try some invalid meta data
     $this->assertFalse(update_metadata_by_mid('user', 0, 'meta_value'));
     $this->assertFalse(update_metadata_by_mid('user', $this->meta_id, 'meta_value', array('invalid', 'key')));
     // Let's see if caches get cleared after updates.
     $meta = get_metadata_by_mid('user', $this->meta_id);
     $first = get_user_meta($meta->user_id, $meta->meta_key);
     $this->assertTrue(update_metadata_by_mid('user', $this->meta_id, 'other_meta_value'));
     $second = get_user_meta($meta->user_id, $meta->meta_key);
     $this->assertFalse($first === $second);
 }
开发者ID:boonebgorges,项目名称:wp,代码行数:31,代码来源:meta.php


示例4: process

 /**
  *	Process the request
  *	@todo Setting for reassigning user's posts
  */
 public function process()
 {
     // Verify the security nonce and die if it fails
     if (!isset($_POST['wp_delete_user_accounts_nonce']) || !wp_verify_nonce($_POST['wp_delete_user_accounts_nonce'], 'wp_delete_user_accounts_nonce')) {
         wp_send_json(array('status' => 'fail', 'title' => __('Error!', 'wp-delete-user-accounts'), 'message' => __('Request failed security check.', 'wp-delete-user-accounts')));
     }
     // Don't permit admins to delete their own accounts
     if (current_user_can('manage_options')) {
         wp_send_json(array('status' => 'fail', 'title' => __('Error!', 'wp-delete-user-accounts'), 'message' => __('Administrators cannot delete their own accounts.', 'wp-delete-user-accounts')));
     }
     // Get the current user
     $user_id = get_current_user_id();
     // Get user meta
     $meta = get_user_meta($user_id);
     // Delete user's meta
     foreach ($meta as $key => $val) {
         delete_user_meta($user_id, $key);
     }
     // Destroy user's session
     wp_logout();
     // Delete the user's account
     $deleted = wp_delete_user($user_id);
     if ($deleted) {
         // Send success message
         wp_send_json(array('status' => 'success', 'title' => __('Success!', 'wp-delete-user-accounts'), 'message' => __('Your account was successfully deleted. Fair well.', 'wp-delete-user-accounts')));
     } else {
         wp_send_json(array('status' => 'fail', 'title' => __('Error!', 'wp-delete-user-accounts'), 'message' => __('Request failed.', 'wp-delete-user-accounts')));
     }
 }
开发者ID:EngageWP,项目名称:wp-delete-user-accounts,代码行数:33,代码来源:process-ajax.php


示例5: ti_profile_fields

function ti_profile_fields($user)
{
    $is_approved = get_user_meta($user->ID, 'ti_is_approved', true);
    ?>

    <h3>Approve User to view products</h3>

    <table class="form-table">

        <tr>
            <th><label for="twitter">Approve as patient</label></th>

            <td>
                <select name="ti_is_approved">
                    <option value="">No</option>
                    <option <?php 
    echo $is_approved == 1 ? 'selected' : '';
    ?>
 value="1">Yes</option>
                </select>
            </td>
        </tr>

    </table>
    <?php 
}
开发者ID:ankittiwaari,项目名称:techinceptum-demos,代码行数:26,代码来源:ti-woocommerce-customization.php


示例6: __construct

 /**
  * Class constructor
  * 
  * Sets definitions
  * Adds methods to appropriate hooks
  * 
  * @author Ronald Huereca <[email protected]>
  * @since 1.0.0
  * @access public
  * @param array $args    If not set, then uses $defaults instead
  */
 public function __construct($args)
 {
     // Get posts per page
     $user_id = get_current_user_id();
     $posts_per_page = get_user_meta($user_id, 'reorder_items_per_page', true);
     if (!is_numeric($posts_per_page)) {
         $posts_per_page = 50;
     }
     $offset = absint($posts_per_page - 2);
     // Parse arguments
     $defaults = array('post_type' => '', 'posts_per_page' => $posts_per_page, 'offset' => $offset);
     $args = wp_parse_args($args, $defaults);
     // Set variables
     $this->post_type = $args['post_type'];
     //Get offset and posts_per_page
     $this->posts_per_page = absint($args['posts_per_page']);
     //todo - filterable?
     $this->offset = absint($args['offset']);
     //todo - filterable?
     if ($this->offset > $this->posts_per_page) {
         $this->offset = $this->posts_per_page;
     }
     //Add-on actions/filters
     add_action('metronet_reorder_menu_url_' . $this->post_type, array($this, 'set_reorder_url'));
     add_action('reorder_by_terms_interface_' . $this->post_type, array($this, 'output_interface'));
     add_action('metronet_reorder_posts_add_menu_' . $this->post_type, array($this, 'script_init'));
     add_filter('metronet_reorder_posts_tabs_' . $this->post_type, array($this, 'add_tab'));
     //Ajax actions
     add_action('wp_ajax_reorder_terms_only_sort', array($this, 'ajax_term_sort'));
 }
开发者ID:ronalfy,项目名称:reorder-terms,代码行数:41,代码来源:class-reorder-terms-helper.php


示例7: rcl_ajax_delete_post

function rcl_ajax_delete_post()
{
    global $user_ID;
    if (!$user_ID) {
        return false;
    }
    $post = get_post(intval($_POST['post_id']));
    $res = wp_delete_post($post->ID);
    if ($res) {
        $temp_gal = get_user_meta($user_ID, 'tempgallery', 1);
        if ($temp_gal) {
            $cnt = count($temp_gal);
            foreach ((array) $temp_gal as $key => $gal) {
                if ($gal['ID'] == $_POST['post_id']) {
                    unset($temp_gal[$key]);
                }
            }
            foreach ((array) $temp_gal as $t) {
                $new_temp[] = $t;
            }
            if ($new_temp) {
                update_user_meta($user_ID, 'tempgallery', $new_temp);
            } else {
                delete_user_meta($user_ID, 'tempgallery');
            }
        }
        $log['result'] = 100;
        $log['post_type'] = $post->post_type;
    } else {
        $log['result'] = 1;
    }
    echo json_encode($log);
    exit;
}
开发者ID:stanislav-chechun,项目名称:campus-rize,代码行数:34,代码来源:fast-editor.php


示例8: WeddingGuest

 function WeddingGuest($id = null)
 {
     parent::__construct($id);
     $this->attending_wedding = (bool) get_user_meta($this->ID, '_attending_wedding', true);
     $this->attending_dinner = (bool) get_user_meta($this->ID, '_attending_dinner', true);
     $this->has_responded = (bool) ($this->_attending_wedding == '1' || $this->_attending_wedding == '0' || $this->_attending_dinner == '1' || $this->_attending_dinner == '0');
 }
开发者ID:ryanbagwell,项目名称:Wordpress-Weddings,代码行数:7,代码来源:class.guests.php


示例9: book_confirmed_responsable_template

function book_confirmed_responsable_template($user, $event, $email)
{
    $event_start_date = new DateTime(get_post_meta($event->ID, '_EventStartDate', true));
    $date = date_i18n("l d F Y", $event_start_date->getTimestamp());
    $user_meta = get_user_meta($user->ID);
    $full_name = $user_meta["first_name"][0] . " " . $user_meta["last_name"][0];
    ob_start();
    ?>

<p>
    Bonjour, merci d’avoir validé la participation au stage « Communication en situation d’urgence médiatique | Communication de crise » du <strong><?php 
    echo $date;
    ?>
</strong> de M/Mme <?php 
    echo $full_name;
    ?>
.
</p>

<p>
<?php 
    echo es_mail_sign();
    ?>
</p>

<?php 
    $mail = ob_get_contents();
    ob_clean();
    return $mail;
}
开发者ID:gabriel-dehan,项目名称:erdf-sessions,代码行数:30,代码来源:book_confirmed.php


示例10: init

 public function init(&$existing_meta_keys = array())
 {
     if (!self::$is_active) {
         return;
     }
     if (!empty(XmlExportEngine::$exportQuery->results)) {
         foreach (XmlExportEngine::$exportQuery->results as $user) {
             $record_meta = get_user_meta($user->ID, '');
             if (!empty($record_meta)) {
                 foreach ($record_meta as $record_meta_key => $record_meta_value) {
                     if (!in_array($record_meta_key, $existing_meta_keys)) {
                         $to_add = true;
                         foreach ($this->default_fields as $default_value) {
                             if ($record_meta_key == $default_value['name'] || $record_meta_key == $default_value['type']) {
                                 $to_add = false;
                                 break;
                             }
                         }
                         if ($to_add) {
                             foreach ($this->advanced_fields as $advanced_value) {
                                 if ($record_meta_key == $advanced_value['name'] || $record_meta_key == $advanced_value['type']) {
                                     $to_add = false;
                                     break;
                                 }
                             }
                         }
                         if ($to_add) {
                             $existing_meta_keys[] = $record_meta_key;
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:hikaram,项目名称:wee,代码行数:35,代码来源:XmlExportUser.php


示例11: getSocialUsername

 /**
  * Get a username value stored for the given WordPress user identifier
  *
  * @since 1.3.0
  *
  * @param int|string $user_id WordPress user identifier. may be WP_User->ID or a separate identifier used by an extending system
  * @param string     $key user attribute or meta key storing the username of interest
  *
  * @return string stored username. empty string if no user_id provided or no username found
  */
 public static function getSocialUsername($user_id, $key)
 {
     // basic test for invalid passed parameter
     if (!$user_id) {
         return '';
     }
     if (!is_string($key) || !$key) {
         return '';
     }
     if (function_exists('get_user_attribute')) {
         $username = get_user_attribute($user_id, $key);
     } else {
         $username = get_user_meta($user_id, $key, true);
     }
     if (!is_string($username)) {
         $username = '';
     }
     // pass a username through a filter if not explicitly defined through user meta
     if (!$username) {
         /**
          * Allow sites to provide a WordPress user's Twitter username through a filter
          *
          * @since 1.0.0
          *
          * @param string     $username Twitter username associated with a WordPress user ID
          * @param int|string $user_id  WordPress user identifier. may be WP_User->ID or a separate identifier used by an extending system
          */
         $username = apply_filters($key . '_username', $username, $user_id);
     }
     return $username;
 }
开发者ID:cemoulto,项目名称:wordpress,代码行数:41,代码来源:Meta.php


示例12: notice

 /**
  * Output the message
  *
  * @since 0.1.0
  *
  * @param string $message The text of the message.
  * @param bool $error Optional. Whether to show as error or update. Default is error.
  * @param string $cap_check Optional. Minimum user capability to show nag to. Default is "activate_plugins"
  * @param string|bool $ignore_key Optional. The user meta key to use for storing if this message has been dismissed by current user or not. If false, it will be generated.
  *
  * @return string|void Admin notice if is_admin() and not dismissed.
  */
 public static function notice($message, $error = true, $cap_check = 'activate_plugins', $ignore_key = false)
 {
     if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
         if (current_user_can($cap_check)) {
             $user_id = get_current_user_id();
             if (!is_string($ignore_key)) {
                 // cal_wd_ig_3911b2583433f696e5813a503bbb2e65
                 $ignore_key = 'cal_wd_ig_' . substr(md5($ignore_key), 0, 40);
             }
             self::$ignore_key = sanitize_key($ignore_key);
             $dissmised = get_user_meta($user_id, self::$ignore_key, true);
             if (!$dissmised) {
                 if ($error) {
                     $class = 'error';
                 } else {
                     $class = 'updated';
                 }
                 self::$nonce_field = wp_nonce_field(self::$nonce_action);
                 $out[] = sprintf('<div id="%1s" data-key="%2s" class="%3s notice is-dismissible"><p>', self::$ignore_key, self::$ignore_key, $class);
                 $out[] = $message;
                 $out[] = self::$nonce_field;
                 $out[] = '</p></div>';
                 add_action('admin_enqueue_scripts', array(__CLASS__, 'js_css'));
                 add_action('wp_ajax_caldera_warnings_dismissible_notice', array(__CLASS__, 'ajax_cb'));
                 return implode('', $out);
             }
         }
     }
 }
开发者ID:TimothyBJacobs,项目名称:dismissible_notice,代码行数:41,代码来源:Caldera_Warnings_Dismissible_Notice.php


示例13: memberful_private_rss_feed_link

/**
 * @param string $success_message - '', if present, will return an clickable link
 * @param string $error_message - "You don’t have access to this RSS feed."
 * @param bool $return
 * @return string
 */
function memberful_private_rss_feed_link($success_message = '', $error_message = "You don’t have access to this RSS feed.", $return = false)
{
    $error_message = apply_filters('memberful_private_rss_feed_error_message', $error_message);
    if (!is_user_logged_in()) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $requiredPlan = memberful_private_user_feed_settings_get_required_plan();
    // We want to allow the private user feed only if the admin has configured it.
    if ($requiredPlan == false) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $current_user_id = get_current_user_id();
    if (!is_subscribed_to_memberful_plan($requiredPlan, $current_user_id)) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $feedToken = get_user_meta($current_user_id, 'memberful_private_user_feed_token', true);
    if ($feedToken == false || $feedToken == '') {
        $feedToken = substr(md5(uniqid(rand(1, 10000))), 2, 30);
        update_user_meta($current_user_id, 'memberful_private_user_feed_token', $feedToken);
    }
    $link = get_home_url() . '/' . memberful_private_user_feed_get_url_identifier($feedToken);
    if ($success_message != '') {
        $link = '<a href="' . $link . '">' . do_shortcode($success_message) . '</a>';
    }
    return memberful_private_rss_feed_link_response_helper($link, $return);
}
开发者ID:andrewkhunn,项目名称:lancero,代码行数:32,代码来源:private_user_feed.php


示例14: userFistLastName

function userFistLastName($user_id){
    $firstname=get_user_meta($user_id, 'first_name', true);
    if($firstname == ""){
        update_user_meta($user_id, 'first_name', 'Jhony');
        update_user_meta($user_id, 'last_name', 'Waker');
    }
}
开发者ID:kautzar,项目名称:drpp4,代码行数:7,代码来源:charity-usermeta.php


示例15: enqueue_scripts

 public static function enqueue_scripts($hook_suffix)
 {
     self::$pointers = apply_filters('hackrepair_plugin_archiver_pointers', self::$pointers);
     // Check if screen related pointer is registered
     if (empty(self::$pointers[$hook_suffix])) {
         return;
     }
     $pointers = (array) self::$pointers[$hook_suffix];
     // Get dismissed pointers
     $dismissed = explode(',', (string) get_user_meta(get_current_user_id(), 'dismissed_wp_pointers', true));
     $got_pointers = false;
     foreach ($pointers as $key => $pointer) {
         if (in_array($key, $dismissed)) {
             continue;
         }
         if (isset($pointer['caps'])) {
             foreach ($pointer['caps'] as $cap) {
                 if (!current_user_can($cap)) {
                     continue 2;
                 }
             }
         }
         $callback = is_callable($pointer['callback']) ? $pointer['callback'] : array('HackRepair_Plugin_Archiver_Pointer', $pointer['callback']);
         add_action('admin_print_footer_scripts', $callback);
         $got_pointers = true;
     }
     if (!$got_pointers) {
         return;
     }
     // Add pointers script and style to queue
     wp_enqueue_style('wp-pointer');
     wp_enqueue_script('wp-pointer');
 }
开发者ID:hackrepair,项目名称:hackrepairpluginarchiver,代码行数:33,代码来源:pointers.php


示例16: multiple_roles

 public static function multiple_roles($user_id, $roles = false)
 {
     global $wpdb, $wp_roles, $current_user, $pagenow;
     $roles = $roles ? $roles : (isset($_POST['roles']) && isset($_POST['roles'][0]) ? $_POST['roles'][0] : false);
     if ($roles && current_user_can('edit_user', $current_user->ID)) {
         $editable_roles = get_editable_roles();
         $user = new WP_User($user_id);
         $user_roles = array_intersect(array_values($user->roles), array_keys($editable_roles));
         $_user_role_log = get_user_meta($user_id, $wpdb->prefix . 'capabilities_log', true);
         $user_role_log = $_user_role_log ? $_user_role_log : array();
         $roles = is_array($roles) ? $roles : array($roles);
         foreach ($roles as $role) {
             if (!in_array($role, $user_roles) && $wp_roles->is_role($role)) {
                 $user->add_role($role);
                 array_push($user_role_log, array('action' => 'add', 'role' => $role, 'timestamp' => time()));
             }
         }
         foreach ($user_roles as $role) {
             if (!in_array($role, $roles) && $wp_roles->is_role($role)) {
                 $user->remove_role($role);
                 array_push($user_role_log, array('action' => 'remove', 'role' => $role, 'timestamp' => time()));
             }
         }
         update_user_meta($user_id, $wpdb->prefix . 'capabilities_log', $user_role_log);
     }
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:26,代码来源:class-piklist-user.php


示例17: the_quiz_button

 function the_quiz_button($button, $quiz_id)
 {
     global $post;
     $quiz_id = get_the_ID();
     $user_id = get_current_user_id();
     $flag = 1;
     if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         $pid = get_post_meta($quiz_id, 'vibe_quiz_product', true);
         if (isset($pid) && is_numeric($pid) && get_post_type($pid) == 'product') {
             $product_taken = wc_customer_bought_product('', $user_id, $pid);
             if (!$product_taken) {
                 $pid = get_permalink($pid);
                 $check = vibe_get_option('direct_checkout');
                 $check = intval($check);
                 if (isset($check) && $check) {
                     $pid .= '?redirect';
                 }
                 $flag = 0;
                 $html = '<a href="' . $pid . '"class="button create-group-button full"> ' . __('Take this Quiz', 'vibe') . '</a>';
             } else {
                 $flag = 1;
             }
         }
     }
     if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins'))) && is_user_logged_in()) {
         $membership_ids = vibe_sanitize(get_post_meta($quiz_id, 'vibe_quiz_membership', false));
         if (!pmpro_hasMembershipLevel($membership_ids, $user_id) && isset($membership_ids) && count($membership_ids) >= 1) {
             $membership_taken = get_user_meta($user_id, $quiz_id, true);
             if (!$membership_taken) {
                 $pmpro_levels_page_id = get_option('pmpro_levels_page_id');
                 $link = get_permalink($pmpro_levels_page_id);
                 $html = '<a href="' . $link . '"class="button create-group-button full"> ' . __('Take this Quiz', 'vibe') . '</a>';
                 $flag = 0;
             } else {
                 $flag = 1;
             }
         }
     }
     if (in_array('wplms-mycred-addon/wplms-mycred-addon.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         $points = get_post_meta($quiz_id, 'vibe_quiz_mycred_points', true);
         $mycred = mycred();
         $balance = $mycred->get_users_cred($user_id);
         if ($balance < $points) {
             $flag = 0;
             $html = '<a href="#"class="button create-group-button full"> ' . __('Take this Quiz', 'vibe') . '<span>' . __('<br/>Not enough points.', 'vibe') . '</span></a>';
         }
         if (!$mycred->has_entry('purchase_quiz', $quiz_id, $user_id)) {
             $flag = 1;
             $deduct = -1 * $points;
             $mycred->update_users_balance($user_id, $deduct);
             $mycred->add_to_log('purchase_quiz', $user_id, $deduct, __('Student subscibed to quiz', 'wplms-mycred'), $quiz_id);
         } else {
             $flag = 1;
         }
     }
     if (!$flag) {
         return $html;
     }
     return $button;
 }
开发者ID:VibeThemes,项目名称:wplms_sell_quiz,代码行数:60,代码来源:sell_quiz.php


示例18: _admin_init

 function _admin_init()
 {
     global $post;
     $screen = get_current_screen();
     $pointers = array();
     if ($screen->base == 'post' && $screen->post_type == UBERGRID_POST_TYPE) {
         $pointers = array('#add-new-cell' => array('title' => __('Add a cell', 'uber-grid'), 'content' => __('<p>Click here to add a first cell to your grid.</p>', 'uber-grid'), 'position' => array('edge' => 'right', 'align' => 'center')), '#shortcode' => array('title' => __('Save your grid', 'uber-grid'), 'content' => sprintf(__('<p>After saving your grid, insert this code <strong>[ubergrid id=%s]</strong> into your site pages to use the grid.</p>', 'uber-grid'), $post->ID), 'position' => array('edge' => 'top')));
     }
     if ($screen->base == 'edit' && $screen->post_type == UBERGRID_POST_TYPE) {
         $pointers = array('.add-new-h2' => array('title' => __('Create a grid', 'uber-grid'), 'content' => __('<p>Please click here to create your first grid.</p>', 'uber-grid')));
     }
     $disabled = get_user_meta(get_current_user_id(), 'uber_grid_disabled_pointers', true);
     if ($disabled) {
         foreach ($disabled as $item) {
             if (isset($pointers[$item])) {
                 unset($pointers[$item]);
             }
         }
     }
     if ($pointers) {
         wp_enqueue_script("wp-pointer");
         wp_enqueue_style("wp-pointer");
         wp_enqueue_script('uber-grid-pointers', UBERGRID_URL . 'assets/js/admin-pointers.js');
         wp_localize_script('uber-grid-pointers', 'uber_grid_pointers', array($pointers));
     }
 }
开发者ID:jauregui82,项目名称:WpCaro,代码行数:26,代码来源:pointers.php


示例19: mb_get_user_topic_bookmarks

function mb_get_user_topic_bookmarks($user_id)
{
    $user_id = mb_get_user_id($user_id);
    $bookmarks = get_user_meta($user_id, mb_get_user_topic_bookmarks_meta_key(), true);
    $bookmarks = !empty($bookmarks) ? explode(',', $bookmarks) : array();
    return apply_filters('mb_get_user_topic_bookmarks', $bookmarks, $user_id);
}
开发者ID:justintadlock,项目名称:message-board,代码行数:7,代码来源:bookmarks.php


示例20: user_checkbox

    public function user_checkbox($user)
    {
        global $edd_options;
        $unlimited = get_user_meta($user->ID, '_edd_recurring_unlimited', true);
        ?>
		<table class="form-table">
			<tbody>
				<tr>
					<th>
						<label for="edd_recurring_unlimited"><?php 
        _e('Unlimited Recurring Access', 'edd');
        ?>
</label>
					</th>
					<td>
						<input name="edd_recurring_unlimited" type="checkbox" id="edd_recurring_unlimited" value="0"<?php 
        checked(true, $unlimited);
        ?>
/>
						<span class="description"><?php 
        _e('Grant user unlimited access for recurring downloads. Checking this means a user will not need a subscription to download files.', 'edd');
        ?>
</span>
					</td>
				</tr>
			</tbody>
		</table>
		<?php 
    }
开发者ID:mintplugins,项目名称:library,代码行数:29,代码来源:unlimited-file-downloads-for-subscribers.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_user_module_list函数代码示例发布时间:2022-05-15
下一篇:
PHP get_user_merge函数代码示例发布时间: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