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 | |
| /* Alter subscription card order */ | |
| add_filter( 'leaky_paywall_subscription_levels', 'zeen101_alter_subscription_card_order' ); | |
| function zeen101_alter_subscription_card_order( $levels ) { | |
| $yearly = $levels[0]; | |
| $monthly = $levels[1]; | |
| $corporate = $levels[2]; |
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_filter( 'leaky_paywall_subscribe_or_login_message', 'zeen101_custom_login_message', 10, 3 ); | |
| function zeen101_custom_login_message( $new_content, $message, $content ) { | |
| $zeen_message = '<div id="leaky_paywall_message">'; | |
| $zeen_message .= '<h2>I want to use this message instead!</h2>'; | |
| $zeen_message .= do_shortcode('[leaky_subscription_cards]'); // you can even add a shortcode or php function | |
| $zeen_message .= '</div>'; |
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_filter('leaky_paywall_subscribe_or_login_message', 'zeen101_custom_subscribe_content', 10, 4 ); | |
| function zeen101_custom_subscribe_content( $new_content, $message, $content, $post_id ) { | |
| $thumbnail = get_the_post_thumbnail(); | |
| return '<p>' . $content . '</p>' . $thumbnail . $message; | |
| } |
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_filter('comment_form_defaults', 'endo_comment_changes'); | |
| function endo_comment_changes( $defaults ) { | |
| $current_user = wp_get_current_user(); | |
| $defaults['logged_in_as'] = '<p class="logged-in-as">' . sprintf( __( '<small>You are currently logged in as <a href="%1$s">%2$s</a> ... Is this not you? <a href="%3$s" title="Log out of this account">Log out by clicking here.</a></small>' ), admin_url( 'profile.php' ), $current_user->user_login, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>'; |
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 | |
| /** | |
| * Caches the query for 15 minutes to a transient | |
| * @param string $color a meta key | |
| * @return array $posts an array of post objects | |
| */ | |
| function caching_query_example_function( $color ) { | |
| $cache_key = 'color-transient-' . $color; |
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 | |
| function endo_allow_csv_uploads( $mime_types ) { | |
| $mime_types['csv'] = 'text/csv'; | |
| return $mime_types; | |
| } | |
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 | |
| // leaky paywall restriction functionality for custom fields | |
| function is_restricted_zeen101_post( $post_id ) { | |
| if ( current_user_can( 'edit_posts' ) ) { // show content to contributors and up | |
| return false; | |
| } | |
| $settings = get_leaky_paywall_settings(); |
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( 'admin_init', 'convert_exchange_to_leaky_paywall' ); | |
| function convert_exchange_to_leaky_paywall() { | |
| // loop through subscribers | |
| // see if they have a transaction | |
| // if so, get their subscription status and subscription expiratin of the transaction | |
| // save that data as user meta for leaky paywall |
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_filter( 'issuem_pdf_html', 'zeen101_edit_pdf_output', 10, 3 ); | |
| function zeen101_edit_pdf_output( $results, $term, $issue_id ) { | |
| return strip_shortcodes( $results ); | |
| } |
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 | |
| function ed_metabox_include_front_page( $display, $meta_box, $cmb ) { | |
| if ( ! isset( $meta_box['show_on']['key'] ) ) { | |
| return $display; | |
| } | |
| if ( 'front-page' !== $meta_box['show_on']['key'] ) { | |
| return $display; | |
| } |