WSP-29
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'],
|
||||||
|
'byline-words' => $_POST['byline-words'],
|
||||||
'display-copyright' => $_POST['display-copyright'],
|
'display-copyright' => $_POST['display-copyright'],
|
||||||
'convert-keywords' => $_POST['convert-keywords'],
|
'convert-keywords' => $_POST['convert-keywords'],
|
||||||
'convert-services' => $_POST['convert-services'],
|
'convert-services' => $_POST['convert-services'],
|
||||||
@@ -49,6 +50,7 @@ function mvp_admin() {
|
|||||||
'status' => 'publish',
|
'status' => 'publish',
|
||||||
'author' => '',
|
'author' => '',
|
||||||
'author-byline' => '',
|
'author-byline' => '',
|
||||||
|
'byline-words' => '',
|
||||||
'display-copyright' => '',
|
'display-copyright' => '',
|
||||||
'convert-keywords' => '',
|
'convert-keywords' => '',
|
||||||
'convert-services' => '',
|
'convert-services' => '',
|
||||||
@@ -167,6 +169,14 @@ function mvp_admin() {
|
|||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">
|
||||||
|
<label for="byline-words">Choose the words replace from the byline</label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="byline-words" id="byline-words" class="regular-text" value="<?php echo($settings['byline-words']); ?>">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
Display the copyright information
|
Display the copyright information
|
||||||
|
|||||||
12
autoload.php
12
autoload.php
@@ -6,9 +6,9 @@ $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);
|
||||||
//die();
|
|
||||||
$obj = json_decode($json, true);
|
$obj = json_decode($json, true);
|
||||||
/* var_dump($obj);die(); */
|
|
||||||
if ($obj['type'] == 'text') {
|
if ($obj['type'] == 'text') {
|
||||||
|
|
||||||
$settings = get_option('mvp_settings');
|
$settings = get_option('mvp_settings');
|
||||||
@@ -91,7 +91,13 @@ if ($obj['type'] == 'text') {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ($settings['author-byline'] && $settings['author-byline'] == 'on') {
|
if ($settings['author-byline'] && $settings['author-byline'] == 'on') {
|
||||||
$author_name = str_replace("By ", "", $obj['byline']);
|
$author_name = $obj['byline'];
|
||||||
|
if (!empty(trim($settings['byline-words']))) {
|
||||||
|
$replaceWords = explode(',', $settings['byline-words']);
|
||||||
|
foreach ($replaceWords as $value) {
|
||||||
|
$author_name = str_replace(trim($value) . " ", "", $author_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$authorExist = $wpdb->get_row("SELECT ID user_id FROM " . $wpdb->prefix . DB_TABLE_USERS . " WHERE display_name = '" . wp_strip_all_tags($author_name) . "'");
|
$authorExist = $wpdb->get_row("SELECT ID user_id FROM " . $wpdb->prefix . DB_TABLE_USERS . " WHERE display_name = '" . wp_strip_all_tags($author_name) . "'");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user