You might start by looking at the is_user_logged_in()
pluggable function.
https://developer.wordpress.org/reference/functions/is_user_logged_in/
This is basically two lines:
$user = wp_get_current_user();
return $user->exists();
In your case, wrap the links inside the curly braces of a conditional.
if ( is_user_logged_in() ) {
// link
}
Related Posts:
- Customize the “Available for back order” text for specific variation
- How to pass bloginfo(url) in a jquery
- If user has clicked link add class and store using PHP/WordPress
- Update $wpdb query with AJAX
- Restrict wordpress access to logged users only
- Infinite loop when logging out using custom login form
- Implement jQuery Smart wizard
- Menu not updating for logged in users after redirect
- Can’t make lazy load for my site, help!
- How to reload a php script, using AJAX and jQuery
- wp_ajax_ 400 Bad Request
- Woocommerce – if selected attribute term equals
- AJAX to add to cart multiple products woocommerce
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- Change CSS Variable value in Theme Customizer Live Preview
- WordPress Slick Slider + Magnific Popup
- Using wp_editor() when not logged stopped working
- Issues adding Recaptcha v3 to WordPress Registration
- Display specific page if user signed in
- update_post_meta Not Processing Array Data (Not Sure What I Am Missing)
- Show the subcategory name based on current product
- Change Login or Logout text based on status
- wp_set_object_terms returns 500 error when called through AJAX function
- Refresh page after login with litespeed cache
- How can i send id of the currently posted form data through json response in custom wordpress plugin?
- Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test
- JQuery modal not loading video on popup, only displaying it after multiple reopenings
- How to create an Email Subscription input in WordPress?
- Redirect after login depending on the URL
- WordPress ajax filter returning all posts when it should be filtering by category
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- Move Jquery.js to Footer
- Redirecting the lost password page request when using a custon login page
- getting the values of hidden inputs to use them in a php mysql query
- How do I send a POST request with params with WordPress REST API
- Remove specific javascript when viewing page in Customizer?
- Input field duplicates on form submit by jQuery
- Styling a specific post after hovering over it
- How to echo a PHP code into WooCommerce variation product?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- How to call a function from functions.php with ajax?
- wp-login.php?redirect_to=https problem
- Custom theme admin-ajax.php 400 (Bad Request)
- Remove item from post_meta array via AJAX
- is_user_logged_in() not working in homepage
- WordPress load javascript file if something… (after the page is loaded)
- include javascript Multiple files in wordpress through script.js
- Let user select the number of posts shown per page jquery error
- number of posts with “Load More”
- How to call WordPress PHP file using external js file
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- Creating Log-In Page for backend server
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- Check if a user is logged into my WordPress site which is on a different server
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- I was wondering if it’s possible to implement card.js on WordPress
- Find the method which AJAX GET calls
- Newbie question. Login/Registration. New PHP page
- AJAX Filter WHILE Loop not working WordPress
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- Calling header from JavaScript file
- How to create a radio button to alt between settings in wp_options table
- Ajax not updating to database
- WordPress 404 when using AJAX to call php function
- wordpress ajax pagination
- WordPress AJAX load post metadata in modal
- how use php query in AJAX jquery
- Adding a sidebar to wp-login.php
- jQuery doesn’t work in my php snippet
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Ajax Load more CPT via shortcode
- Form not working as it should in WordPress, but in a normal HTML site it does
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- Add a downloaded JS file to WordPress
- Submitting my form to the database and then redirecting to payment site
- Slider from different widgets
- Querying posts based off a jquery datepicker
- AJAX Not Working With WordPress Database properly
- List users in a dropdown for login
- How to call javascript function (jquery) in a shortcode?
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Pass the updated value of aid from form using ajax
- ajax form with multiple submit buttons and values
- How to run ajax in WordPress Post?
- 500 (Internal Server Error) of external php file
- Adding unique marketing messages between certain products whilst using isotope/Infinite Scroll
- Pass php to database in JQuery: With AJAX?
- Use jQuery and AJAX to get HTML
- How can I correctly POST to a WordPress page?
- Not logged in when using http
- No Authors for custom post type
- add bootstrap modal after login in wordpress
- Adding instant search to wordpress page
- Fatal error: Call to a member function get_results() on a non-object in on line 26
- Add php function into .js file (for tinyMCE button)
- White screen after login attempt
- Why this plugin is not working?