Plugin Directory

Changeset 3071590


Ignore:
Timestamp:
04/16/2024 12:33:23 PM (2 years ago)
Author:
wallkit
Message:

tagging version 3.3.4

Location:
wallkit
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wallkit/tags/3.3.4/admin/class-wallkit-wp-admin.php

    r3067043 r3071590  
    481481     */
    482482    private function get_content_intro_paragraph($content, $cut_paragraph_count = 1) {
     483        if($cut_paragraph_count < 0) {
     484            return force_balance_tags( apply_filters('wallkit_customize_post_locked_content', $content) );
     485        }
    483486
    484487        $parts = explode("</p>", $content);
     
    503506     */
    504507    private function get_content_body_paragraph($content, $cut_paragraph_count = 1) {
     508        if($cut_paragraph_count < 0) {
     509            return force_balance_tags( apply_filters('wallkit_customize_post_locked_content', '') );
     510        }
    505511
    506512        $parts = explode("</p>", $content);
     
    534540            ->get_option("wk_free_paragraph", 1);
    535541
    536         $source_content = $content;
     542        $source_content = $this->get_formatted_content($content);
    537543        $content = '<div class="wpwp-non-paywall">' . $this->get_content_intro_paragraph($source_content, $cut_paragraph_count) . '</div>';
    538544
     
    571577
    572578        return $result_content;
     579    }
     580
     581    /**
     582     * Formatting content before split on parts
     583     *
     584     * @since   3.3.4
     585     *
     586     * @param   string  $content    The text which has to be formatted.
     587     * @return  string
     588     */
     589    public function get_formatted_content($content) {
     590        $blocks = parse_blocks( $content );
     591        $output = '';
     592
     593        foreach ( $blocks as $block ) {
     594            $output .= render_block( $block );
     595        }
     596
     597        // Returning formatted content if it contains gutenberg blocks
     598        if( has_blocks( $content ) ) {
     599            return $output;
     600        }
     601
     602        //If content do not contains gutenberg blocks format it with wpautop function.
     603        return wpautop($content);
    573604    }
    574605
  • wallkit/tags/3.3.4/includes/class-wallkit-wp-loader.php

    r2394301 r3071590  
    9494    }
    9595
     96
     97    /**
     98     * Add immediately filter.
     99     *
     100     * @since   3.3.4
     101     *
     102     * @param   string               $hook             The name of the WordPress filter that is being registered.
     103     * @param   object               $component        A reference to the instance of the object on which the filter is defined.
     104     * @param   string               $callback         The name of the function definition on the $component.
     105     * @return  void
     106     */
     107    public function add_immediately_filter( $hook, $component, $callback ) {
     108        if($hook = $this->search_filter($hook, $component, $callback ) ) {
     109            add_filter( ...$hook );
     110        }
     111    }
     112
     113    /**
     114     * Remove registered filter.
     115     *
     116     * @since    3.3.4
     117     *
     118     * @param   string               $hook             The name of the WordPress filter that is being registered.
     119     * @param   object               $component        A reference to the instance of the object on which the filter is defined.
     120     * @param   string               $callback         The name of the function definition on the $component.
     121     * @return  void
     122     */
     123    public function remove_filter( $hook, $component, $callback ) {
     124        if($hook = $this->search_filter($hook, $component, $callback ) ) {
     125            remove_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority']);
     126        }
     127    }
     128
     129    /**
     130     * Search registered filter.
     131     *
     132     * @since    3.3.4
     133     *
     134     * @param    string               $hook             The name of the WordPress filter that is being registered.
     135     * @param    object               $component        A reference to the instance of the object on which the filter is defined.
     136     * @param    string               $callback         The name of the function definition on the $component.
     137     * @return bool|mixed
     138     *
     139     */
     140    public function search_filter( $hook, $component, $callback ) {
     141        foreach ($this->filters as $filter) {
     142            if($filter['hook'] === $hook
     143                && $filter['component'] === $component
     144                && $filter['callback'] === $callback) {
     145                return $filter;
     146            }
     147
     148        }
     149
     150        return false;
     151    }
     152
    96153    /**
    97154     * @param $page_title
  • wallkit/tags/3.3.4/readme.txt

    r3067043 r3071590  
    2828== Changelog ==
    2929
     30= 3.3.4 =
     31*Release Date - 08 April 2024*
     32
     33#### Updates including:
     34- Fixed paywall position with using classic or gutenberg editors.
     35
    3036= 3.3.3 =
    3137*Release Date - 08 April 2024*
  • wallkit/tags/3.3.4/wallkit-wp.php

    r3067043 r3071590  
    1010 * Plugin URI:        https://wallkit.net
    1111 * Description:       A Plug & Play paid-content system to manage subscribers, gather fees and drive additional content sales.
    12  * Version:           3.3.3
     12 * Version:           3.3.4
    1313 * Author:            Wallkit <dev@wallkit.net>
    1414 * Author URI:        https://wallkit.net/
     
    2727 * Rename this for your plugin and update it as you release new versions.
    2828 */
    29 define( 'WPWKP_VERSION', '3.3.3' );
     29define( 'WPWKP_VERSION', '3.3.4' );
    3030
    3131/**
  • wallkit/trunk/admin/class-wallkit-wp-admin.php

    r3067043 r3071590  
    481481     */
    482482    private function get_content_intro_paragraph($content, $cut_paragraph_count = 1) {
     483        if($cut_paragraph_count < 0) {
     484            return force_balance_tags( apply_filters('wallkit_customize_post_locked_content', $content) );
     485        }
    483486
    484487        $parts = explode("</p>", $content);
     
    503506     */
    504507    private function get_content_body_paragraph($content, $cut_paragraph_count = 1) {
     508        if($cut_paragraph_count < 0) {
     509            return force_balance_tags( apply_filters('wallkit_customize_post_locked_content', '') );
     510        }
    505511
    506512        $parts = explode("</p>", $content);
     
    534540            ->get_option("wk_free_paragraph", 1);
    535541
    536         $source_content = $content;
     542        $source_content = $this->get_formatted_content($content);
    537543        $content = '<div class="wpwp-non-paywall">' . $this->get_content_intro_paragraph($source_content, $cut_paragraph_count) . '</div>';
    538544
     
    571577
    572578        return $result_content;
     579    }
     580
     581    /**
     582     * Formatting content before split on parts
     583     *
     584     * @since   3.3.4
     585     *
     586     * @param   string  $content    The text which has to be formatted.
     587     * @return  string
     588     */
     589    public function get_formatted_content($content) {
     590        $blocks = parse_blocks( $content );
     591        $output = '';
     592
     593        foreach ( $blocks as $block ) {
     594            $output .= render_block( $block );
     595        }
     596
     597        // Returning formatted content if it contains gutenberg blocks
     598        if( has_blocks( $content ) ) {
     599            return $output;
     600        }
     601
     602        //If content do not contains gutenberg blocks format it with wpautop function.
     603        return wpautop($content);
    573604    }
    574605
  • wallkit/trunk/includes/class-wallkit-wp-loader.php

    r2394301 r3071590  
    9494    }
    9595
     96
     97    /**
     98     * Add immediately filter.
     99     *
     100     * @since   3.3.4
     101     *
     102     * @param   string               $hook             The name of the WordPress filter that is being registered.
     103     * @param   object               $component        A reference to the instance of the object on which the filter is defined.
     104     * @param   string               $callback         The name of the function definition on the $component.
     105     * @return  void
     106     */
     107    public function add_immediately_filter( $hook, $component, $callback ) {
     108        if($hook = $this->search_filter($hook, $component, $callback ) ) {
     109            add_filter( ...$hook );
     110        }
     111    }
     112
     113    /**
     114     * Remove registered filter.
     115     *
     116     * @since    3.3.4
     117     *
     118     * @param   string               $hook             The name of the WordPress filter that is being registered.
     119     * @param   object               $component        A reference to the instance of the object on which the filter is defined.
     120     * @param   string               $callback         The name of the function definition on the $component.
     121     * @return  void
     122     */
     123    public function remove_filter( $hook, $component, $callback ) {
     124        if($hook = $this->search_filter($hook, $component, $callback ) ) {
     125            remove_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority']);
     126        }
     127    }
     128
     129    /**
     130     * Search registered filter.
     131     *
     132     * @since    3.3.4
     133     *
     134     * @param    string               $hook             The name of the WordPress filter that is being registered.
     135     * @param    object               $component        A reference to the instance of the object on which the filter is defined.
     136     * @param    string               $callback         The name of the function definition on the $component.
     137     * @return bool|mixed
     138     *
     139     */
     140    public function search_filter( $hook, $component, $callback ) {
     141        foreach ($this->filters as $filter) {
     142            if($filter['hook'] === $hook
     143                && $filter['component'] === $component
     144                && $filter['callback'] === $callback) {
     145                return $filter;
     146            }
     147
     148        }
     149
     150        return false;
     151    }
     152
    96153    /**
    97154     * @param $page_title
  • wallkit/trunk/readme.txt

    r3067043 r3071590  
    2828== Changelog ==
    2929
     30= 3.3.4 =
     31*Release Date - 08 April 2024*
     32
     33#### Updates including:
     34- Fixed paywall position with using classic or gutenberg editors.
     35
    3036= 3.3.3 =
    3137*Release Date - 08 April 2024*
  • wallkit/trunk/wallkit-wp.php

    r3067043 r3071590  
    1010 * Plugin URI:        https://wallkit.net
    1111 * Description:       A Plug & Play paid-content system to manage subscribers, gather fees and drive additional content sales.
    12  * Version:           3.3.3
     12 * Version:           3.3.4
    1313 * Author:            Wallkit <dev@wallkit.net>
    1414 * Author URI:        https://wallkit.net/
     
    2727 * Rename this for your plugin and update it as you release new versions.
    2828 */
    29 define( 'WPWKP_VERSION', '3.3.3' );
     29define( 'WPWKP_VERSION', '3.3.4' );
    3030
    3131/**
Note: See TracChangeset for help on using the changeset viewer.