Plugin Directory

Changeset 3380693


Ignore:
Timestamp:
10/19/2025 06:36:17 AM (5 months ago)
Author:
convertkit
Message:

Update to version 3.0.5 from GitHub

Location:
convertkit
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • convertkit/tags/3.0.5/includes/class-convertkit-ajax.php

    r3337204 r3380693  
    176176        $output_restrict_content->maybe_run_subscriber_authentication();
    177177
     178        // Fetch Post ID, Resource Type and Resource ID for the view.
     179        $post_id       = $output_restrict_content->post_id;
     180        $resource_type = $output_restrict_content->resource_type;
     181        $resource_id   = $output_restrict_content->resource_id;
     182
    178183        // If an error occured, build the email form view with the error message.
    179184        if ( is_wp_error( $output_restrict_content->error ) ) {
     
    207212        $output_restrict_content->maybe_run_subscriber_verification();
    208213
     214        // Fetch Post ID, Resource Type and Resource ID for the view.
     215        $post_id       = $output_restrict_content->post_id;
     216        $resource_type = $output_restrict_content->resource_type;
     217        $resource_id   = $output_restrict_content->resource_id;
     218
    209219        // If an error occured, build the code form view with the error message.
    210220        if ( is_wp_error( $output_restrict_content->error ) ) {
  • convertkit/tags/3.0.5/includes/class-convertkit-output-restrict-content.php

    r3357832 r3380693  
    375375        // and Page Builders.
    376376        add_filter( 'the_content', array( $this, 'maybe_restrict_content' ) );
    377 
    378         // Fetch some information about the current Page.
    379         $id = get_the_ID();
    380377
    381378        /**
     
    12331230        }
    12341231
     1232        // Get resource type and id.
     1233        $resource_type = $this->resource_type;
     1234        $resource_id   = $this->resource_id;
     1235
    12351236        // This is deliberately a switch statement, because we will likely add in support
    12361237        // for restrict by tag and form later.
    1237         switch ( $this->resource_type ) {
     1238        switch ( $resource_type ) {
    12381239            case 'product':
    12391240                // Get header and text from settings for Products.
     
    12441245                // Get Product.
    12451246                $products = new ConvertKit_Resource_Products( 'restrict_content' );
    1246                 $product  = $products->get_by_id( $this->resource_id );
     1247                $product  = $products->get_by_id( $resource_id );
    12471248
    12481249                // Get commerce.js URL and enqueue.
     
    12571258                    add_action(
    12581259                        'wp_footer',
    1259                         function () {
     1260                        function () use ( $post_id, $resource_id, $resource_type ) {
    12601261
    12611262                            include_once CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/login-modal.php';
     
    12681269                ob_start();
    12691270                $button = $products->get_html(
    1270                     $this->resource_id,
     1271                    $resource_id,
    12711272                    $this->restrict_content_settings->get_by_key( 'subscribe_button_label' ),
    12721273                    array(
     
    12801281                // Display the Form.
    12811282                $forms = new ConvertKit_Resource_Forms( 'restrict_content' );
    1282                 $form  = $forms->get_html( $this->resource_id, $post_id );
     1283                $form  = $forms->get_html( $resource_id, $post_id );
    12831284
    12841285                // If scripts are enabled, output the email login form in a modal, which will be displayed
     
    12871288                    add_action(
    12881289                        'wp_footer',
    1289                         function () {
     1290                        function () use ( $post_id, $resource_id, $resource_type ) {
    12901291
    12911292                            include_once CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/login-modal.php';
     
    13101311                    add_action(
    13111312                        'wp_footer',
    1312                         function () {
     1313                        function () use ( $post_id, $resource_id, $resource_type ) {
    13131314
    13141315                            include_once CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/login-modal.php';
  • convertkit/tags/3.0.5/views/frontend/restrict-content/login-email.php

    r3242327 r3380693  
    1010
    1111?>
    12 <form id="convertkit-restrict-content-form" class="convertkit-restrict-content-form" action="<?php echo esc_attr( add_query_arg( array( 'convertkit_login' => 1 ), get_permalink( WP_ConvertKit()->get_class( 'output_restrict_content' )->post_id ) ) ); ?>#convertkit-restrict-content" method="post">
     12<form id="convertkit-restrict-content-form" class="convertkit-restrict-content-form" action="<?php echo esc_attr( add_query_arg( array( 'convertkit_login' => 1 ), get_permalink( $post_id ) ) ); ?>#convertkit-restrict-content" method="post">
    1313    <div id="convertkit-restrict-content-email-field" class="<?php echo sanitize_html_class( ( is_wp_error( WP_ConvertKit()->get_class( 'output_restrict_content' )->error ) ? 'convertkit-restrict-content-error' : '' ) ); ?>">
    1414        <input type="email" name="convertkit_email" id="convertkit_email" value="" placeholder="<?php esc_attr_e( 'Email Address', 'convertkit' ); ?>" required />
    1515        <input type="submit" class="wp-block-button__link wp-block-button__link" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->restrict_content_settings->get_by_key( 'email_button_label' ) ); ?>" />
    16         <input type="hidden" name="convertkit_resource_type" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->resource_type ); ?>" />
    17         <input type="hidden" name="convertkit_resource_id" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->resource_id ); ?>" />
    18         <input type="hidden" name="convertkit_post_id" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->post_id ); ?>" />
     16        <input type="hidden" name="convertkit_resource_type" value="<?php echo esc_attr( $resource_type ); ?>" />
     17        <input type="hidden" name="convertkit_resource_id" value="<?php echo esc_attr( $resource_id ); ?>" />
     18        <input type="hidden" name="convertkit_post_id" value="<?php echo esc_attr( $post_id ); ?>" />
    1919        <?php wp_nonce_field( 'convertkit_restrict_content_login' ); ?>
    2020    </div>
  • convertkit/trunk/includes/class-convertkit-ajax.php

    r3337204 r3380693  
    176176        $output_restrict_content->maybe_run_subscriber_authentication();
    177177
     178        // Fetch Post ID, Resource Type and Resource ID for the view.
     179        $post_id       = $output_restrict_content->post_id;
     180        $resource_type = $output_restrict_content->resource_type;
     181        $resource_id   = $output_restrict_content->resource_id;
     182
    178183        // If an error occured, build the email form view with the error message.
    179184        if ( is_wp_error( $output_restrict_content->error ) ) {
     
    207212        $output_restrict_content->maybe_run_subscriber_verification();
    208213
     214        // Fetch Post ID, Resource Type and Resource ID for the view.
     215        $post_id       = $output_restrict_content->post_id;
     216        $resource_type = $output_restrict_content->resource_type;
     217        $resource_id   = $output_restrict_content->resource_id;
     218
    209219        // If an error occured, build the code form view with the error message.
    210220        if ( is_wp_error( $output_restrict_content->error ) ) {
  • convertkit/trunk/includes/class-convertkit-output-restrict-content.php

    r3357832 r3380693  
    375375        // and Page Builders.
    376376        add_filter( 'the_content', array( $this, 'maybe_restrict_content' ) );
    377 
    378         // Fetch some information about the current Page.
    379         $id = get_the_ID();
    380377
    381378        /**
     
    12331230        }
    12341231
     1232        // Get resource type and id.
     1233        $resource_type = $this->resource_type;
     1234        $resource_id   = $this->resource_id;
     1235
    12351236        // This is deliberately a switch statement, because we will likely add in support
    12361237        // for restrict by tag and form later.
    1237         switch ( $this->resource_type ) {
     1238        switch ( $resource_type ) {
    12381239            case 'product':
    12391240                // Get header and text from settings for Products.
     
    12441245                // Get Product.
    12451246                $products = new ConvertKit_Resource_Products( 'restrict_content' );
    1246                 $product  = $products->get_by_id( $this->resource_id );
     1247                $product  = $products->get_by_id( $resource_id );
    12471248
    12481249                // Get commerce.js URL and enqueue.
     
    12571258                    add_action(
    12581259                        'wp_footer',
    1259                         function () {
     1260                        function () use ( $post_id, $resource_id, $resource_type ) {
    12601261
    12611262                            include_once CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/login-modal.php';
     
    12681269                ob_start();
    12691270                $button = $products->get_html(
    1270                     $this->resource_id,
     1271                    $resource_id,
    12711272                    $this->restrict_content_settings->get_by_key( 'subscribe_button_label' ),
    12721273                    array(
     
    12801281                // Display the Form.
    12811282                $forms = new ConvertKit_Resource_Forms( 'restrict_content' );
    1282                 $form  = $forms->get_html( $this->resource_id, $post_id );
     1283                $form  = $forms->get_html( $resource_id, $post_id );
    12831284
    12841285                // If scripts are enabled, output the email login form in a modal, which will be displayed
     
    12871288                    add_action(
    12881289                        'wp_footer',
    1289                         function () {
     1290                        function () use ( $post_id, $resource_id, $resource_type ) {
    12901291
    12911292                            include_once CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/login-modal.php';
     
    13101311                    add_action(
    13111312                        'wp_footer',
    1312                         function () {
     1313                        function () use ( $post_id, $resource_id, $resource_type ) {
    13131314
    13141315                            include_once CONVERTKIT_PLUGIN_PATH . '/views/frontend/restrict-content/login-modal.php';
  • convertkit/trunk/views/frontend/restrict-content/login-email.php

    r3242327 r3380693  
    1010
    1111?>
    12 <form id="convertkit-restrict-content-form" class="convertkit-restrict-content-form" action="<?php echo esc_attr( add_query_arg( array( 'convertkit_login' => 1 ), get_permalink( WP_ConvertKit()->get_class( 'output_restrict_content' )->post_id ) ) ); ?>#convertkit-restrict-content" method="post">
     12<form id="convertkit-restrict-content-form" class="convertkit-restrict-content-form" action="<?php echo esc_attr( add_query_arg( array( 'convertkit_login' => 1 ), get_permalink( $post_id ) ) ); ?>#convertkit-restrict-content" method="post">
    1313    <div id="convertkit-restrict-content-email-field" class="<?php echo sanitize_html_class( ( is_wp_error( WP_ConvertKit()->get_class( 'output_restrict_content' )->error ) ? 'convertkit-restrict-content-error' : '' ) ); ?>">
    1414        <input type="email" name="convertkit_email" id="convertkit_email" value="" placeholder="<?php esc_attr_e( 'Email Address', 'convertkit' ); ?>" required />
    1515        <input type="submit" class="wp-block-button__link wp-block-button__link" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->restrict_content_settings->get_by_key( 'email_button_label' ) ); ?>" />
    16         <input type="hidden" name="convertkit_resource_type" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->resource_type ); ?>" />
    17         <input type="hidden" name="convertkit_resource_id" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->resource_id ); ?>" />
    18         <input type="hidden" name="convertkit_post_id" value="<?php echo esc_attr( WP_ConvertKit()->get_class( 'output_restrict_content' )->post_id ); ?>" />
     16        <input type="hidden" name="convertkit_resource_type" value="<?php echo esc_attr( $resource_type ); ?>" />
     17        <input type="hidden" name="convertkit_resource_id" value="<?php echo esc_attr( $resource_id ); ?>" />
     18        <input type="hidden" name="convertkit_post_id" value="<?php echo esc_attr( $post_id ); ?>" />
    1919        <?php wp_nonce_field( 'convertkit_restrict_content_login' ); ?>
    2020    </div>
Note: See TracChangeset for help on using the changeset viewer.