本文整理汇总了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));
}
}