WordPress.org

Plugin Directory

Changeset 1658038


Ignore:
Timestamp:
05/15/17 20:59:30 (3 months ago)
Author:
aaronrutley
Message:

version 1.3.1

Location:
acf-theme-code/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • acf-theme-code/trunk/acf_theme_code.php

    r1657343 r1658038  
    44Plugin URI: http://www.hookturn.io 
    55Description: Generates theme code for ACF field groups to speed up development. 
    6 Version: 1.3.0 
     6Version: 1.3.1 
    77Author: Aaron Rutley, Ben Pearson 
    88Author URI: http://www.hookturn.io 
     
    1515 
    1616// Define the version number 
    17 define( 'ACFTC_VERSION', '1.3.0' ); 
     17define( 'ACFTC_VERSION', '1.3.1' ); 
    1818 
    1919// Check for dashboard or admin panel 
  • acf-theme-code/trunk/core/core.php

    r1657343 r1658038  
    160160        if ( self::$db_table == 'postmeta') { 
    161161 
    162             // Quick check for locations 
    163  
    164             // setup the location rules 
    165             $location_rules = []; 
     162            // Setup a counter for location rules 
     163            $location_rules_count = ''; 
    166164 
    167165            global $wpdb; 
     
    173171            $query_results = $wpdb->get_results( "SELECT * FROM " . $table . " WHERE post_id = " . $post->ID . " AND meta_key LIKE 'rule'" ); 
    174172 
    175             foreach ( $query_results as $query_result ) { 
    176  
    177                 // Unserialize location rule data 
    178                 $location_rule = unserialize( $query_result->meta_value ); 
    179  
    180                 // add the location to the array 
    181                 $location_rules[] = $location_rule; 
    182  
    183             } 
    184  
    185             // count the location rules 
    186             $location_rules_count = count( $location_rules ); 
     173            // count the results 
     174            $location_rules_count = count( $query_results ); 
    187175 
    188176            // if we have more than 1 location show the notice 
     
    197185        } elseif ( self::$db_table == 'posts') { 
    198186 
    199             // get an array of the locations 
    200             $field_group_location_array = $this->get_field_group_locations( $post ); 
    201  
    202187            // count them 
    203             $field_group_location_array_count = count( $field_group_location_array ); 
     188            $field_group_location_array_count = $this->get_field_group_locations( $post ); 
    204189 
    205190            // if we have more than 1 location show the notice 
     
    238223 
    239224        // define a locations array 
    240         $location_array = []; 
     225        $location_array = array(); 
    241226 
    242227        // get field group locations from field group post content 
     
    245230            $field_group_location_content = unserialize( $post->post_content ); 
    246231 
    247             foreach ( $field_group_location_content['location']  as $location_condition_group ) { 
    248  
    249  
    250                 foreach ( $location_condition_group as $location_condition ) { 
    251  
    252                     $location_array[] = $location_condition['param']; 
    253  
    254                 } 
    255  
    256             } 
    257  
    258             return $location_array; 
     232            // count the locations 
     233            $location_array_count = count( $field_group_location_content['location'] ); 
     234 
     235            // return the count 
     236            return $location_array_count; 
    259237 
    260238        } 
  • acf-theme-code/trunk/readme.txt

    r1657343 r1658038  
    44Requires at least: 4.7 
    55Tested up to: 4.8.0 
    6 Stable tag: 1.3.0 
     6Stable tag: 1.3.1 
    77License: GPL2+ 
    88 
     
    8282 
    8383== Changelog == 
     84 
     85= 1.3.1 = 
     86* Fix: Updates to array count functionality for PHP 5.4 
     87 
    8488= 1.3.0 = 
    8589* Core : Support for ACF Pro when bundled in a Theme 
Note: See TracChangeset for help on using the changeset viewer.