I would do this the other way around:
if ( !is_user_logged_in () ) {
//the script exits if the user is not logged in
require('/path/to/your/script.php');
showAccessDenied($day, $month, $year, $area, isset($room) ? $room : "");
}
You can work that into a page in a number of ways. I don’t have enough detail to provide an example that fits your needs.
Related Posts:
- What is the correct way to use WordPress functions outside WordPress files?
- there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
- Call to undefined function wp() in wp-blog-header.php
- How to call WordPress PHP file using external js file
- Is the first item returned by get_posts() always the latest post?
- Combine CSS and JS files from plugins
- How to target with css, admin elements according to user role level?
- remove tags from posts in php
- Separate WordPress themes for each category page
- Getting key value of WP_Term object in wordpress
- Showing user ID on user main page from screen options
- Delete post revisions on post publish
- Using Cookie Data For WP_Query Loop
- how to add display_name from the users table to this query
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- How do I list the_tags() into HTML data-attribute
- WP Insert Post function – Insert Post Thumbnail
- get_usermeta() deprecated in favor of get_user_meta(). But why doesn’t it make use of it?
- How can I hide Home in my menu in a specific page?
- Anyway to output the registration form like the login form with wp_login_form()?
- Setting a cookie upon specific URL visit
- WordPress custom slug (endpoint) and compare all links
- Only show search results with if current date is between two dates?
- Remove duplicates – array_unique()
- database interactions using OOP
- get_term_link() returns correct – But illogical error-messages disturb
- prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site
- Capture User Email Address When Filling Out Form
- Execute long and heavy processes
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- How to modify a global variable in a function and use it on another function?
- How to send get request to file.php right and where to store that file.php?
- Display parent and child taxonomies in separate drop down select fields
- PHP echoes value without the use of echo
- Get URL from shortcode tag
- How can i show post_class() within output loop?
- How to remove ?p= from wordpress short links
- Hide image if taxonomy term is empty
- Could use some help with Shortcodes
- Use custom template on custom post type
- Do I always need to call wp_get_current_user() before accessing $current_user?
- How to make function appear in sentence?
- Save html content of a widget textarea
- Widgets not showing on custom theme
- How to define a variable already defined in a plugin function?
- Custom query vars filters problem with pagination
- How do I access post_meta key with php?
- How to modify mobile nav menu text in theme
- How to use AJAX in WordPress in MYSQL query?
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- php return username of currently viewed author profile
- Update value of a associative array with update_post_meta
- feedburner plugin for WP 3.5
- Redirect to current user page upon link click
- Adding wp_list_categories to a specific div that was appended using jQuery
- WordPress custom post type and taxonomy
- PHP code snippet to remove microdata
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WP_Query: How to get results from both meta_key options?
- how to dynamically remove all edit and delete functionality of a page
- Generate a QR code when creating a new WordPress user
- Passing in MySQL prepare statement parameter separately throwing error
- I want to fusion the product columns in email table order
- wordpress email checker on domain
- Critical error on your site
- posts_per_page displays only 2 posts instead of 4 posts
- Using wp_editor() when not logged stopped working
- Paged WP_Query is quitting on page 3
- Need help with format of nested array in MySQL
- How to add delete, approve, spam Links to Comments
- Adding user meta to post meta wp_insert_post() not working
- PHP: Why does my code work in index.php but not a widget?
- searching for members in wordpress
- Edit Post custom options not working
- jQuery doesn’t work in my php snippet
- How can I remove these resize lines from the comment box?
- Rearrange get_categories array compared to another array
- Changing code to remove 2 records for the first line
- use system script advertising in wordpress multisite
- “Where… like” query not working as expected
- Why isn’t my custom function kicking in from my functions.php file?
- Shortcoding with Divs
- Reusing the page name class that WordPress adds to body tag
- Custom Links in Walker Class
- How to include support for all page types, calendar urls, archive, etc
- Integrating CSS Into a WP Function Call [closed]
- WordPress menu links with images & class selection
- Use php array outside his function
- How do I remove blog entries from home page Twenty Eleven child theme?
- PHP 7.3 is required for WordPress 5.2 or Recommendation
- how to get image url from meta value?
- Show wrapper divs if query has results, then loop the results [closed]
- How make wp_nav() with my css?
- How to align buttons properly [closed]
- index.php file keeps redirecting to a non-existent index.html file?
- How to pass parameter to another url?
- HTTP 500 Error after Creating Shortcode
- Show button in header when product custom field is not empty
- WordPress PHP8 Critical Error in class-wp-widget.php
- How to get the last date updated of postmeta?