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.



Your result can be seen below.

Result of php executing





Full code of ppp.php

  1. <?php
  2.  
  3. add_action( 'wp', 'maqro_force_user_login' );
  4.  
  5. function maqro_force_user_login() {
  6.   global $post;
  7.   $login_page = (int) get_theme_mod('maqro_login_page_url');
  8.  
  9.   if( !is_user_logged_in() && $post->ID != $login_page || $registration_page ) {
  10.     
  11.     wp_redirect( get_permalink( $registration_page) );
  12.     else{
  13.             wp_redirect( get_permalink( $login_page) );
  14.  
  15.     }
  16.  
  17.     
  18.     exit;
  19.   }
  20. }
  21. ?>
File Description
  • ppp
  • PHP Code
  • 12 Jan-2021
  • 406 Bytes
You can Share it: