v 0.1.4.2 temporary deactivate anchors

This commit is contained in:
asus
2024-03-19 07:11:45 +01:00
parent ba1d3e3707
commit cabee4db30

View File

@@ -18,10 +18,12 @@ if (!defined('ABSPATH')) {
* -> there is no sens in forcing the logged_in, because it's already the default * -> there is no sens in forcing the logged_in, because it's already the default
* *
* [custer_author_id] -> give current user the id of author * [custer_author_id] -> give current user the id of author
* [custer_author_id set_anchor='anchor_name'] -> create anchor for author user
* [custer_author_id anchor='anchor_name'] -> give current user the id stored in the anchor_name
* [custer_author_id off] -> reset to logged_in * [custer_author_id off] -> reset to logged_in
* *
* ! anchors not workink for the moment
* //[custer_author_id set_anchor='anchor_name'] -> create anchor for author user
* //[custer_author_id anchor='anchor_name'] -> give current user the id stored in the anchor_name
*
*/ */
function shortcode_author_id($options) { function shortcode_author_id($options) {
$anchor_name = ''; $anchor_name = '';
@@ -39,25 +41,25 @@ function shortcode_author_id($options) {
} }
if (isset($options['set_anchor'])) { if (isset($options['set_anchor'])) {
$option = 'author'; $option = 'author';
$is_set_anchor = true; // $is_set_anchor = true;
$anchor_name = $options['set_anchor']; // $anchor_name = $options['set_anchor'];
if (empty($anchor_name)) { // if (empty($anchor_name)) {
return; // return;
} // }
unset($options['set_anchor']); unset($options['set_anchor']);
} }
if (isset($options['anchor'])) { if (isset($options['anchor'])) {
if ($is_set_anchor) { // if ($is_set_anchor) {
return; // return;
} // }
$option = 'anchor'; // $option = 'anchor';
$anchor_name = $options['anchor']; // $anchor_name = $options['anchor'];
if (empty($anchor_name)) { // if (empty($anchor_name)) {
return; // return;
} // }
unset($options['anchor']); unset($options['anchor']);
} }
if (in_array('off', $options)) { if (is_array($options) && in_array('off', $options)) {
$option = 'off'; $option = 'off';
} }