You can also consider a Javascript solution by adding a portion of code that will redirect people to the page if not loggued in :
<?php
/*
Plugin Name: Héroes y Pasta
*/
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
function iniciatodo() {
if(is_user_logged_in()) {
?>
<p>Hola tio</p>
<?php
} else { ?>
<script>window.location.href="http://gexy.es.cx/login/";</script>
<?php }
}
add_shortcode("inicia_todo", "iniciatodo");
Related Posts:
- Can Not Redirect from Plugin-Registered Admin Page
- Redirect to a welcome page after updating plugin
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- wp_redirect() Error in Custom Plugin
- wp_redirect doen’t work
- Notice: Undefined index: mtral_field_subscriber
- Redirect plugin after form submit or show errors
- Woocommerce redirection if no previous orders
- Crazy redirect happening with no redirects set up
- redirect to a custom page
- Clone a Post Tite and Custom Field into Custom Post type
- Redirect loop when forwarding to mobile site
- How to remove post redirects
- How to Add WYSIWYG Editor (tinyMCE) to plugin options page compatible with WordPress 3.0 and up?
- What is a Network Activated Plugin Exactly?
- Install an external plugin within the current plugin
- WooCommerce – Call to undefined function is_woocommerce()
- How to distinquish wordpress served links from non-wordpress served links
- Upgrading WordPress 4.0 asks for FTP password
- do_shortcode() doesn’t work if shortcode contained in variable, works if shortcode passed as string
- Is there a way to lock certain pages from being edited by anyone other then the admin?
- WordPress ajax call for not logged in users, doesn’t work
- Issue with post request to admin-post.php
- Add multiple attributes to product from php
- Built in audio player?
- How to show my sidebar in specific page only?
- like to keep reading plugin
- Check if email address exists front end with AJAX in a plugin
- Plugin Development sqlite or WordPress’ database
- How to review WordPress website php version compatibility?
- Translate database content using __($message) function
- Add Extra codes by plugin
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Admin Theme customization
- WordPress web pages keep getting deleted (moved into the trash) by themselves
- wordpress json api not working
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- WordPress plugin creation how to execute .sql in order to insert multiple rows at activation of plugin
- Problem with PHP wordpress, Undefined index: in C:\xampp\htdocs\wordpress\wp-content\plugins\epoch\classes\core.php on line 190 [closed]
- Contributive page where people logged in can write
- How to create a custom shortcode based on the layout?
- Installing plugins and using complex folder structure with child theme in WordPress
- Implementing an image hosting website using WordPress? [closed]
- Plugins ignored a line breaks or tag in the WordPress comment functions
- How to get path or root of plugin folder, not file or dir?
- Displayed content disappears when adding attributes to shortcode
- What is the easiest way to rename a plugin (and also avoid plugin updates)
- Display linked articles at the bottom of post (like related posts)
- register_activation_hook() not working as expected
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- shortcode – multiple instances of same parameter name in one shortcode instance
- Is there a counter for comments left?
- External wpdb connections in different plugins on single page
- How to add update function to plugin without adding it to https://wordpress.org/plugins/ [closed]
- 500 error when updating plugin option
- How to edit link for comment count
- Personalized Author Area
- New Variable Woocommerce product not showing variations, price, or add to cart on front end [closed]
- WP-ecommerce : Change the price before inserting it into the cart
- Integrating Custom Database with WordPress
- How do I duplicate a single wpmu site?
- Dynamic landing page – am I doing this right?
- How to add height and width to images on a page(using WP Bakery) to improve Google’s CLS score?
- how to display a template.php in a shortcode
- How to hide a woocommerce setting tab from admin & shop manager?
- Woocommerce add products to cart
- How to get data from a form on a wordpress site?
- I need to register and resize images, safe to delete plugin afterwards?
- Using mu-plugins on the Genesis Framework
- Is it possible to custom set query for a WordPress REST API response?
- wpdb update method is updating but not refreshing the current page data
- How can I upload and password protect Javadocs in WordPress?
- How to send custom mail when a user complete a specific form
- Generating shortcode and HTML on button click
- Plugin error “array_key_exists(): The first argument should be either a string or an integer” [closed]
- Show content from plugin on index
- Sub Categories in drop down menu
- Migrating custom php we wrote from functions.php into a site-specific plugin
- “Listen” button on my main post page
- CMB2 Post Search Field displays/repeats initial post if left empty
- User content database [closed]
- Add HTML between feed items
- Private “Parents” content for school site
- Automatization for automatization
- Form submit from wordpress plugin
- Can a developer adopt a plugin marked as “not updated in over 2 years”?
- disable lightbox in a plugin [closed]
- How to include css for plugin setting page? [duplicate]
- Encode URL picked up by Digg Digg
- Share Bar over laps left column [closed]
- Allow a role to edit one specific plugin
- Post curl function save twice using plugin hook function wordpress
- Frontpage Admin Bar Disappeared
- WP Customer Reviews call short code on another page [closed]
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- wordpress plugin noob situation
- turn off WooCommerce for a site in a multi site environment
- Count div with class (.length) only shows 0 [closed]
- How to make a Template page to show the information of different things Shop and Product page?