This file contains hidden or 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 | |
echo do_shortcode( '[passster password_list="115"]' ); | |
$atts = array( 'password_list' => '115' ); | |
$valid = passster\PS_Conditional::is_valid( $atts ); | |
if ( $valid ) { | |
get_template_part( 'template-parts/content', get_post_type() ); | |
// You can also use any other template of ACF layout here. | |
} |
This file contains hidden or 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 | |
add_action( 'save_post', 'ssp_auto_export', 10, 3 ); | |
/** | |
* Automatically run a static export after post is saved. | |
* | |
* @param int $post_id given post id. | |
* @param object $post given post object. | |
* @param bool $update if it's updated or not. |
This file contains hidden or 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 | |
// logout button | |
add_shortcode( 'passster-logout', function() { | |
?> | |
<button id="ps-logout">Logout</button> | |
<script> | |
jQuery(document).ready(function( $ ) { | |
$('#ps-logout').on('click', function() { | |
Cookies.set('passster', '', { | |
expires: 0, |
This file contains hidden or 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 | |
add_action( 'ss_after_cleanup', function() { | |
$webhook_url = 'https://api.cloudflare.com/client/v4/pages/webhooks/'; | |
wp_remote_get( $webhook_url, array() ); | |
}); |
This file contains hidden or 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 | |
add_action( 'passster_validation_success', function( $password ) { | |
?> | |
<script> | |
jQuery(document).ready(function( $ ) { | |
$('html, body').animate({ | |
scrollTop: $('#passster-scroll').offset().top | |
}, 'slow'); | |
}); | |
</script> |
This file contains hidden or 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 | |
add_action( 'woocommerce_before_single_product_summary', function() { | |
$post_id = get_the_id(); | |
$activate_protection = get_post_meta( $post_id, 'passster_activate_protection', true ); | |
// user restriction. | |
$user_restriction_type = get_post_meta( $post_id, 'passster_user_restriction_type', true ); | |
$user_restriction = get_post_meta( $post_id, 'passster_user_restriction', true ); |
This file contains hidden or 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 | |
register_activation_hook( __FILE__, 'setup_build_cron' ); | |
/** | |
* Setup a cron job to run daily. | |
* | |
* @return void | |
*/ | |
function setup_build_cron() { |
This file contains hidden or 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 | |
// Full static export | |
$simply_static = Simply_Static\Plugin::instance(); | |
$simply_static->run_static_export(); | |
// Exporting a build with Pro | |
update_option( 'simply-static-use-build', $build_id ); | |
$simply_static = Simply_Static\Plugin::instance(); | |
$simply_static->run_static_export(); |
This file contains hidden or 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 | |
add_action( 'passster_validation_success', function( $password ) { | |
$url = 'https://www.mydomain.de'; | |
wp_safe_redirect( $url ); | |
exit; | |
}); |
This file contains hidden or 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 | |
/** | |
* Adds FILR documents to the WordPress search. | |
* | |
* @param object $query current query. | |
* @return object | |
*/ | |
function add_filr_to_search( $query ) { | |
if ( $query->is_search ) { |