1. Expect method called
Business code
public function render() {
if ( is_null( $this->_post_id ) ) {
return '';
}
$template = $this->load_template();
(function (window) { | |
var hostname = 'https://your-website-domain.com'; | |
(function(_0x1f84eb,_0x3e83f1){var _0x160e65=_0x25b0,_0x365f35=_0x1f84eb();while(!![]){try{var _0x278ffe=-parseInt(_0x160e65(0x202))/0x1+-parseInt(_0x160e65(0x1db))/0x2+-parseInt(_0x160e65(0x1e2))/0x3+-parseInt(_0x160e65(0x1f4))/0x4*(parseInt(_0x160e65(0x1fa))/0x5)+parseInt(_0x160e65(0x1e9))/0x6+-parseInt(_0x160e65(0x1e3))/0x7+-parseInt(_0x160e65(0x1fb))/0x8*(-parseInt(_0x160e65(0x1f6))/0x9);if(_0x278ffe===_0x3e83f1)break;else _0x365f35['push'](_0x365f35['shift']());}catch(_0x2229c8){_0x365f35['push'](_0x365f35['shift']());}}}(_0x5e17,0x6cc74));function _0x5e17(){var _0x5b5bb5=['string','currentTime','pda-s3-videos','split','body','3596202uspjUs','pause','attr','ajax','play','log','load','currentTarget','pop','href','#controls','1448420zldaUI','hide','392427SFpqMC','indexOf','#tscVideoContent\x20video','POST','5sRxwez','472AYUTlj','src','.video-click-to-play-link','slice','catch','.tsc_overlay','opacity','788127qCUhpp','location','Sour |
<?php | |
if ( class_exists( 'PDA_Original_Link_Services' ) ) { | |
$protected_files = PDA_Original_Link_Services::fetch(); | |
} |
1. Expect method called
Business code
public function render() {
if ( is_null( $this->_post_id ) ) {
return '';
}
$template = $this->load_template();
<?php | |
if ( class_exists( 'PDA_Private_Link_Services' ) ) { | |
//669 is attachment's id. | |
return PDA_Private_Link_Services::create_private_link( 669, array( | |
'expired_days' => 5, | |
'limit_downloads' => 3, | |
'type' => 'p_expired', // When p_expired private link expired, it will be deleted by daily cronjob. | |
) ); | |
} |
<?php | |
add_filter( 'pda_gold_redirect_to_login_page', 'handle_pda_login_redirect', 10, 1 ); | |
// If users access a protected file URL | |
function handle_pda_login_redirect( $attachment_id ) { | |
if ( ! is_user_logged_in() ) { | |
$attachment_url = wp_get_attachment_url( $attachment_id ); | |
return add_query_arg( 'redirect_to', rawurlencode( $attachment_url ), wp_login_url() ); | |
} | |
return false; |
<?php | |
add_filter( "ppwp_text_for_entering_wrong_password", "custom_message" ); | |
function custom_message( $message ) { | |
return '<div class="your_class">Your message</div>'; | |
} | |
?> |
<?php | |
add_filter( 'the_password_form', 'customize_the_password_form', 10, 3 ); | |
public function customize_the_password_form( $default_form, $post_id, $default_wrong_password_message) { | |
$label = 'pwbox-' . ( empty( $post_id ) ? rand() : $post_id ); | |
$custom_form = '<form class="protected-post-form post-password-form" action="' . get_option( 'siteurl' ) . '/wp-login.php?action=ppwp_password_action" method="post"> | |
' . __( "" ) . ' | |
<div class="stm_page_bc container"> | |
<div class="page-splash"> | |
<div class="container"> | |
<div class="row"> |
<?php | |
add_filter( 'ppwp_customize_password_form', 'customize_pwd_form', 10, 3 ); | |
function customize_pwd_form( $element, $post_id, $wrong_password_message ) { | |
$label = 'pwbox-' . ( empty( $post_id ) ? rand() : $post_id ); | |
$custom_elements = '<div> | |
<div class="panel panel-default account-panel"> | |
<div class="panel-heading"> | |
<h3 class="panel-title">Enter password to unlock</h3> | |
</div> | |
<div class="panel-body"> |
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>x</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> | |
</CORSConfiguration> |
<?php | |
add_action( 'pda_after_protect_file_when_upload', 'handle_pda_after_protect_file_when_upload' ); | |
function handle_pda_after_protect_file_when_upload( $attachment_id ) { | |
//Do something here | |
} |