This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Users; | |
use WP_User; | |
use WP_Role; | |
use WP_Query; | |
use WP_Term_Query; | |
class Role { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use RuntimeException; | |
require_once(ABSPATH . '/wp-load.php'); | |
require_once(ABSPATH . '/wp-admin/includes/image.php'); | |
require_once(ABSPATH . '/wp-admin/includes/file.php'); | |
require_once(ABSPATH . '/wp-admin/includes/media.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Utils; | |
use DateTime; | |
use App\PostTypes\Event; | |
use Nette\Utils\Strings; | |
use Jsvrcek\ICS\CalendarExport; | |
use Jsvrcek\ICS\CalendarStream; | |
use Jsvrcek\ICS\Utility\Formatter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the password form action URL. | |
*/ | |
add_filter('the_password_form', function($form, $post) { | |
$url = add_query_arg('unlock', 'post', get_permalink($post->ID)); | |
$form = preg_replace('/action="([^\"]+)"/', 'action="' . $url . '"', $form); | |
return $form; | |
}, 10, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Locking whole web with simple password form | |
* ACF fields: | |
* - string 'wiki_password' - from settings, password to validate against the input form viewer login form | |
* - bool 'wiki_lock_site' - from settings, whether the site should be only accessible with password | |
* - array 'wiki_allowed_posts' - from settings, relation filed returning an array of post IDs, which are allowed to be viewed without password | |
*/ |