Skip to content

Commit

Permalink
Merge branch 'master' into version/1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zackkatz committed Jul 23, 2015
2 parents 9cd5170 + a5e90e6 commit 916d7a9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
11 changes: 11 additions & 0 deletions includes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,17 @@ function no_conflict_scripts() {

// Genesis theme framework
'genesis_admin_js',

// Avada
'jquery.biscuit',
'avada_upload',
'tipsy',
'jquery-ui-slider',
'smof',
'cookie',
'kd-multiple-featured-images',
'media-upload',
'jquery-ui-core',
);

$this->remove_conflicts( $wp_scripts, $wp_allowed_scripts, 'scripts' );
Expand Down
32 changes: 18 additions & 14 deletions includes/class-gvlogic-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ public function shortcode( $atts = array(), $content = NULL, $shortcode_tag = ''
$this->parse_atts();

// We need an "if"
if( empty( $this->if ) ) {
do_action( 'gravityview_log_debug', __METHOD__.' $atts if is empty.', $this->atts );
if( false === $this->if ) {
do_action( 'gravityview_log_error', __METHOD__.' $atts->if is empty.', $this->atts );
return null;
}

$setup = $this->setup_operation_and_comparison();

// We need an operation and comparison value
if( ! $setup ) {
do_action( 'gravityview_log_debug', __METHOD__.' No valid operators were passed.', $this->atts );
do_action( 'gravityview_log_error', __METHOD__.' No valid operators were passed.', $this->atts );
return null;
}

Expand Down Expand Up @@ -251,7 +251,11 @@ function get_output() {
* @param string $output HTML/text output
* @param GV_If_Shortcode This class
*/
return apply_filters('gravityview/gvlogic/output', $output, $this );
$output = apply_filters('gravityview/gvlogic/output', $output, $this );

do_action( 'gravityview_log_debug', __METHOD__ .' Output: ', $output );

return $output;
}

/**
Expand All @@ -278,23 +282,23 @@ function set_content_and_else_content() {
function parse_atts() {

$supported = array(
'if' => '',
'else' => '',
'if' => false,
'else' => false,
);

$supported_args = $supported + $this->get_operators( true );

// Whittle down the attributes to only valid pairs
$this->atts = shortcode_atts( $supported_args, $this->passed_atts, $this->shortcode );

// remove empties
$this->atts = array_filter( $this->atts );
// Only keep the passed attributes after making sure that they're valid pairs
$this->atts = function_exists( 'array_intersect_key' ) ? array_intersect_key( $this->passed_atts, $this->atts ) : $this->atts;

if( isset( $this->atts['if'] ) ) {
$this->if = $this->atts['if'];
unset( $this->atts['if'] );
} else {
$this->if = false;
}
// Strip whitespace if it's not default false
$this->if = is_string( $this->atts['if'] ) ? trim( $this->atts['if'] ) : false;

// Make sure the "if" isn't processed in self::setup_operation_and_comparison()
unset( $this->atts['if'] );
}
}

Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Beautifully display your Gravity Forms entries. Learn more on [GravityView.co](h

== Changelog ==

= 1.11.2 =
* Fixed: Bug when comparing empty values with `[gvlogic]`
* Fixed: Remove extra whitespace when comparing values using `[gvlogic]`
* Modified: Allow Avada theme Javascript in "No-Conflict Mode"

= 1.11.1 on July 20 =
* Added: New filter hook to customise the cancel Edit Entry link: `gravityview/edit_entry/cancel_link`
* Fixed: Extension translations
Expand Down

0 comments on commit 916d7a9

Please sign in to comment.