diff --git a/README.md b/README.md index 404646d..ba82e22 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,20 @@ Please report bugs or request featured on [GitHub](https://github.com/quasel/pod Generally you can use the shortcode `[pods field='your_field']` anywhere ( every text/url/html field ) it's basically the same as with `[wpbb ...]` Things like`[pods field='your_field._img.thumbnail']` work fine see http://pods.io/docs/build/using-magic-tags/ for more options! - -Currently The Field Connections are intended to be used on "single templates" or in "post modules" -The Template Field Connection for Archive Pages is planned, meahnwhile you cna just use a pods shortcode `[pods name="your_pod" template="your_template"]` +Or to pull in a Template: `[pods name="your_pod" template="your_template"]` ## Beta - use in production at your own risk! #### Field connectors for photo and multiple-photo working: -- select dropdown only list's matching Fields -- don't set Restrict File Types to custom in Pods Admin (known issue, working on better filter) -- currently no option to choose image size i hope BB will use the same picker as for Media Gallery Fields (ID is in the array) +- Select dropdown only list's matching Fields (it lists all "Media" fields) +- Choose Size +- Set default image #### Field connectors for url, html, string: -- select dropdown populated with all existing fields for PODS - field_name ( Custom Post Type ) if two pods use the same field-name both are shown in the same line as an Template can be used for multiple "locations" +- select dropdown populated with all existing fields for PODS - field_name ( Custom Post Type ) - currently uses just plain pods()->display(); -- images fields are only output as url +- images fields are only output as url for magic tag style use advanced ... - fields with multiple relations (pick_field) still need some ideas / use cases best to go and use Templates for it! @@ -39,7 +37,6 @@ The Template Field Connection for Archive Pages is planned, meahnwhile you cna j - Help / Feedback Welcome - Thank You!!! Bernhard aka Quasel diff --git a/classes/class-pods-page-data.php b/classes/class-pods-page-data.php index f739f97..b66f9f8 100644 --- a/classes/class-pods-page-data.php +++ b/classes/class-pods-page-data.php @@ -86,6 +86,13 @@ static public function get_field_photo( $settings, $property ) { 'url' => pods( get_post_type(), get_the_ID() )->display( $field_url ) ); + if ( ! isset( $content->url ) && isset( $settings->default_img_src ) ) { + $content = array( + 'id' => $settings['default_img'], + 'url' => $settings['default_img_src'], + ); + } + return $content; } @@ -320,7 +327,7 @@ private function recurse_pod_fields( $pod_name, $field_options = array(), $prefi foreach ( $all_pod_fields as $field_name => $field ) { - if ( 'taxonomy' === $field['type'] ) { + if ( isset( $field['type'] ) && 'taxonomy' === $field['type'] ) { $linked_pod = $field_name; if ( ! isset( $pods_visited[ $linked_pod ] ) || ! in_array( $field_name, $pods_visited[ $linked_pod ] ) ) { $pods_visited[ $linked_pod ][] = $field_name; @@ -338,7 +345,7 @@ private function recurse_pod_fields( $pod_name, $field_options = array(), $prefi } if ( $field_options ) { - if ( $field_options['type'] === $field['type'] ) { + if ( isset($field_options['type']) && $field_options['type'] === $field['type'] ) { foreach ( $field_options['options'] as $_option => $option_value ) { if ( $option_value !== pods_v( $_option, $field['options'] ) ) { continue 2; // don't check further if one option it not matched diff --git a/includes/pods-page-data.php b/includes/pods-page-data.php index 5993dbf..2bdc01b 100644 --- a/includes/pods-page-data.php +++ b/includes/pods-page-data.php @@ -12,17 +12,14 @@ ); $form = array( - 'title' => 'TEST', 'field' => array( 'type' => 'select', 'label' => __( 'Field Name (CPT):', 'fl-theme-builder' ), 'options' => 'PodsPageData::pods_get_fields', 'help' => __( 'Fields filterd based on current "preview" settings', 'fl-theme-builder' ), 'description' => __( 'Fields based on Preview', 'fl-theme-builder' ), - 'placeholder' => __( 'Field Name (CPT)', 'fl-theme-builder' ), - 'toggle' => array(), - ), - 'test' => array(), + 'placeholder' => __( 'Field Name (CPT)', 'fl-theme-builder' ) + ) ); // $form = PodsPageData::pods_settings_form(); diff --git a/readme.txt b/readme.txt index ac10abc..a98fd8e 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://pods.io/friends-of-pods/ Tags: pods, beaver builder, beaver themer Requires at least: 4.0 Tested up to: 4.6 -Stable tag: 0.2-beta +Stable tag: 0.3.1-beta License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -28,6 +28,12 @@ To be done ;) == Changelog == += 0.3.1-beta - May 17, 2017 = + +* Bug fix for illegal string offset +* Improve Description + + = 0.3-beta - May 17, 2017 = * Added Support to Select Templates http://pods.io/tutorials/how-tos-sceencasts-series/using-pods-templates-part-1/ you cna use `[pods template='your_template']` or similar shortcode too