<?php
$args = array(
'post_author' => $current_user->ID,
'number' => 10, // how many comments to retrieve
'status' => 'approve'
);
$comments = get_comments( $args );
if ( $comments )
{
$output.= "<ul>\n";
foreach ( $comments as $c )
{
$output.= '<li>';
// $output.= '<a href="'.get_comment_link( $c->comment_ID ).'">';
$output.= get_comment_text($c->comment_ID);
$output.= '</a>, Posted on: '. mysql2date('m/d/Y', $c->comment_date, $translate);
$output.= "</li>\n";
}
$output.= '</ul>';
echo $output;
} else { echo "No comments made";}
?>
<a id="lol" href="/apply/" class="card shadow-lg lift h-100">
...
<script>document.getElementById('lol').onclick = function () {
localStorage.setItem('game', "LOL");
}
</script>
<script>document.getElementById('val').onclick = function () {
localStorage.setItem('game', "VAL");
}
</script>
<script>document.getElementById('tft').onclick = function () {
localStorage.setItem('game', "TFT");
}
</script>
<script>document.getElementById('wr').onclick = function () {
localStorage.setItem('game', "WR");
}
</script>
<script>document.getElementById('ow').onclick = function () {
localStorage.setItem('game', "OW");
}
</script>
<h1 id="game"></h1>
<script>
let game = localStorage.getItem('game');
let lol = document.getElementById('game')
let val = document.getElementById('game')
let tft = document.getElementById('game')
let wr = document.getElementById('game')
let ov = document.getElementById('game')
window.onload = function() {
if(game == null){
lol.innerHTML;
val.innerHTML;
tft.innerHTML;
wr.innerHTML;
ov.innerHTML;
}
else {
lol.innerHTML = game;
val.innerHTML = game;
tft.innerHTML = game;
wr.innerHTML = game;
ov.innerHTML = game;
}
}
</script>
<a id="Lol" href="/apply/" class="card shadow-lg lift h-100">
<script>document.getElementById('Lol').onclick = function () {
localStorage.setItem('game', "League of Legends");
}
</script>
<h1 id="game" ></h1>
<script>
let game = localStorage.getItem('game');
let job = document.getElementById('game')
window.onload = function() {
if(game == null){
job.innerHTML;
}
else {
job.innerHTML = game;
}
}
</script>
function getUserRegDate() {
$current_user = wp_get_current_user();
$user_info = get_userdata($user_id);
if ( is_user_logged_in() ) { // Проверяем, залогинен ли пользователь
$user_reg = $current_user->user_registered;
}
$now = new DateTime ($user_reg);
echo $now ? date_i18n('F j, H:i', strtotime($now)) : '';
}
function getUserRegDate() {
$user = get_userdata(get_current_user_id());
$user_reg = $user->get('user_registered');
$datetime = new DateTime($user_reg);
$formatter = new IntlDateFormatter(
'ru_RU',
IntlDateFormatter::LONG,
IntlDateFormatter::LONG
);
$formatter->setPattern('d MMMM, yyyy');
echo $formatter->format($datetime);
}
<script>
const currency_data = {"USD":1.0664,"GBP":0.8486,"Updated":"Tue, 24 May 2022 00:00:02 +0000"}
</script>
<script>
setTimeout(function(){
$('#currency-eur').trigger('click');
}, 1000);
</script>
<a class="clickme">
Нажми на меня!
</a>
<script>
$('.clickme').click(function(){
if (!$(this).data('status')) {
$(this).html('Молодец! А еще раз слабо?');
$(this).data('status', true);
}
else {
$(this).html('Ну ты гигант! А может еще раз?');
$(this).data('status', false);
}
});
</script>
<input id="datepicker" class="button" type="submit" value="<?php _e('Оплатить', 'inter');?>" style="background-color: #ef8989">
<?php echo $cancel_url;?>
</form>
<script>
setTimeout(function(){
$('#datepicker').trigger('click');
}, 1000);
</script>
/** Replace 'An account is already registered with your email address. Please log in.' **/
add_filter( 'woocommerce_registration_error_email_exists', function() {
return 'Este înregistrat deja un cont cu adresa ta de e-mail. <a href="#" class="showlogin">Te rugăm să te autentifici.</a>';
} );
if ( class_exists( 'WooCommerce' ) && is_account_page() ) {
get_header('shop');
} else {
// текущий код header.php
}
add_filter( 'woocommerce_thankyou', 'update_order_status', 10, 1 );
function update_order_status( $order_id ) {
if ( !$order_id ){
return;
}
$order = new WC_Order( $order_id );
if ( 'on-hold' == $order->status) {
$order->update_status( 'pending payment' );
}
return;
}
add_filter('woocommerce_save_account_details_required_fields', 'remove_required_fields');
function remove_required_fields( $required_fields ) {
unset($required_fields['account_first_name']);
unset($required_fields['account_last_name']);
return $required_fields;
}
//отключение загрузки скриптов и стилей cf7mls
function deregister_cf7mls_scripts() {
if( ! is_page('apply') ){
wp_deregister_script('cf7mls');
}
}
add_action('wp_print_scripts', 'deregister_cf7mls_scripts', 100);
function deregister_cf7mls_styles() {
if( ! is_page('apply') ){
wp_deregister_style('cf7mls');
}
}
add_action('wp_print_styles', 'deregister_cf7mls_styles', 100);
//отключение загрузки скриптов и стилей cf7mls