User registration & user profile – Profile Builder - Version 3.0.3

Version Description

  • Fixed an error introduced in the last update regarding content restriction and Posts Page
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 User registration & user profile – Profile Builder
Version 3.0.3
Comparing to
See all releases

Code changes from version 3.0.2 to 3.0.3

features/content-restriction/content-restriction-filtering.php CHANGED
@@ -281,4 +281,45 @@ if( function_exists( 'wc_get_page_id' ) ) {
281
  echo apply_filters( 'the_content', $product_content );
282
  add_filter('the_content', 'wpautop');
283
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  }
281
  echo apply_filters( 'the_content', $product_content );
282
  add_filter('the_content', 'wpautop');
283
  }
284
+ }
285
+
286
+ /* if the Static Posts Page has a restriction on it hijack the query */
287
+ add_action( 'template_redirect', 'wppb_content_restriction_posts_page_handle_query', 1 );
288
+ function wppb_content_restriction_posts_page_handle_query(){
289
+ if( is_home() ){
290
+ $posts_page_id = get_option( 'page_for_posts' );
291
+ if( $posts_page_id ) {
292
+ if (wppb_check_content_restriction_on_post_id($posts_page_id)) {
293
+ wppb_content_restriction_force_page($posts_page_id);
294
+ }
295
+ }
296
+ }
297
+ }
298
+
299
+
300
+ /* if the Static Posts Page has a restriction on it hijack the template back to the Page Template */
301
+ add_filter( 'template_include', 'wppb_content_restriction_posts_page_template', 100 );
302
+ function wppb_content_restriction_posts_page_template( $template ){
303
+ if( is_home() ){
304
+ $posts_page_id = get_option( 'page_for_posts' );
305
+ if( $posts_page_id ) {
306
+ if (wppb_check_content_restriction_on_post_id($posts_page_id)) {
307
+ $template = get_page_template();
308
+ }
309
+ }
310
+ }
311
+ return $template;
312
+ }
313
+
314
+ /* Change the query to a single post */
315
+ function wppb_content_restriction_force_page( $posts_page_id ){
316
+ if( $posts_page_id ) {
317
+ global $wp_query, $post;
318
+ $post = get_post($posts_page_id);
319
+ $wp_query->posts = array($post);
320
+ $wp_query->post_count = 1;
321
+ $wp_query->is_singular = true;
322
+ $wp_query->is_singule = true;
323
+ $wp_query->is_archive = false;
324
+ }
325
  }
features/content-restriction/content-restriction-functions.php CHANGED
@@ -304,43 +304,3 @@ function wppb_content_restriction_shortcode( $atts, $content = null ) {
304
  }
305
  add_shortcode( 'wppb-restrict', 'wppb_content_restriction_shortcode' );
306
 
307
- /* if the Static Posts Page has a restriction on it hijack the query */
308
- add_action( 'template_redirect', 'wppb_content_restriction_posts_page_handle_query', 1 );
309
- function wppb_content_restriction_posts_page_handle_query(){
310
- if( is_home() ){
311
- $posts_page_id = get_option( 'page_for_posts' );
312
- if( $posts_page_id ) {
313
- if (wppb_check_content_restriction_on_post_id($posts_page_id)) {
314
- wppb_content_restriction_force_page($posts_page_id);
315
- }
316
- }
317
- }
318
- }
319
-
320
-
321
- /* if the Static Posts Page has a restriction on it hijack the template back to the Page Template */
322
- add_filter( 'template_include', 'wppb_content_restriction_posts_page_template', 100 );
323
- function wppb_content_restriction_posts_page_template( $template ){
324
- if( is_home() ){
325
- $posts_page_id = get_option( 'page_for_posts' );
326
- if( $posts_page_id ) {
327
- if (wppb_check_content_restriction_on_post_id($posts_page_id)) {
328
- $template = get_page_template();
329
- }
330
- }
331
- }
332
- return $template;
333
- }
334
-
335
- /* Change the query to a single post */
336
- function wppb_content_restriction_force_page( $posts_page_id ){
337
- if( $posts_page_id ) {
338
- global $wp_query, $post;
339
- $post = get_post($posts_page_id);
340
- $wp_query->posts = array($post);
341
- $wp_query->post_count = 1;
342
- $wp_query->is_singular = true;
343
- $wp_query->is_singule = true;
344
- $wp_query->is_archive = false;
345
- }
346
- }
304
  }
305
  add_shortcode( 'wppb-restrict', 'wppb_content_restriction_shortcode' );
306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Profile Builder
4
  Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can choose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
- Version: 3.0.2
7
  Author: Cozmoslabs
8
  Author URI: https://www.cozmoslabs.com/
9
  Text Domain: profile-builder
@@ -75,7 +75,7 @@ function wppb_free_plugin_init() {
75
  *
76
  *
77
  */
78
- define('PROFILE_BUILDER_VERSION', '3.0.2' );
79
  define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
80
  define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
81
  define('WPPB_PLUGIN_BASENAME', plugin_basename(__FILE__));
3
  Plugin Name: Profile Builder
4
  Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
5
  Description: Login, registration and edit profile shortcodes for the front-end. Also you can choose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6
+ Version: 3.0.3
7
  Author: Cozmoslabs
8
  Author URI: https://www.cozmoslabs.com/
9
  Text Domain: profile-builder
75
  *
76
  *
77
  */
78
+ define('PROFILE_BUILDER_VERSION', '3.0.3' );
79
  define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
80
  define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
81
  define('WPPB_PLUGIN_BASENAME', plugin_basename(__FILE__));
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.cozmoslabs.com/wordpress-profile-builder/
4
  Tags: user registration, user profile, user registration form, user fields, extra user fields, edit profile, user custom fields, front-end login, front-end edit profile, front-end user registration, email confirmation, login form, content restriction, restrict content, profile
5
  Requires at least: 3.1
6
  Tested up to: 5.2.2
7
- Stable tag: 3.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -169,6 +169,9 @@ This plugin adds/removes user fields in the front-end. Both default and extra pr
169
  12. Role Editor
170
 
171
  == Changelog ==
 
 
 
172
  = 3.0.2 =
173
  * Now the Static Posts Page can be restricted as expected
174
  * Added support for restricting Elementor Single Page templates.
4
  Tags: user registration, user profile, user registration form, user fields, extra user fields, edit profile, user custom fields, front-end login, front-end edit profile, front-end user registration, email confirmation, login form, content restriction, restrict content, profile
5
  Requires at least: 3.1
6
  Tested up to: 5.2.2
7
+ Stable tag: 3.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
169
  12. Role Editor
170
 
171
  == Changelog ==
172
+ = 3.0.3 =
173
+ * Fixed an error introduced in the last update regarding content restriction and Posts Page
174
+
175
  = 3.0.2 =
176
  * Now the Static Posts Page can be restricted as expected
177
  * Added support for restricting Elementor Single Page templates.