lbrypress/templates/meta_box.php

29 lines
942 B
PHP
Raw Normal View History

2018-10-12 03:21:49 +02:00
<?php
$LBRY = LBRY();
$unnatributed = (object) array(
2018-10-12 09:42:40 +02:00
'name' => 'unattributed',
2018-10-12 03:21:49 +02:00
);
$channels = LBRY()->daemon->channel_list();
array_unshift($channels, $unnatributed);
$cur_channels = get_post_meta($post->ID, 'lbry_channels');
2018-10-12 03:21:49 +02:00
?>
<?php wp_nonce_field('lbry_publish_channels', '_lbrynonce'); ?>
2018-10-12 03:21:49 +02:00
<h4>Choose which channels you would like to publish this post to:</h4>
<ul class="categorychecklist">
<?php if ($channels): ?>
<?php foreach ($channels as $channel): ?>
<li>
<label class="selectit">
2018-10-12 09:42:40 +02:00
<input type="checkbox" name="lbry_channels[]" value="<?= $channel->name ?>"
<?php if (in_array($channel->name, $cur_channels)): ?>
checked="true"
<?php endif; ?>
>
2018-10-12 03:21:49 +02:00
<?= $channel->name ?>
</label>
<br />
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>