Advanced Custom Fields - Version 3.5.2

Version Description

  • Security update
Download this release

Release Info

Developer elliotcondon
Plugin Icon 128x128 Advanced Custom Fields
Version 3.5.2
Comparing to
See all releases

Code changes from version 3.5.1 to 3.5.2

acf.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://www.advancedcustomfields.com/
5
  Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress. Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker, repeater, flexible content, gallery and more!
6
- Version: 3.5.1
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
@@ -48,7 +48,7 @@ class Acf
48
  // vars
49
  $this->path = plugin_dir_path(__FILE__);
50
  $this->dir = plugins_url('',__FILE__);
51
- $this->version = '3.5.1';
52
  $this->upgrade_version = '3.4.1'; // this is the latest version which requires an upgrade
53
  $this->cache = array(); // basic array cache to hold data throughout the page load
54
 
@@ -640,6 +640,11 @@ class Acf
640
 
641
  function acf_load_field_defaults( $field )
642
  {
 
 
 
 
 
643
  $defaults = array(
644
  'key' => '',
645
  'label' => '',
@@ -873,11 +878,16 @@ class Acf
873
 
874
  function get_value($post_id, $field)
875
  {
876
- if(!isset($this->fields[$field['type']]) || !is_object($this->fields[$field['type']]))
877
  {
878
- return false;
879
  }
880
 
 
 
 
 
 
881
  return $this->fields[$field['type']]->get_value($post_id, $field);
882
  }
883
 
@@ -893,9 +903,14 @@ class Acf
893
 
894
  function get_value_for_api($post_id, $field)
895
  {
 
 
 
 
 
896
  if( !isset($field['type'], $this->fields[ $field['type'] ]) )
897
  {
898
- return '';
899
  }
900
 
901
  return $this->fields[$field['type']]->get_value_for_api($post_id, $field);
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://www.advancedcustomfields.com/
5
  Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress. Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker, repeater, flexible content, gallery and more!
6
+ Version: 3.5.2
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
48
  // vars
49
  $this->path = plugin_dir_path(__FILE__);
50
  $this->dir = plugins_url('',__FILE__);
51
+ $this->version = '3.5.2';
52
  $this->upgrade_version = '3.4.1'; // this is the latest version which requires an upgrade
53
  $this->cache = array(); // basic array cache to hold data throughout the page load
54
 
640
 
641
  function acf_load_field_defaults( $field )
642
  {
643
+ if( !is_array($field) )
644
+ {
645
+ return $field;
646
+ }
647
+
648
  $defaults = array(
649
  'key' => '',
650
  'label' => '',
878
 
879
  function get_value($post_id, $field)
880
  {
881
+ if( empty($this->fields) )
882
  {
883
+ $this->setup_fields();
884
  }
885
 
886
+ if( !isset($field['type'], $this->fields[ $field['type'] ]) )
887
+ {
888
+ return false;
889
+ }
890
+
891
  return $this->fields[$field['type']]->get_value($post_id, $field);
892
  }
893
 
903
 
904
  function get_value_for_api($post_id, $field)
905
  {
906
+ if( empty($this->fields) )
907
+ {
908
+ $this->setup_fields();
909
+ }
910
+
911
  if( !isset($field['type'], $this->fields[ $field['type'] ]) )
912
  {
913
+ return false;
914
  }
915
 
916
  return $this->fields[$field['type']]->get_value_for_api($post_id, $field);
core/actions/export.php CHANGED
@@ -10,14 +10,10 @@
10
 
11
  // vars
12
  $defaults = array(
13
- 'acf_abspath' => '../../../../../',
14
  'acf_posts' => array()
15
  );
16
  $my_options = array_merge( $defaults, $_POST );
17
 
18
- require_once( $my_options['acf_abspath'] . 'wp-load.php');
19
- require_once( $my_options['acf_abspath'] . 'wp-admin/admin.php');
20
-
21
 
22
  // check for posts
23
  if( !$my_options['acf_posts'] )
@@ -184,7 +180,7 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . "\" ?>\n";
184
  <?php wxr_authors_list(); ?>
185
  <?php if ( $my_options['acf_posts'] ) {
186
 
187
- global $wp_query;
188
  $wp_query->in_the_loop = true; // Fake being in the loop.
189
 
190
  $where = 'WHERE ID IN (' . join( ',', $my_options['acf_posts'] ) . ')';
10
 
11
  // vars
12
  $defaults = array(
 
13
  'acf_posts' => array()
14
  );
15
  $my_options = array_merge( $defaults, $_POST );
16
 
 
 
 
17
 
18
  // check for posts
19
  if( !$my_options['acf_posts'] )
180
  <?php wxr_authors_list(); ?>
181
  <?php if ( $my_options['acf_posts'] ) {
182
 
183
+ global $wp_query, $wpdb;
184
  $wp_query->in_the_loop = true; // Fake being in the loop.
185
 
186
  $where = 'WHERE ID IN (' . join( ',', $my_options['acf_posts'] ) . ')';
core/controllers/settings.php CHANGED
@@ -48,6 +48,8 @@ class acf_settings
48
  {
49
  $page = add_submenu_page('edit.php?post_type=acf', __('Settings','acf'), __('Settings','acf'), 'manage_options','acf-settings',array($this,'html'));
50
 
 
 
51
  add_action('admin_print_scripts-' . $page, array($this, 'admin_print_scripts'));
52
  add_action('admin_print_styles-' . $page, array($this, 'admin_print_styles'));
53
 
@@ -56,6 +58,31 @@ class acf_settings
56
  }
57
 
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /*
60
  * admin_print_scripts
61
  *
@@ -329,8 +356,8 @@ class acf_settings
329
  </div>
330
  </th>
331
  <td>
332
- <form class="acf-export-form" method="post" action="<?php echo $this->parent->dir; ?>/core/actions/export.php">
333
- <input type="hidden" name="acf_abspath" value="<?php echo ABSPATH; ?>" />
334
  <?php
335
 
336
  $this->parent->create_field(array(
48
  {
49
  $page = add_submenu_page('edit.php?post_type=acf', __('Settings','acf'), __('Settings','acf'), 'manage_options','acf-settings',array($this,'html'));
50
 
51
+ add_action('load-' . $page, array($this,'load'));
52
+
53
  add_action('admin_print_scripts-' . $page, array($this, 'admin_print_scripts'));
54
  add_action('admin_print_styles-' . $page, array($this, 'admin_print_styles'));
55
 
58
  }
59
 
60
 
61
+ /*
62
+ * load
63
+ *
64
+ * @description:
65
+ * @since 3.5.2
66
+ * @created: 16/11/12
67
+ */
68
+
69
+ function load()
70
+ {
71
+ // vars
72
+ $defaults = array(
73
+ 'action' => ''
74
+ );
75
+ $options = array_merge($defaults, $_POST);
76
+
77
+
78
+ if( $options['action'] == "export_xml" )
79
+ {
80
+ include_once($this->parent->path . 'core/actions/export.php');
81
+ die;
82
+ }
83
+ }
84
+
85
+
86
  /*
87
  * admin_print_scripts
88
  *
356
  </div>
357
  </th>
358
  <td>
359
+ <form class="acf-export-form" method="post">
360
+ <input type="hidden" name="action" value="export_xml" />
361
  <?php
362
 
363
  $this->parent->create_field(array(
readme.txt CHANGED
@@ -87,6 +87,9 @@ http://support.advancedcustomfields.com/
87
 
88
  == Changelog ==
89
 
 
 
 
90
  = 3.5.1 =
91
  * [Added] Add Conditional logic for fields (toggle fields are select, checkbox, radio and true / false)
92
  * [Added] More hooks + filters - acf_options_page_title, acf_load_field, acf_update_value - http://support.advancedcustomfields.com/discussion/3454/more-hooks-filters-ability-for-inheritance
87
 
88
  == Changelog ==
89
 
90
+ = 3.5.2 =
91
+ * Security update
92
+
93
  = 3.5.1 =
94
  * [Added] Add Conditional logic for fields (toggle fields are select, checkbox, radio and true / false)
95
  * [Added] More hooks + filters - acf_options_page_title, acf_load_field, acf_update_value - http://support.advancedcustomfields.com/discussion/3454/more-hooks-filters-ability-for-inheritance