Skip to content

Commit

Permalink
Merge pull request #114 from pods-framework/release/1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Feb 1, 2021
2 parents dbf995f + 641c41a commit 3c3ace5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
19 changes: 10 additions & 9 deletions classes/class-pods-beaver-page-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static function get_current_pod_info() {
*/
public static function get_pod( $settings = array() ) {

$item_id = 0;
$item_id = null;
$pod_name = null;

if ( is_array( $settings ) && ! empty( $settings['pod'] ) ) {
Expand Down Expand Up @@ -172,25 +172,26 @@ public static function get_pod( $settings = array() ) {
if ( 'user' === $pod_name && isset( $settings->type )) {
switch ( $settings->type ) {
case 'author':
if ( ! is_archive() && post_type_supports( get_post_type(), 'author' ) ) {
$item_id = get_the_author_meta( 'ID' );
if ( ( ! is_archive() || self::$pods_beaver_loop || is_author() ) && post_type_supports( get_post_type(), 'author' ) ) {
$item_id = (int) get_the_author_meta( 'ID' );
}
break;
case 'modified':
if ( ! is_archive() && post_type_supports( get_post_type(), 'author' ) ) {
$item_id = get_post_meta( get_post()->ID, '_edit_last', true );
if ( ( ! is_archive() || self::$pods_beaver_loop || is_author() ) && post_type_supports( get_post_type(), 'author' ) ) {
$item_id = (int) get_post_meta( get_post()->ID, '_edit_last', true );
}
break;
case 'logged_in':
case '': // For backwards compatibility
if ( is_user_logged_in() ) {
$item_id = get_current_user_id();
} else {
// User is not logged in, cannot return data
return false;
};
}
break;
}
if ( $item_id < 1 ) {
// No user found - return early to avoid getting wrong $pod!
return false;
}
}
} else {
$info = self::get_current_pod_info();
Expand Down
4 changes: 2 additions & 2 deletions pods-beaver-themer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pods Beaver Themer Add-On
* Plugin URI: http://pods.io/
* Description: Integration with Beaver Builder Themer (https://www.wpbeaverbuilder.com). Provides a UI for mapping Field Connections with Pods
* Version: 1.3.5
* Version: 1.3.6
* Author: Quasel, Pods Framework Team
* Author URI: http://pods.io/about/
* Text Domain: pods-beaver-builder-themer-add-on
Expand All @@ -30,7 +30,7 @@
* @package Pods\Beaver Themer
*/

define( 'PODS_BEAVER_VERSION', '1.3.5' );
define( 'PODS_BEAVER_VERSION', '1.3.6' );
define( 'PODS_BEAVER_FILE', __FILE__ );
define( 'PODS_BEAVER_DIR', plugin_dir_path( PODS_BEAVER_FILE ) );
define( 'PODS_BEAVER_URL', plugin_dir_url( PODS_BEAVER_FILE ) );
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: pods, beaver builder, beaver themer
Requires at least: 4.4
Tested up to: 5.6
Requires PHP: 5.4
Stable tag: 1.3.5
Stable tag: 1.3.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -72,6 +72,11 @@ You can use [GitHub Updater](https://github.com/afragen/github-updater). A simpl

== Changelog ==

= 1.3.6 - February 1st, 2021 =

* Fixed: Prevent the wrong pod data from unintentionally loading for user-related queries when user ID can not be determined.


= 1.3.5 - January 8th, 2021 =
* Required: This add-on now requires Pods 2.7.26+ in order to function fully with the latest fixes.
* Fixed: Properly hook into the Beaver Themer loop functionality to tell the Pods shortcode to reference the current post in the loop. #112 (@sc0ttkclark)
Expand Down

0 comments on commit 3c3ace5

Please sign in to comment.