[datebook_user_menu]

proba24

<?php
// Provjera je li korisnik prijavljen
if (is_user_logged_in()) {
    // Dohvati podatke o trenutnom korisniku
    $current_user = wp_get_current_user();
    
    // Prikazi ime korisnika
    echo 'Dobrodošao, ' . esc_html($current_user->display_name) . '!';
} else {
    // Ako korisnik nije prijavljen, prikaži poruku ili druge sadržaje
    echo 'Dobrodošao, gost!';
}
?>
// App.js

import React, { useState } from 'react';

const GrandchildComponent = ({ dataFromChild }) => {
  return (
    <div>
      <p>Username in Grandchild: {dataFromChild.username}</p>
    </div>
  );
};

const ChildComponent = ({ dataFromParent }) => {
  return (
    <div>
      <p>Your email: {dataFromParent.email}</p>
      <GrandchildComponent dataFromChild={dataFromParent} />
    </div>
  );
};

const ParentComponent = () => {
  const [userData, setUserData] = useState({
    username: 'benny_dicta',
    email: 'benedictaonyebuchi@gmail.com',
  });

  return (
    <div>
      <h1>Welcome, {userData.username}!</h1>
      <ChildComponent dataFromParent={userData} />
    </div>
  );
};

const App = () => {
  return <ParentComponent />;
};

export default App;