本文整理匯總了PHP中SendPress_Data::get_subscriber_meta方法的典型用法代碼示例。如果您正苦於以下問題:PHP SendPress_Data::get_subscriber_meta方法的具體用法?PHP SendPress_Data::get_subscriber_meta怎麽用?PHP SendPress_Data::get_subscriber_meta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SendPress_Data
的用法示例。
在下文中一共展示了SendPress_Data::get_subscriber_meta方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pn_select
function pn_select($sub_id, $listid)
{
$pro_list = SendPress_Option::get('pro_notification_lists');
if (isset($pro_list['post_notifications']['id']) && $listid == $pro_list['post_notifications']['id']) {
$current = SendPress_Data::get_subscriber_meta($sub_id, 'post_notifications', $listid);
$info = SendPress_Data::get_post_notification_types();
echo '<select name="' . $listid . '-pn">';
echo "<option cls value='-1' >No Status</option>";
foreach ($info as $key => $value) {
$cls = '';
if ($current == $key) {
$cls = " selected='selected' ";
}
echo "<option {$cls} value='" . $key . "'>" . $value . "</option>";
}
echo '</select> ';
}
}
開發者ID:pmatheus,項目名稱:participacao-sitebase,代碼行數:18,代碼來源:class-sendpress-view-subscribers-subscriber.php
示例2: update_subscriber_meta
static function update_subscriber_meta($subscriber_id, $meta_key, $meta_value, $list_id = false)
{
global $wpdb;
$lists = SendPress_Option::get('pro_notification_lists');
$pnid = $lists['post_notifications']['id'];
$app_only = 0;
if ($pnid !== $list_id && $meta_key === 'post_notifications') {
return;
}
if ($meta_key === 'post_notifications') {
$app_only = 1;
}
$meta_table = SendPress_Data::subscriber_meta_table();
$has_data = SendPress_Data::get_subscriber_meta($subscriber_id, $meta_key, $list_id, true);
if (empty($has_data)) {
return SendPress_Data::add_subscriber_meta($subscriber_id, $meta_key, $meta_value, $list_id, $app_only);
} else {
return $wpdb->update($meta_table, array('meta_value' => $meta_value), array('subscriberID' => $subscriber_id, 'meta_key' => $meta_key, 'meta_value' => $has_data[0]->meta_value, 'app_only' => $app_only));
}
}
示例3: update_subscriber_meta
static function update_subscriber_meta($subscriber_id, $meta_key, $meta_value, $list_id = false)
{
global $wpdb;
$meta_table = SendPress_Data::subscriber_meta_table();
$has_data = SendPress_Data::get_subscriber_meta($subscriber_id, $meta_key, $list_id, true);
if (empty($has_data)) {
return SendPress_Data::add_subscriber_meta($subscriber_id, $meta_key, $meta_value, $list_id);
} else {
return $wpdb->update($meta_table, array('meta_value' => $meta_value), array('subscriberID' => $subscriber_id, 'meta_key' => $meta_key, 'meta_value' => $has_data[0]->meta_value));
}
}