Skip to content

Commit

Permalink
Merge pull request #3 from quasel/dev
Browse files Browse the repository at this point in the history
0.3.1-bugFix
  • Loading branch information
quasel authored May 18, 2017
2 parents eb63b9c + 684e8eb commit 2353d8c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!


Expand All @@ -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
11 changes: 9 additions & 2 deletions classes/class-pods-page-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
7 changes: 2 additions & 5 deletions includes/pods-page-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 2353d8c

Please sign in to comment.