WSP-33 on/off display the copyright information
This commit is contained in:
@@ -31,6 +31,7 @@ function mvp_admin() {
|
|||||||
'status' => $_POST['status'],
|
'status' => $_POST['status'],
|
||||||
'author' => $_POST['author'],
|
'author' => $_POST['author'],
|
||||||
'author-byline' => $_POST['author-byline'],
|
'author-byline' => $_POST['author-byline'],
|
||||||
|
'display-copyright' => $_POST['display-copyright'],
|
||||||
'category' => $_POST['category'],
|
'category' => $_POST['category'],
|
||||||
);
|
);
|
||||||
update_option('mvp_settings', $settings);
|
update_option('mvp_settings', $settings);
|
||||||
@@ -45,6 +46,7 @@ function mvp_admin() {
|
|||||||
'status' => 'publish',
|
'status' => 'publish',
|
||||||
'author' => '',
|
'author' => '',
|
||||||
'author-byline' => '',
|
'author-byline' => '',
|
||||||
|
'display-copyright' => '',
|
||||||
'category' => '',
|
'category' => '',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -140,7 +142,7 @@ function mvp_admin() {
|
|||||||
<label for="author">Author</label>
|
<label for="author">Author</label>
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<select name="author" id="author" <?php echo ($settings['author-byline']) ? 'disabled="true"' : ""; ?>>
|
<select name="author" id="author">
|
||||||
<?php
|
<?php
|
||||||
foreach ($authors as $key => $value) {
|
foreach ($authors as $key => $value) {
|
||||||
?>
|
?>
|
||||||
@@ -155,10 +157,34 @@ function mvp_admin() {
|
|||||||
</select>
|
</select>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="author-byline" <?php echo ($settings['author-byline']) ? "checked" : ""; ?> onclick="setAuthor()"> Show byline in posts
|
<input type="checkbox" name="author-byline" <?php echo ($settings['author-byline']) ? "checked" : ""; ?>> Show byline in posts
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
Display the copyright information
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<fieldset>
|
||||||
|
<label for="status-off">
|
||||||
|
<input type="radio" name="display-copyright" id="status-off" value="off"<?php
|
||||||
|
if ($settings['display-copyright'] == 'off') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> off
|
||||||
|
</label>
|
||||||
|
<br>
|
||||||
|
<label for="status-on">
|
||||||
|
<input type="radio" name="display-copyright" id="status-on" value="on"<?php
|
||||||
|
if ($settings['display-copyright'] == 'on') {
|
||||||
|
echo(' checked');
|
||||||
|
}
|
||||||
|
?>> on
|
||||||
|
</label>
|
||||||
|
</fieldset>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
<label for="category">Category</label>
|
<label for="category">Category</label>
|
||||||
@@ -186,10 +212,5 @@ function mvp_admin() {
|
|||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
function setAuthor() {
|
|
||||||
console.log('zavolano');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ require_once '../../../wp-load.php';
|
|||||||
$json = file_get_contents('php://input');
|
$json = file_get_contents('php://input');
|
||||||
//$json = file_get_contents('log.txt');
|
//$json = file_get_contents('log.txt');
|
||||||
|
|
||||||
//file_put_contents('log.txt', $json . "\n\n", FILE_APPEND);
|
file_put_contents('log.txt', $json . "\n\n", FILE_APPEND);
|
||||||
$obj = json_decode($json, true);
|
$obj = json_decode($json, true);
|
||||||
|
|
||||||
if ($obj['type'] == 'composite') {
|
if ($obj['type'] == 'composite') {
|
||||||
@@ -15,6 +15,10 @@ if ($obj['type'] == 'composite') {
|
|||||||
if ($obj['pubstatus'] == 'usable') {
|
if ($obj['pubstatus'] == 'usable') {
|
||||||
$content = $obj['description_html'] . "<!--more-->" . $obj['body_html'];
|
$content = $obj['description_html'] . "<!--more-->" . $obj['body_html'];
|
||||||
|
|
||||||
|
if ($settings['display-copyright'] == "on") {
|
||||||
|
$content.= ""; // $obj['copyrightnotice']
|
||||||
|
}
|
||||||
|
|
||||||
$guid = wp_strip_all_tags($obj['guid']);
|
$guid = wp_strip_all_tags($obj['guid']);
|
||||||
|
|
||||||
$sync = $wpdb->get_row("SELECT post_id FROM " . $wpdb->prefix . DB_TABLE_SYNC_POST . " WHERE guid = '" . $guid . "'");
|
$sync = $wpdb->get_row("SELECT post_id FROM " . $wpdb->prefix . DB_TABLE_SYNC_POST . " WHERE guid = '" . $guid . "'");
|
||||||
|
|||||||
Reference in New Issue
Block a user