ppp - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of ppp.php
- <?php
- add_action( 'wp', 'maqro_force_user_login' );
- function maqro_force_user_login() {
- global $post;
- $login_page = (int) get_theme_mod('maqro_login_page_url');
- if( !is_user_logged_in() && $post->ID != $login_page || $registration_page ) {
- wp_redirect( get_permalink( $registration_page) );
- else{
- wp_redirect( get_permalink( $login_page) );
- }
- exit;
- }
- }
- ?>