' . __( 'Settings', 'admin-bar-tools' ) . ''; array_unshift( $links, $add_link ); return $links; } /** * Settings Page */ public function abt_settings_page() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You have no sufficient permissions to access this page.', 'admin-bar-tools' ) ); }; global $wpdb; $table_name = $wpdb->prefix . Abt_Return_Data::TABLE_NAME; $db_call = new Abt_Connect_Database(); $result = $db_call->return_table_data( Abt_Return_Data::TABLE_NAME ); $result_name = array_column( $result, 'name' ); $hidden_field_name = 'hiddenStatus'; if ( isset( $_POST[ $hidden_field_name ] ) && 'Y' === $_POST[ $hidden_field_name ] ) { if ( check_admin_referer( 'abt_settings_nonce', 'abt_settings_nonce' ) ) { foreach ( $result_name as $value ) { if ( isset( $_POST['checkStatus'] ) && in_array( $value, $_POST['checkStatus'], true ) ) { $wpdb->update( $table_name, [ 'status' => 1 ], [ 'name' => $value ], [ '%d' ], [ '%s' ], ); // db call ok; no-cache ok. } else { $wpdb->update( $table_name, [ 'status' => 0 ], [ 'name' => $value ], [ '%d' ], [ '%s' ], ); // db call ok; no-cache ok. }; }; $result = $db_call->return_table_data( Abt_Return_Data::TABLE_NAME ); $locale = get_option( 'abt_locale' ); if ( isset( $_POST['select-locale'] ) && $_POST['select-locale'] !== $locale ) { $post_locale = sanitize_text_field( wp_unslash( $_POST['select-locale'] ) ); $new_location_urls = Abt_Return_Data::change_locale( $post_locale ); foreach ( $new_location_urls as $key => $value ) { $wpdb->update( $table_name, [ 'url' => $new_location_urls[ $key ]['url'], 'adminurl' => $new_location_urls[ $key ]['adminurl'], ], [ 'shortname' => $new_location_urls[ $key ]['shortname'] ], [ '%s' ], [ '%s' ], ); // db call ok; no-cache ok. }; update_option( 'abt_locale', $post_locale ); } if ( isset( $_POST['searchconsole_radio'] ) && $_POST['searchconsole_radio'] !== $locale ) { $post_sc_radio = sanitize_text_field( wp_unslash( $_POST['searchconsole_radio'] ) ); update_option( 'abt_sc', $post_sc_radio ); } }; }; $sc_radio_value = get_option( 'abt_sc' ); ?>

$value ) : ?>

/>

/>

/>

: