echo get_option($GLOBALS['SHORTNAME'].'_instagram_link','');
The trouble is I can’t find where these would have been entered into the options table from. The links are not in the links section of my admin and there doesn’t seem to be a widget for this. I did this so long ago I can’t remember how I did it. Is it possible that these could have been added to options via a plugin and if so does anyone know what plugin this might be as I don’t have a plugin installed that currently does this?
Many thanks.
]]>I want to show max. 2 sticky posts on my blog in a specific loop. But if there is only one or no sticky post, the loop shouldn’t show “normal”posts.
But the following code shows “normal” posts if there are not 2 or more sticky posts:
$args = array(
'numberposts' => 2,
'post__in' => get_option( 'sticky_posts'),
'ignore_sticky_posts' => 1
);
$sticky_posts = get_posts( $args );
Thank you a lot in advance!
Daniel
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, bool given in .../duplicate-post/admin-functions.php:149
Function duplicate_post_plugin_upgrade()
uses get_option()
in line 145 which returns false
which is not checked before in_array()
call.
145: $taxonomies_blacklist = get_option( 'duplicate_post_taxonomies_blacklist' );
146: if ( $taxonomies_blacklist === '' ) {
147: $taxonomies_blacklist = [];
148: }
149: if ( in_array( 'post_format', $taxonomies_blacklist, true ) ) {
Possible fix: Use second parameter in get_option()
to supply ''
or array()
as default return value.
Thank you for great plugin.
Currently, trying to create a new custom plugin for REST API custom endpoints. When i try to use get_option in my api class located in my-plugin/api/customapi.class.php it is not working when surge plugin is active. When i deactivate the surge plugin it is working properly. can you please suggest a solution on this.
Thank you.
]]>I ran into the issue when get_option
does not return any value:
get_option( “_wp_session_{$this->session_id}”, array() );
It returns an empty value, but the value exists in DB and in cache.
I tested with 3 different methods one-by-one for option _wp_session_5c1f3b8058ca4b6cf9e637c31300bc23
:
1) get_option
get_option( “_wp_session_5c1f3b8058ca4b6cf9e637c31300bc23”, array() );
It returns an empty value (but sometimes it works fine)
2) wp_cache_get
wp_cache_get( “_wp_session_f5f8546504975ed39fb121b6b1b7c829”, ‘options’ );
It returns correct value
a:6:{s:8:"edd_cart";s:40:"[{"id":79377,"options":[],"quantity":1}]";s:13:"edd_cart_fees";s:0:"";s:18:"edd_resume_payment";s:0:"";s:14:"cart_discounts";s:0:"";s:10:"edd_errors";s:0:"";s:12:"edd_purchase";s:1072:"{"downloads":[{"id":147706,"options":[],"quantity":1}],"fees":[],"subtotal":0,"discount":0,"tax":"0.00","tax_rate":0,"price":0,"purchase_key":"f7f8403a9d9edb93f9be9376d117c1f0","user_email":"","date":"2022-10-31 13:59:43","user_info":{"id":37847,"email":"","first_name":"","last_name":"","discount":"none","address":[]},"post_data":{"edd_email":"","edd_first":"","edd_last":"","edd_agree_to_terms":"1","edd-user-id":"","edd_action":"purchase","edd-gateway":"manual","edd-process-checkout-nonce":"911cf02037"},"cart_details":[{"name":"","id":,"item_number":{"id":147706,"options":[],"quantity":1},"item_price":0,"quantity":1,"discount":0,"subtotal":0,"tax":0,"fees":[],"price":0}],"gateway":"manual","card_info":{"card_name":"","card_cvc":"","card_exp_month":"","card_exp_year":"","card_address":"","card_address_2":"","card_city":"","card_state":"","card_country":"","card_zip":""}}";}
I removed some private information here.
3) direct DB request
$wpdb->get_results(‘SELECT * FROM wp_options WHERE option_name = “_wp_session_f5f8546504975ed39fb121b6b1b7c829″‘)
It returns correct value
Array
(
[edd_cart] => [{"id":79377,"options":[],"quantity":1}]
[edd_cart_fees] =>
[edd_resume_payment] =>
[cart_discounts] =>
[edd_errors] =>
[edd_purchase] => {"downloads":[{"id":147706,"options":[],"quantity":1}],"fees":[],"subtotal":0,"discount":0,"tax":"0.00","tax_rate":0,"price":0,"purchase_key":"f7f8403a9d9edb93f9be9376d117c1f0","user_email":"","date":"2022-10-31 13:59:43","user_info":{"id":37847,"email":"","first_name":"","last_name":"","discount":"none","address":[]},"post_data":{"edd_email":"","edd_first":"","edd_last":"","edd_agree_to_terms":"1","edd-user-id":"37847","edd_action":"purchase","edd-gateway":"manual","edd-process-checkout-nonce":"911cf02037"},"cart_details":[{"name":"","id":147706,"item_number":{"id":147706,"options":[],"quantity":1},"item_price":0,"quantity":1,"discount":0,"subtotal":0,"tax":0,"fees":[],"price":0}],"gateway":"manual","card_info":{"card_name":"","card_cvc":"","card_exp_month":"","card_exp_year":"","card_address":"","card_address_2":"","card_city":"","card_state":"","card_country":"","card_zip":""}}
)
I removed some private information here.
———————–
So the problem only with function get_option
. I checked this function as well. It selects values for notoptions
$notoptions = wp_cache_get( ‘notoptions’, ‘options’ );
And if current option exists in this array – it do return
if ( isset( $notoptions[ $option ] ) ) {
/**
* Filters the default value for an option.
*
* The dynamic portion of the hook name, <code>$option</code>, refers to the option name.
*
* @since 3.4.0
* @since 4.4.0 The <code>$option</code> parameter was added.
* @since 4.7.0 The <code>$passed_default</code> parameter was added to distinguish between a <code>false</code> value and the default parameter value.
*
* @param mixed $default The default value to return if the option does not exist
* in the database.
* @param string $option Option name.
* @param bool $passed_default Was <code>get_option()</code> passed a default value?
*/
return apply_filters( "default_option_{$option}", $default, $option, $passed_default );
}
Current option exists in this array, so it applies filter “default_option_{$option}”, function filter_default_option. But this function check get_registered_settings
, and there is no information about this option, so it returns empty result.
That’s all information I have so far.
This problem exists at least for 1 year, for this time we always update WordPress core and Plugins for latest version, and it does not any affect.
]]>The header is set here: https://github.com/woocommerce/woocommerce/blob/3611d4643791bad87a0d3e6e73e031bb80447417/plugins/woocommerce/includes/class-wc-webhook.php#L339
I see that it calls the get_option function, so it’s probably a wp issue and not a wc issue, but I’m not sure.
Any idea why can it be and how can this be fixed?
]]><?php
function loginflow_add_settings_page() {
add_options_page( 'Loginflow Settings', 'Loginflow', 'manage_options', 'login-plugin', 'loginflow_settings_template_callback' );
}
add_action( 'admin_menu', 'loginflow_add_settings_page' );
function loginflow_settings_template_callback() {
if( isset( $_GET[ 'tab' ] ) ) {
$active_tab = $_GET[ 'tab' ];
}
?>
<h2>Login flow Settings</h2>
<h2 class="nav-tab-wrapper">
<a href="?page=login-plugin&tab=old_msi" class="nav-tab <?php echo $active_tab == 'old_msi' ? 'nav-tab-active' : ''; ?>">Old MSI</a>
<a href="?page=login-plugin&tab=message_1" class="nav-tab <?php echo $active_tab == 'message_1' ? 'nav-tab-active' : ''; ?>">Message 1</a>
<a href="?page=login-plugin&tab=message_2" class="nav-tab <?php echo $active_tab == 'message_2' ? 'nav-tab-active' : ''; ?>">Message 2</a>
<a href="?page=login-plugin&tab=message_3" class="nav-tab <?php echo $active_tab == 'message_3' ? 'nav-tab-active' : ''; ?>">Message 3</a>
<a href="?page=login-plugin&tab=message_4" class="nav-tab <?php echo $active_tab == 'message_4' ? 'nav-tab-active' : ''; ?>">Message 4</a>
<a href="?page=login-plugin&tab=message_5" class="nav-tab <?php echo $active_tab == 'message_5' ? 'nav-tab-active' : ''; ?>">Message 5</a>
<a href="?page=login-plugin&tab=message_6" class="nav-tab <?php echo $active_tab == 'message_6' ? 'nav-tab-active' : ''; ?>">Message 6</a>
<a href="?page=login-plugin&tab=message_7" class="nav-tab <?php echo $active_tab == 'message_7' ? 'nav-tab-active' : ''; ?>">Message 7</a>
<a href="?page=login-plugin&tab=message_8" class="nav-tab <?php echo $active_tab == 'message_8' ? 'nav-tab-active' : ''; ?>">Message 8</a>
<a href="?page=login-plugin&tab=message_9" class="nav-tab <?php echo $active_tab == 'message_9' ? 'nav-tab-active' : ''; ?>">Message 9</a>
<a href="?page=login-plugin&tab=message_10" class="nav-tab <?php echo $active_tab == 'message_10' ? 'nav-tab-active' : ''; ?>">Message 10</a>
</h2>
<?php
if( $active_tab == 'old_msi' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-old-msi' );
do_settings_sections( 'loginflow-settings-page-old-msi' );
?>
<input name="submit_old_msi" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_1' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-1' );
do_settings_sections( 'loginflow-settings-page-message-1' );
?>
<input name="submit_message_1" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_2' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-2' );
do_settings_sections( 'loginflow-settings-page-message-2' );
?>
<input name="submit_message_2" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_3' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-3' );
do_settings_sections( 'loginflow-settings-page-message-3' );
?>
<input name="submit_message_3" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_4' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-4' );
do_settings_sections( 'loginflow-settings-page-message-4' );
?>
<input name="submit_message_4" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_5' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-5' );
do_settings_sections( 'loginflow-settings-page-message-5' );
?>
<input name="submit_message_5" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_6' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-6' );
do_settings_sections( 'loginflow-settings-page-message-6' );
?>
<input name="submit_message_6" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_7' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-7' );
do_settings_sections( 'loginflow-settings-page-message-7' );
?>
<input name="submit_message_7" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_8' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-8' );
do_settings_sections( 'loginflow-settings-page-message-8' );
?>
<input name="submit_message_8" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_9' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-9' );
do_settings_sections( 'loginflow-settings-page-message-9' );
?>
<input name="submit_message_9" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} elseif ( $active_tab == 'message_10' ) { ?>
<form method="post">
<?php
settings_fields( 'loginflow-settings-message-10' );
do_settings_sections( 'loginflow-settings-page-message-10' );
?>
<input name="submit_message_10" class="button button-primary" type="submit" value="Save" />
</form>
<?php
} else {
}
?>
<?php
}
// OLD MSI CODE ----- START -------
function loginflow_register_settings_old_msi() {
register_setting( 'loginflow-settings-old-msi', 'loginflow-settings-old-msi', 'loginflow_settings_page_validate_old_msi' );
add_settings_section( 'older_MSI_settings', '', '', 'loginflow-settings-page-old-msi' );
add_settings_field( 'older_MSI_setting_version', 'Version : ', 'older_MSI_setting_version', 'loginflow-settings-page-old-msi', 'older_MSI_settings' );
add_settings_field( 'older_MSI_setting_action', 'Action : ', 'older_MSI_setting_action', 'loginflow-settings-page-old-msi', 'older_MSI_settings' );
add_settings_field( 'older_MSI_setting_timer', 'timer : ', 'older_MSI_setting_timer', 'loginflow-settings-page-old-msi', 'older_MSI_settings' );
add_settings_field( 'older_MSI_setting_text', 'text : ', 'older_MSI_setting_text', 'loginflow-settings-page-old-msi', 'older_MSI_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_old_msi' );
function loginflow_settings_page_validate_old_msi( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function older_MSI_setting_version() {
$options = get_option( 'older_MSI_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='older_MSI_setting_version' name='older_MSI_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function older_MSI_setting_action() {
$options = get_option( 'older_MSI_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='older_MSI_setting_action'></label>
<select name='older_MSI_setting_action' id='older_MSI_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function older_MSI_setting_timer() {
$options = get_option( 'older_MSI_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='older_MSI_setting_timer' name='older_MSI_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function older_MSI_setting_text() {
$options = get_option( 'older_MSI_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='older_MSI_setting_text' name='older_MSI_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_old_msi'])){
update_option('older_MSI_version', $_POST['older_MSI_setting_version']);
update_option('older_MSI_action', $_POST['older_MSI_setting_action']);
update_option('older_MSI_timer', $_POST['older_MSI_setting_timer']);
update_option('older_MSI_text', $_POST['older_MSI_setting_text']);
}
// OLD MSI CODE ----- END -------
// MESSAGE 1 code ---------- START ------------
function loginflow_register_settings_message_1() {
register_setting( 'loginflow-settings-message_1', 'loginflow-settings-message-1', 'loginflow_settings_page_validate_message_1' );
add_settings_section( 'message_1_settings', '','', 'loginflow-settings-page-message-1' );
add_settings_field( 'message_1_setting_version', 'Version : ', 'message_1_setting_version', 'loginflow-settings-page-message-1', 'message_1_settings' );
add_settings_field( 'message_1_setting_browser', 'Browser : ', 'message_1_setting_browser', 'loginflow-settings-page-message-1', 'message_1_settings' );
add_settings_field( 'message_1_setting_os', 'OS : ', 'message_1_setting_os', 'loginflow-settings-page-message-1', 'message_1_settings' );
add_settings_field( 'message_1_setting_action', 'Action : ', 'message_1_setting_action', 'loginflow-settings-page-message-1', 'message_1_settings' );
add_settings_field( 'message_1_setting_timer', 'timer : ', 'message_1_setting_timer', 'loginflow-settings-page-message-1', 'message_1_settings' );
add_settings_field( 'message_1_setting_text', 'text : ', 'message_1_setting_text', 'loginflow-settings-page-message-1', 'message_1_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_1' );
function loginflow_settings_page_validate_message_1( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_1_setting_version() {
$options = get_option( 'message_1_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_1_setting_version' name='message_1_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_1_setting_browser() {
$options = get_option( 'message_1_browser_chrome' );
echo "Chrome <input id='message_1_setting_browser_chrome' name='message_1_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_1_browser_edge' );
echo "Edge Chromium <input id='message_1_setting_browser_edge' name='message_1_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_1_browser_firefox' );
echo "Firefox <input id='message_1_setting_browser_firefox' name='message_1_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_1_browser_safari' );
echo "Safari <input id='message_1_setting_browser_safari' name='message_1_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_1_setting_os() {
$options = get_option( 'message_1_os_win81' );
echo "8.1 <input id='message_1_setting_os_win81' name='message_1_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_1_os_win10' );
echo "WIN 10 <input id='message_1_setting_os_win10' name='message_1_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_1_os_win11' );
echo "WIN 11 <input id='message_1_setting_os_win11' name='message_1_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_1_os_mac' );
echo "MAC <input id='message_1_setting_os_mac' name='message_1_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_1_setting_action() {
$options = get_option( 'message_1_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_1_setting_action'></label>
<select name='message_1_setting_action' id='message_1_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_1_setting_timer() {
$options = get_option( 'message_1_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_1_setting_timer' name='message_1_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_1_setting_text() {
$options = get_option( 'message_1_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_1_setting_text' name='message_1_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_1'])){
update_option('message_1_version', $_POST['message_1_setting_version']);
update_option('message_1_browser_chrome', $_POST['message_1_setting_browser_chrome']);
update_option('message_1_browser_edge', $_POST['message_1_setting_browser_edge']);
update_option('message_1_browser_firefox', $_POST['message_1_setting_browser_firefox']);
update_option('message_1_browser_safari', $_POST['message_1_setting_browser_safari']);
update_option('message_1_os_win81', $_POST['message_1_setting_os_win81']);
update_option('message_1_os_win10', $_POST['message_1_setting_os_win10']);
update_option('message_1_os_win11', $_POST['message_1_setting_os_win11']);
update_option('message_1_os_mac', $_POST['message_1_setting_os_mac']);
update_option('message_1_action', $_POST['message_1_setting_action']);
update_option('message_1_timer', $_POST['message_1_setting_timer']);
update_option('message_1_text', $_POST['message_1_setting_text']);
}
// MESSAGE 1 code ---------- END ------------
// MESSAGE 2 code ---------- START ------------
function loginflow_register_settings_message_2() {
register_setting( 'loginflow-settings-message_2', 'loginflow-settings-message-2', 'loginflow_settings_page_validate_message_2' );
add_settings_section( 'message_2_settings', '','', 'loginflow-settings-page-message-2' );
add_settings_field( 'message_2_setting_version', 'Version : ', 'message_2_setting_version', 'loginflow-settings-page-message-2', 'message_2_settings' );
add_settings_field( 'message_2_setting_browser', 'Browser : ', 'message_2_setting_browser', 'loginflow-settings-page-message-2', 'message_2_settings' );
add_settings_field( 'message_2_setting_os', 'OS : ', 'message_2_setting_os', 'loginflow-settings-page-message-2', 'message_2_settings' );
add_settings_field( 'message_2_setting_action', 'Action : ', 'message_2_setting_action', 'loginflow-settings-page-message-2', 'message_2_settings' );
add_settings_field( 'message_2_setting_timer', 'timer : ', 'message_2_setting_timer', 'loginflow-settings-page-message-2', 'message_2_settings' );
add_settings_field( 'message_2_setting_text', 'text : ', 'message_2_setting_text', 'loginflow-settings-page-message-2', 'message_2_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_2' );
function loginflow_settings_page_validate_message_2( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_2_setting_version() {
$options = get_option( 'message_2_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_2_setting_version' name='message_2_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_2_setting_browser() {
$options = get_option( 'message_2_browser_chrome' );
echo "Chrome <input id='message_2_setting_browser_chrome' name='message_2_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_2_browser_edge' );
echo "Edge Chromium <input id='message_2_setting_browser_edge' name='message_2_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_2_browser_firefox' );
echo "Firefox <input id='message_2_setting_browser_firefox' name='message_2_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_2_browser_safari' );
echo "Safari <input id='message_2_setting_browser_safari' name='message_2_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_2_setting_os() {
$options = get_option( 'message_2_os_win81' );
echo "8.1 <input id='message_2_setting_os_win81' name='message_2_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_2_os_win10' );
echo "WIN 10 <input id='message_2_setting_os_win10' name='message_2_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_2_os_win11' );
echo "WIN 11 <input id='message_2_setting_os_win11' name='message_2_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_2_os_mac' );
echo "MAC <input id='message_2_setting_os_mac' name='message_2_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_2_setting_action() {
$options = get_option( 'message_2_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_2_setting_action'></label>
<select name='message_2_setting_action' id='message_2_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_2_setting_timer() {
$options = get_option( 'message_2_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_2_setting_timer' name='message_2_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_2_setting_text() {
$options = get_option( 'message_2_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_2_setting_text' name='message_2_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_2'])){
update_option('message_2_version', $_POST['message_2_setting_version']);
update_option('message_2_browser_chrome', $_POST['message_2_setting_browser_chrome']);
update_option('message_2_browser_edge', $_POST['message_2_setting_browser_edge']);
update_option('message_2_browser_firefox', $_POST['message_2_setting_browser_firefox']);
update_option('message_2_browser_safari', $_POST['message_2_setting_browser_safari']);
update_option('message_2_os_win81', $_POST['message_2_setting_os_win81']);
update_option('message_2_os_win10', $_POST['message_2_setting_os_win10']);
update_option('message_2_os_win11', $_POST['message_2_setting_os_win11']);
update_option('message_2_os_mac', $_POST['message_2_setting_os_mac']);
update_option('message_2_action', $_POST['message_2_setting_action']);
update_option('message_2_timer', $_POST['message_2_setting_timer']);
update_option('message_2_text', $_POST['message_2_setting_text']);
}
// MESSAGE 2 code ---------- END ------------
// message-3 code ---------- START ------------
function loginflow_register_settings_message_3() {
register_setting( 'loginflow-settings-message_3', 'loginflow-settings-message-3', 'loginflow_settings_page_validate_message_3' );
add_settings_section( 'message_3_settings', '','', 'loginflow-settings-page-message-3' );
add_settings_field( 'message_3_setting_version', 'Version : ', 'message_3_setting_version', 'loginflow-settings-page-message-3', 'message_3_settings' );
add_settings_field( 'message_3_setting_browser', 'Browser : ', 'message_3_setting_browser', 'loginflow-settings-page-message-3', 'message_3_settings' );
add_settings_field( 'message_3_setting_os', 'OS : ', 'message_3_setting_os', 'loginflow-settings-page-message-3', 'message_3_settings' );
add_settings_field( 'message_3_setting_action', 'Action : ', 'message_3_setting_action', 'loginflow-settings-page-message-3', 'message_3_settings' );
add_settings_field( 'message_3_setting_timer', 'timer : ', 'message_3_setting_timer', 'loginflow-settings-page-message-3', 'message_3_settings' );
add_settings_field( 'message_3_setting_text', 'text : ', 'message_3_setting_text', 'loginflow-settings-page-message-3', 'message_3_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_3' );
function loginflow_settings_page_validate_message_3( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_3_setting_version() {
$options = get_option( 'message_3_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_3_setting_version' name='message_3_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_3_setting_browser() {
$options = get_option( 'message_3_browser_chrome' );
echo "Chrome <input id='message_3_setting_browser_chrome' name='message_3_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_3_browser_edge' );
echo "Edge Chromium <input id='message_3_setting_browser_edge' name='message_3_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_3_browser_firefox' );
echo "Firefox <input id='message_3_setting_browser_firefox' name='message_3_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_3_browser_safari' );
echo "Safari <input id='message_3_setting_browser_safari' name='message_3_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_3_setting_os() {
$options = get_option( 'message_3_os_win81' );
echo "8.1 <input id='message_3_setting_os_win81' name='message_3_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_3_os_win10' );
echo "WIN 10 <input id='message_3_setting_os_win10' name='message_3_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_3_os_win11' );
echo "WIN 11 <input id='message_3_setting_os_win11' name='message_3_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_3_os_mac' );
echo "MAC <input id='message_3_setting_os_mac' name='message_3_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_3_setting_action() {
$options = get_option( 'message_3_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_3_setting_action'></label>
<select name='message_3_setting_action' id='message_3_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_3_setting_timer() {
$options = get_option( 'message_3_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_3_setting_timer' name='message_3_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_3_setting_text() {
$options = get_option( 'message_3_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_3_setting_text' name='message_3_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_3'])){
update_option('message_3_version', $_POST['message_3_setting_version']);
update_option('message_3_browser_chrome', $_POST['message_3_setting_browser_chrome']);
update_option('message_3_browser_edge', $_POST['message_3_setting_browser_edge']);
update_option('message_3_browser_firefox', $_POST['message_3_setting_browser_firefox']);
update_option('message_3_browser_safari', $_POST['message_3_setting_browser_safari']);
update_option('message_3_os_win81', $_POST['message_3_setting_os_win81']);
update_option('message_3_os_win10', $_POST['message_3_setting_os_win10']);
update_option('message_3_os_win11', $_POST['message_3_setting_os_win11']);
update_option('message_3_os_mac', $_POST['message_3_setting_os_mac']);
update_option('message_3_action', $_POST['message_3_setting_action']);
update_option('message_3_timer', $_POST['message_3_setting_timer']);
update_option('message_3_text', $_POST['message_3_setting_text']);
}
// message-3 code ---------- END ------------
// message-4 code ---------- START ------------
function loginflow_register_settings_message_4() {
register_setting( 'loginflow-settings-message_4', 'loginflow-settings-message-4', 'loginflow_settings_page_validate_message_4' );
add_settings_section( 'message_4_settings', '','', 'loginflow-settings-page-message-4' );
add_settings_field( 'message_4_setting_version', 'Version : ', 'message_4_setting_version', 'loginflow-settings-page-message-4', 'message_4_settings' );
add_settings_field( 'message_4_setting_browser', 'Browser : ', 'message_4_setting_browser', 'loginflow-settings-page-message-4', 'message_4_settings' );
add_settings_field( 'message_4_setting_os', 'OS : ', 'message_4_setting_os', 'loginflow-settings-page-message-4', 'message_4_settings' );
add_settings_field( 'message_4_setting_action', 'Action : ', 'message_4_setting_action', 'loginflow-settings-page-message-4', 'message_4_settings' );
add_settings_field( 'message_4_setting_timer', 'timer : ', 'message_4_setting_timer', 'loginflow-settings-page-message-4', 'message_4_settings' );
add_settings_field( 'message_4_setting_text', 'text : ', 'message_4_setting_text', 'loginflow-settings-page-message-4', 'message_4_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_4' );
function loginflow_settings_page_validate_message_4( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_4_setting_version() {
$options = get_option( 'message_4_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_4_setting_version' name='message_4_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_4_setting_browser() {
$options = get_option( 'message_4_browser_chrome' );
echo "Chrome <input id='message_4_setting_browser_chrome' name='message_4_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_4_browser_edge' );
echo "Edge Chromium <input id='message_4_setting_browser_edge' name='message_4_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_4_browser_firefox' );
echo "Firefox <input id='message_4_setting_browser_firefox' name='message_4_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_4_browser_safari' );
echo "Safari <input id='message_4_setting_browser_safari' name='message_4_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_4_setting_os() {
$options = get_option( 'message_4_os_win81' );
echo "8.1 <input id='message_4_setting_os_win81' name='message_4_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_4_os_win10' );
echo "WIN 10 <input id='message_4_setting_os_win10' name='message_4_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_4_os_win11' );
echo "WIN 11 <input id='message_4_setting_os_win11' name='message_4_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_4_os_mac' );
echo "MAC <input id='message_4_setting_os_mac' name='message_4_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_4_setting_action() {
$options = get_option( 'message_4_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_4_setting_action'></label>
<select name='message_4_setting_action' id='message_4_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_4_setting_timer() {
$options = get_option( 'message_4_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_4_setting_timer' name='message_4_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_4_setting_text() {
$options = get_option( 'message_4_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_4_setting_text' name='message_4_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_4'])){
update_option('message_4_version', $_POST['message_4_setting_version']);
update_option('message_4_browser_chrome', $_POST['message_4_setting_browser_chrome']);
update_option('message_4_browser_edge', $_POST['message_4_setting_browser_edge']);
update_option('message_4_browser_firefox', $_POST['message_4_setting_browser_firefox']);
update_option('message_4_browser_safari', $_POST['message_4_setting_browser_safari']);
update_option('message_4_os_win81', $_POST['message_4_setting_os_win81']);
update_option('message_4_os_win10', $_POST['message_4_setting_os_win10']);
update_option('message_4_os_win11', $_POST['message_4_setting_os_win11']);
update_option('message_4_os_mac', $_POST['message_4_setting_os_mac']);
update_option('message_4_action', $_POST['message_4_setting_action']);
update_option('message_4_timer', $_POST['message_4_setting_timer']);
update_option('message_4_text', $_POST['message_4_setting_text']);
}
// message-4 code ---------- END ------------
// message-5 code ---------- START ------------
function loginflow_register_settings_message_5() {
register_setting( 'loginflow-settings-message_5', 'loginflow-settings-message-5', 'loginflow_settings_page_validate_message_5' );
add_settings_section( 'message_5_settings', '','', 'loginflow-settings-page-message-5' );
add_settings_field( 'message_5_setting_version', 'Version : ', 'message_5_setting_version', 'loginflow-settings-page-message-5', 'message_5_settings' );
add_settings_field( 'message_5_setting_browser', 'Browser : ', 'message_5_setting_browser', 'loginflow-settings-page-message-5', 'message_5_settings' );
add_settings_field( 'message_5_setting_os', 'OS : ', 'message_5_setting_os', 'loginflow-settings-page-message-5', 'message_5_settings' );
add_settings_field( 'message_5_setting_action', 'Action : ', 'message_5_setting_action', 'loginflow-settings-page-message-5', 'message_5_settings' );
add_settings_field( 'message_5_setting_timer', 'timer : ', 'message_5_setting_timer', 'loginflow-settings-page-message-5', 'message_5_settings' );
add_settings_field( 'message_5_setting_text', 'text : ', 'message_5_setting_text', 'loginflow-settings-page-message-5', 'message_5_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_5' );
function loginflow_settings_page_validate_message_5( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_5_setting_version() {
$options = get_option( 'message_5_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_5_setting_version' name='message_5_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_5_setting_browser() {
$options = get_option( 'message_5_browser_chrome' );
echo "Chrome <input id='message_5_setting_browser_chrome' name='message_5_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_5_browser_edge' );
echo "Edge Chromium <input id='message_5_setting_browser_edge' name='message_5_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_5_browser_firefox' );
echo "Firefox <input id='message_5_setting_browser_firefox' name='message_5_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_5_browser_safari' );
echo "Safari <input id='message_5_setting_browser_safari' name='message_5_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_5_setting_os() {
$options = get_option( 'message_5_os_win81' );
echo "8.1 <input id='message_5_setting_os_win81' name='message_5_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_5_os_win10' );
echo "WIN 10 <input id='message_5_setting_os_win10' name='message_5_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_5_os_win11' );
echo "WIN 11 <input id='message_5_setting_os_win11' name='message_5_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_5_os_mac' );
echo "MAC <input id='message_5_setting_os_mac' name='message_5_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_5_setting_action() {
$options = get_option( 'message_5_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_5_setting_action'></label>
<select name='message_5_setting_action' id='message_5_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_5_setting_timer() {
$options = get_option( 'message_5_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_5_setting_timer' name='message_5_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_5_setting_text() {
$options = get_option( 'message_5_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_5_setting_text' name='message_5_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_5'])){
update_option('message_5_version', $_POST['message_5_setting_version']);
update_option('message_5_browser_chrome', $_POST['message_5_setting_browser_chrome']);
update_option('message_5_browser_edge', $_POST['message_5_setting_browser_edge']);
update_option('message_5_browser_firefox', $_POST['message_5_setting_browser_firefox']);
update_option('message_5_browser_safari', $_POST['message_5_setting_browser_safari']);
update_option('message_5_os_win81', $_POST['message_5_setting_os_win81']);
update_option('message_5_os_win10', $_POST['message_5_setting_os_win10']);
update_option('message_5_os_win11', $_POST['message_5_setting_os_win11']);
update_option('message_5_os_mac', $_POST['message_5_setting_os_mac']);
update_option('message_5_action', $_POST['message_5_setting_action']);
update_option('message_5_timer', $_POST['message_5_setting_timer']);
update_option('message_5_text', $_POST['message_5_setting_text']);
}
// message-5 code ---------- END ------------
// message-6 code ---------- START ------------
function loginflow_register_settings_message_6() {
register_setting( 'loginflow-settings-message_6', 'loginflow-settings-message-6', 'loginflow_settings_page_validate_message_6' );
add_settings_section( 'message_6_settings', '','', 'loginflow-settings-page-message-6' );
add_settings_field( 'message_6_setting_version', 'Version : ', 'message_6_setting_version', 'loginflow-settings-page-message-6', 'message_6_settings' );
add_settings_field( 'message_6_setting_browser', 'Browser : ', 'message_6_setting_browser', 'loginflow-settings-page-message-6', 'message_6_settings' );
add_settings_field( 'message_6_setting_os', 'OS : ', 'message_6_setting_os', 'loginflow-settings-page-message-6', 'message_6_settings' );
add_settings_field( 'message_6_setting_action', 'Action : ', 'message_6_setting_action', 'loginflow-settings-page-message-6', 'message_6_settings' );
add_settings_field( 'message_6_setting_timer', 'timer : ', 'message_6_setting_timer', 'loginflow-settings-page-message-6', 'message_6_settings' );
add_settings_field( 'message_6_setting_text', 'text : ', 'message_6_setting_text', 'loginflow-settings-page-message-6', 'message_6_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_6' );
function loginflow_settings_page_validate_message_6( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_6_setting_version() {
$options = get_option( 'message_6_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_6_setting_version' name='message_6_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_6_setting_browser() {
$options = get_option( 'message_6_browser_chrome' );
echo "Chrome <input id='message_6_setting_browser_chrome' name='message_6_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_6_browser_edge' );
echo "Edge Chromium <input id='message_6_setting_browser_edge' name='message_6_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_6_browser_firefox' );
echo "Firefox <input id='message_6_setting_browser_firefox' name='message_6_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_6_browser_safari' );
echo "Safari <input id='message_6_setting_browser_safari' name='message_6_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_6_setting_os() {
$options = get_option( 'message_6_os_win81' );
echo "8.1 <input id='message_6_setting_os_win81' name='message_6_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_6_os_win10' );
echo "WIN 10 <input id='message_6_setting_os_win10' name='message_6_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_6_os_win11' );
echo "WIN 11 <input id='message_6_setting_os_win11' name='message_6_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_6_os_mac' );
echo "MAC <input id='message_6_setting_os_mac' name='message_6_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_6_setting_action() {
$options = get_option( 'message_6_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_6_setting_action'></label>
<select name='message_6_setting_action' id='message_6_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_6_setting_timer() {
$options = get_option( 'message_6_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_6_setting_timer' name='message_6_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_6_setting_text() {
$options = get_option( 'message_6_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_6_setting_text' name='message_6_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_6'])){
update_option('message_6_version', $_POST['message_6_setting_version']);
update_option('message_6_browser_chrome', $_POST['message_6_setting_browser_chrome']);
update_option('message_6_browser_edge', $_POST['message_6_setting_browser_edge']);
update_option('message_6_browser_firefox', $_POST['message_6_setting_browser_firefox']);
update_option('message_6_browser_safari', $_POST['message_6_setting_browser_safari']);
update_option('message_6_os_win81', $_POST['message_6_setting_os_win81']);
update_option('message_6_os_win10', $_POST['message_6_setting_os_win10']);
update_option('message_6_os_win11', $_POST['message_6_setting_os_win11']);
update_option('message_6_os_mac', $_POST['message_6_setting_os_mac']);
update_option('message_6_action', $_POST['message_6_setting_action']);
update_option('message_6_timer', $_POST['message_6_setting_timer']);
update_option('message_6_text', $_POST['message_6_setting_text']);
}
// message-6 code ---------- END ------------
// message-7 code ---------- START ------------
function loginflow_register_settings_message_7() {
register_setting( 'loginflow-settings-message_7', 'loginflow-settings-message-7', 'loginflow_settings_page_validate_message_7' );
add_settings_section( 'message_7_settings', '','', 'loginflow-settings-page-message-7' );
add_settings_field( 'message_7_setting_version', 'Version : ', 'message_7_setting_version', 'loginflow-settings-page-message-7', 'message_7_settings' );
add_settings_field( 'message_7_setting_browser', 'Browser : ', 'message_7_setting_browser', 'loginflow-settings-page-message-7', 'message_7_settings' );
add_settings_field( 'message_7_setting_os', 'OS : ', 'message_7_setting_os', 'loginflow-settings-page-message-7', 'message_7_settings' );
add_settings_field( 'message_7_setting_action', 'Action : ', 'message_7_setting_action', 'loginflow-settings-page-message-7', 'message_7_settings' );
add_settings_field( 'message_7_setting_timer', 'timer : ', 'message_7_setting_timer', 'loginflow-settings-page-message-7', 'message_7_settings' );
add_settings_field( 'message_7_setting_text', 'text : ', 'message_7_setting_text', 'loginflow-settings-page-message-7', 'message_7_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_7' );
function loginflow_settings_page_validate_message_7( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_7_setting_version() {
$options = get_option( 'message_7_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_7_setting_version' name='message_7_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_7_setting_browser() {
$options = get_option( 'message_7_browser_chrome' );
echo "Chrome <input id='message_7_setting_browser_chrome' name='message_7_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_7_browser_edge' );
echo "Edge Chromium <input id='message_7_setting_browser_edge' name='message_7_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_7_browser_firefox' );
echo "Firefox <input id='message_7_setting_browser_firefox' name='message_7_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_7_browser_safari' );
echo "Safari <input id='message_7_setting_browser_safari' name='message_7_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_7_setting_os() {
$options = get_option( 'message_7_os_win81' );
echo "8.1 <input id='message_7_setting_os_win81' name='message_7_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_7_os_win10' );
echo "WIN 10 <input id='message_7_setting_os_win10' name='message_7_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_7_os_win11' );
echo "WIN 11 <input id='message_7_setting_os_win11' name='message_7_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_7_os_mac' );
echo "MAC <input id='message_7_setting_os_mac' name='message_7_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_7_setting_action() {
$options = get_option( 'message_7_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_7_setting_action'></label>
<select name='message_7_setting_action' id='message_7_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_7_setting_timer() {
$options = get_option( 'message_7_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_7_setting_timer' name='message_7_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_7_setting_text() {
$options = get_option( 'message_7_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_7_setting_text' name='message_7_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_7'])){
update_option('message_7_version', $_POST['message_7_setting_version']);
update_option('message_7_browser_chrome', $_POST['message_7_setting_browser_chrome']);
update_option('message_7_browser_edge', $_POST['message_7_setting_browser_edge']);
update_option('message_7_browser_firefox', $_POST['message_7_setting_browser_firefox']);
update_option('message_7_browser_safari', $_POST['message_7_setting_browser_safari']);
update_option('message_7_os_win81', $_POST['message_7_setting_os_win81']);
update_option('message_7_os_win10', $_POST['message_7_setting_os_win10']);
update_option('message_7_os_win11', $_POST['message_7_setting_os_win11']);
update_option('message_7_os_mac', $_POST['message_7_setting_os_mac']);
update_option('message_7_action', $_POST['message_7_setting_action']);
update_option('message_7_timer', $_POST['message_7_setting_timer']);
update_option('message_7_text', $_POST['message_7_setting_text']);
}
// message-7 code ---------- END ------------
// message-8 code ---------- START ------------
function loginflow_register_settings_message_8() {
register_setting( 'loginflow-settings-message_8', 'loginflow-settings-message-8', 'loginflow_settings_page_validate_message_8' );
add_settings_section( 'message_8_settings', '','', 'loginflow-settings-page-message-8' );
add_settings_field( 'message_8_setting_version', 'Version : ', 'message_8_setting_version', 'loginflow-settings-page-message-8', 'message_8_settings' );
add_settings_field( 'message_8_setting_browser', 'Browser : ', 'message_8_setting_browser', 'loginflow-settings-page-message-8', 'message_8_settings' );
add_settings_field( 'message_8_setting_os', 'OS : ', 'message_8_setting_os', 'loginflow-settings-page-message-8', 'message_8_settings' );
add_settings_field( 'message_8_setting_action', 'Action : ', 'message_8_setting_action', 'loginflow-settings-page-message-8', 'message_8_settings' );
add_settings_field( 'message_8_setting_timer', 'timer : ', 'message_8_setting_timer', 'loginflow-settings-page-message-8', 'message_8_settings' );
add_settings_field( 'message_8_setting_text', 'text : ', 'message_8_setting_text', 'loginflow-settings-page-message-8', 'message_8_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_8' );
function loginflow_settings_page_validate_message_8( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_8_setting_version() {
$options = get_option( 'message_8_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_8_setting_version' name='message_8_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_8_setting_browser() {
$options = get_option( 'message_8_browser_chrome' );
echo "Chrome <input id='message_8_setting_browser_chrome' name='message_8_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_8_browser_edge' );
echo "Edge Chromium <input id='message_8_setting_browser_edge' name='message_8_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_8_browser_firefox' );
echo "Firefox <input id='message_8_setting_browser_firefox' name='message_8_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_8_browser_safari' );
echo "Safari <input id='message_8_setting_browser_safari' name='message_8_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_8_setting_os() {
$options = get_option( 'message_8_os_win81' );
echo "8.1 <input id='message_8_setting_os_win81' name='message_8_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_8_os_win10' );
echo "WIN 10 <input id='message_8_setting_os_win10' name='message_8_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_8_os_win11' );
echo "WIN 11 <input id='message_8_setting_os_win11' name='message_8_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_8_os_mac' );
echo "MAC <input id='message_8_setting_os_mac' name='message_8_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_8_setting_action() {
$options = get_option( 'message_8_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_8_setting_action'></label>
<select name='message_8_setting_action' id='message_8_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_8_setting_timer() {
$options = get_option( 'message_8_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_8_setting_timer' name='message_8_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_8_setting_text() {
$options = get_option( 'message_8_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_8_setting_text' name='message_8_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_8'])){
update_option('message_8_version', $_POST['message_8_setting_version']);
update_option('message_8_browser_chrome', $_POST['message_8_setting_browser_chrome']);
update_option('message_8_browser_edge', $_POST['message_8_setting_browser_edge']);
update_option('message_8_browser_firefox', $_POST['message_8_setting_browser_firefox']);
update_option('message_8_browser_safari', $_POST['message_8_setting_browser_safari']);
update_option('message_8_os_win81', $_POST['message_8_setting_os_win81']);
update_option('message_8_os_win10', $_POST['message_8_setting_os_win10']);
update_option('message_8_os_win11', $_POST['message_8_setting_os_win11']);
update_option('message_8_os_mac', $_POST['message_8_setting_os_mac']);
update_option('message_8_action', $_POST['message_8_setting_action']);
update_option('message_8_timer', $_POST['message_8_setting_timer']);
update_option('message_8_text', $_POST['message_8_setting_text']);
}
// message-8 code ---------- END ------------
// message-9 code ---------- START ------------
function loginflow_register_settings_message_9() {
register_setting( 'loginflow-settings-message_9', 'loginflow-settings-message-9', 'loginflow_settings_page_validate_message_9' );
add_settings_section( 'message_9_settings', '','', 'loginflow-settings-page-message-9' );
add_settings_field( 'message_9_setting_version', 'Version : ', 'message_9_setting_version', 'loginflow-settings-page-message-9', 'message_9_settings' );
add_settings_field( 'message_9_setting_browser', 'Browser : ', 'message_9_setting_browser', 'loginflow-settings-page-message-9', 'message_9_settings' );
add_settings_field( 'message_9_setting_os', 'OS : ', 'message_9_setting_os', 'loginflow-settings-page-message-9', 'message_9_settings' );
add_settings_field( 'message_9_setting_action', 'Action : ', 'message_9_setting_action', 'loginflow-settings-page-message-9', 'message_9_settings' );
add_settings_field( 'message_9_setting_timer', 'timer : ', 'message_9_setting_timer', 'loginflow-settings-page-message-9', 'message_9_settings' );
add_settings_field( 'message_9_setting_text', 'text : ', 'message_9_setting_text', 'loginflow-settings-page-message-9', 'message_9_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_9' );
function loginflow_settings_page_validate_message_9( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_9_setting_version() {
$options = get_option( 'message_9_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_9_setting_version' name='message_9_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_9_setting_browser() {
$options = get_option( 'message_9_browser_chrome' );
echo "Chrome <input id='message_9_setting_browser_chrome' name='message_9_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_9_browser_edge' );
echo "Edge Chromium <input id='message_9_setting_browser_edge' name='message_9_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_9_browser_firefox' );
echo "Firefox <input id='message_9_setting_browser_firefox' name='message_9_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_9_browser_safari' );
echo "Safari <input id='message_9_setting_browser_safari' name='message_9_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_9_setting_os() {
$options = get_option( 'message_9_os_win81' );
echo "8.1 <input id='message_9_setting_os_win81' name='message_9_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_9_os_win10' );
echo "WIN 10 <input id='message_9_setting_os_win10' name='message_9_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_9_os_win11' );
echo "WIN 11 <input id='message_9_setting_os_win11' name='message_9_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_9_os_mac' );
echo "MAC <input id='message_9_setting_os_mac' name='message_9_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_9_setting_action() {
$options = get_option( 'message_9_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_9_setting_action'></label>
<select name='message_9_setting_action' id='message_9_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_9_setting_timer() {
$options = get_option( 'message_9_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_9_setting_timer' name='message_9_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_9_setting_text() {
$options = get_option( 'message_9_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_9_setting_text' name='message_9_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_9'])){
update_option('message_9_version', $_POST['message_9_setting_version']);
update_option('message_9_browser_chrome', $_POST['message_9_setting_browser_chrome']);
update_option('message_9_browser_edge', $_POST['message_9_setting_browser_edge']);
update_option('message_9_browser_firefox', $_POST['message_9_setting_browser_firefox']);
update_option('message_9_browser_safari', $_POST['message_9_setting_browser_safari']);
update_option('message_9_os_win81', $_POST['message_9_setting_os_win81']);
update_option('message_9_os_win10', $_POST['message_9_setting_os_win10']);
update_option('message_9_os_win11', $_POST['message_9_setting_os_win11']);
update_option('message_9_os_mac', $_POST['message_9_setting_os_mac']);
update_option('message_9_action', $_POST['message_9_setting_action']);
update_option('message_9_timer', $_POST['message_9_setting_timer']);
update_option('message_9_text', $_POST['message_9_setting_text']);
}
// message-9 code ---------- END ------------
// message-10 code ---------- START ------------
function loginflow_register_settings_message_10() {
register_setting( 'loginflow-settings-message_10', 'loginflow-settings-message-10', 'loginflow_settings_page_validate_message_10' );
add_settings_section( 'message_10_settings', '','', 'loginflow-settings-page-message-10' );
add_settings_field( 'message_10_setting_version', 'Version : ', 'message_10_setting_version', 'loginflow-settings-page-message-10', 'message_10_settings' );
add_settings_field( 'message_10_setting_browser', 'Browser : ', 'message_10_setting_browser', 'loginflow-settings-page-message-10', 'message_10_settings' );
add_settings_field( 'message_10_setting_os', 'OS : ', 'message_10_setting_os', 'loginflow-settings-page-message-10', 'message_10_settings' );
add_settings_field( 'message_10_setting_action', 'Action : ', 'message_10_setting_action', 'loginflow-settings-page-message-10', 'message_10_settings' );
add_settings_field( 'message_10_setting_timer', 'timer : ', 'message_10_setting_timer', 'loginflow-settings-page-message-10', 'message_10_settings' );
add_settings_field( 'message_10_setting_text', 'text : ', 'message_10_setting_text', 'loginflow-settings-page-message-10', 'message_10_settings' );
}
add_action( 'admin_init', 'loginflow_register_settings_message_10' );
function loginflow_settings_page_validate_message_10( $input ) {
$newinput['api_key'] = trim( $input['api_key'] );
if ( ! preg_match( '/^[a-z0-9]{32}$/i', $newinput['api_key'] ) ) {
$newinput['api_key'] = '';
}
return $newinput;
}
function message_10_setting_version() {
$options = get_option( 'message_10_version' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_10_setting_version' name='message_10_setting_version' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_10_setting_browser() {
$options = get_option( 'message_10_browser_chrome' );
echo "Chrome <input id='message_10_setting_browser_chrome' name='message_10_setting_browser_chrome' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_10_browser_edge' );
echo "Edge Chromium <input id='message_10_setting_browser_edge' name='message_10_setting_browser_edge' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_10_browser_firefox' );
echo "Firefox <input id='message_10_setting_browser_firefox' name='message_10_setting_browser_firefox' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_10_browser_safari' );
echo "Safari <input id='message_10_setting_browser_safari' name='message_10_setting_browser_safari' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_10_setting_os() {
$options = get_option( 'message_10_os_win81' );
echo "8.1 <input id='message_10_setting_os_win81' name='message_10_setting_os_win81' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_10_os_win10' );
echo "WIN 10 <input id='message_10_setting_os_win10' name='message_10_setting_os_win10' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_10_os_win11' );
echo "WIN 11 <input id='message_10_setting_os_win11' name='message_10_setting_os_win11' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
$options = get_option( 'message_10_os_mac' );
echo "MAC <input id='message_10_setting_os_mac' name='message_10_setting_os_mac' type='checkbox' value='1'" . checked(1, $options,false) . " /> ";
}
function message_10_setting_action() {
$options = get_option( 'message_10_action' );/* ==> ook te gebruiken op de front end */
$nothing = '';
$inform = '';
$warnanddelay = '';
$warnandblock = '';
switch ($options) {
case 'Nothing':
$nothing = selected;
break;
case 'Inform':
$inform = selected;
break;
case 'WarnAndDelay':
$warnanddelay = selected;
break;
case 'WarnAndBlock':
$warnandblock = selected;
break;
}
echo "
<label for='message_10_setting_action'></label>
<select name='message_10_setting_action' id='message_10_setting_action'>
<option value='Nothing' " . $nothing .">Nothing</option>
<option value='Inform'" . $inform .">Inform</option>
<option value='WarnAndDelay' " . $warnanddelay .">Warn and delay</option>
<option value='WarnAndBlock' " . $warnandblock .">Warn and block</option></select>";
}
function message_10_setting_timer() {
$options = get_option( 'message_10_timer' ); /* ==> ook te gebruiken op de front end */
echo "<input id='message_10_setting_timer' name='message_10_setting_timer' type='text' value='" . esc_attr( $options ) . "' />";
}
function message_10_setting_text() {
$options = get_option( 'message_10_text' ); /* ==> ook te gebruiken op de front end */
echo "<textarea id='message_10_setting_text' name='message_10_setting_text' rows='20' cols='150'>". esc_attr( $options ) . "</textarea>";
}
if(isset($_POST['submit_message_10'])){
update_option('message_10_version', $_POST['message_10_setting_version']);
update_option('message_10_browser_chrome', $_POST['message_10_setting_browser_chrome']);
update_option('message_10_browser_edge', $_POST['message_10_setting_browser_edge']);
update_option('message_10_browser_firefox', $_POST['message_10_setting_browser_firefox']);
update_option('message_10_browser_safari', $_POST['message_10_setting_browser_safari']);
update_option('message_10_os_win81', $_POST['message_10_setting_os_win81']);
update_option('message_10_os_win10', $_POST['message_10_setting_os_win10']);
update_option('message_10_os_win11', $_POST['message_10_setting_os_win11']);
update_option('message_10_os_mac', $_POST['message_10_setting_os_mac']);
update_option('message_10_action', $_POST['message_10_setting_action']);
update_option('message_10_timer', $_POST['message_10_setting_timer']);
update_option('message_10_text', $_POST['message_10_setting_text']);
}
// message-10 code ---------- END ------------
]]>I searched through their theme files and found that they get a query for that page with a custom function:
function get_last_weeks_top_stories($count = 10)
{
$last_weeks_top_story_ids = get_option( 'last_weeks_top_stories' );
$last_weeks_top_stories = new WP_Query(
array(
'post_type' => 'news_entry',
'post__in' => explode(',', $last_weeks_top_story_ids),
'posts_per_page' => $count
)
);
return $last_weeks_top_stories;
}
Here I can see they are retrieving the IDs stored in 'last_weeks_top_stories'
, and if I go to their wp-admin/options.php page I can see the ID’s being retrieved in there. It appears to be pulling the ‘correct’ posts based on the data in that options file, so this leads me to believe the issue is not with getting the correct data, but whatever is SETTING the most popular posts from last week. This is where the problem is for me.
I would think that there would have been some place in the theme or plugins files that would have an add_option()
, but I cannot find where this option of 'last_weeks_top_stories'
is being set at. I have downloaded the entire plugins and theme folder and searched through the files for any mention of ‘last_weeks’ and nothing comes up.
They have a plugin installed called WordPress Popular Posts so I was thinking maybe they would be utilizing that, but I cannot see anywhere where that field would be created within that plugin either, or if that is even what they were using to populate the option anyway.
Does anyone have any suggestions on how I could find out where this 'last_weeks_top_stories'
option is being set?
Thank you!
]]>if( get_option('dbem_version') != '' && get_option('dbem_version') < 5.821 ){
// do something here
}
With our locale settings get_option('dbem_version')
returns 5,96 (note the comma) so the condition evaluates as
if( 5,96 != '' && 5,96 < 5.821 ){
// do something here
}
5,96 < 5.821 is always true, so em_migrate_datetime_timezones()
never seems to be complete. And the GDPR message (v 5.93) and Google’s new pricing (v 5.95) are shown over and over again.
I temporarily edited the code and replaced get_option('dbem_version')
in the conditions with a hard coded 5.96 (with a decimal point), but in the next update this will be overwritten once again. Please rectify.
…
I see an error: ReferenceError: get_option is not defined[Learn More]
When I click on Learn More, I see just this line
<anonymous> https://hermiphoto.cz/kontakt/:1253:9
I use the newest version of plugin (2.3.9).
Thank you
]]>