Commit 394836f2 authored by Simon's avatar Simon

release 1.33.2

parent 9e6f3abc
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
## Production ## Production
- build CSS & JS assets - `C:\web\dev.biuro\ npm run build` - build CSS & JS assets - `C:\web\dev.biuro\ npm run build`
- build new image `docker build -t biuro/web:1.33.1 .` (update version number) - build new image `docker build -t biuro/web:1.33.2 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs` - login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.33.1` - push image to docker repository - `docker push biuro/web:1.33.2`
## Production ## Production
- update biuro/web image version in .env file (staging or www) - update biuro/web image version in .env file (staging or www)
......
...@@ -567,6 +567,7 @@ class Pods implements Iterator { ...@@ -567,6 +567,7 @@ class Pods implements Iterator {
'display_process_individually' => false, 'display_process_individually' => false,
'get_meta' => false, 'get_meta' => false,
'output' => null, 'output' => null,
'pods_callback' => 'pods',
'deprecated' => false, 'deprecated' => false,
'keyed' => false, 'keyed' => false,
// extra data to send to field handlers. // extra data to send to field handlers.
...@@ -619,6 +620,10 @@ class Pods implements Iterator { ...@@ -619,6 +620,10 @@ class Pods implements Iterator {
$params->output .= 's'; $params->output .= 's';
} }
if ( empty( $params->pods_callback ) || ! is_callable( $params->pods_callback ) ) {
$params->pods_callback = 'pods';
}
// Support old $orderby variable. // Support old $orderby variable.
if ( null !== $params->single && is_string( $params->single ) && empty( $params->orderby ) ) { if ( null !== $params->single && is_string( $params->single ) && empty( $params->orderby ) ) {
if ( ! class_exists( 'Deprecated_Pod' ) || Deprecated_Pod::$deprecated_notice ) { if ( ! class_exists( 'Deprecated_Pod' ) || Deprecated_Pod::$deprecated_notice ) {
...@@ -786,6 +791,19 @@ class Pods implements Iterator { ...@@ -786,6 +791,19 @@ class Pods implements Iterator {
$params->output = 'arrays'; $params->output = 'arrays';
} }
$is_tableless_field_and_not_simple = (
! $is_traversal
&& $field_data
&& ! $field_data instanceof Object_Field
&& $is_tableless_field
&& ! $field_data->is_simple_relationship()
);
// If a relationship is returned from the table as an ID but the parameter is not traversal, we need to run traversal logic.
if ( $is_tableless_field_and_not_simple && isset( $this->data->row[ $params->name ] ) && ! is_array( $this->data->row[ $params->name ] ) ) {
unset( $this->data->row[ $params->name ] );
}
// Enforce output type for tableless fields in forms. // Enforce output type for tableless fields in forms.
if ( empty( $value ) && $is_tableless_field ) { if ( empty( $value ) && $is_tableless_field ) {
$params->raw = true; $params->raw = true;
...@@ -811,10 +829,10 @@ class Pods implements Iterator { ...@@ -811,10 +829,10 @@ class Pods implements Iterator {
} }
if ( if (
! $override_object_field && ! $override_object_field
empty( $value ) && && empty( $value )
isset( $this->data->row[ $params->name ] ) && && isset( $this->data->row[ $params->name ] )
( ! $is_tableless_field || 'arrays' === $params->output ) && ( ! $is_tableless_field || 'arrays' === $params->output )
) { ) {
if ( empty( $field_data ) || in_array( $field_type, [ if ( empty( $field_data ) || in_array( $field_type, [
'boolean', 'boolean',
...@@ -1186,10 +1204,11 @@ class Pods implements Iterator { ...@@ -1186,10 +1204,11 @@ class Pods implements Iterator {
$is_field_output_full = true; $is_field_output_full = true;
} }
/** @var Pods $related_obj */
if ( 'pod' === $object_type ) { if ( 'pod' === $object_type ) {
$related_obj = pods( $object, null, false ); $related_obj = call_user_func( $params->pods_callback, $object, null, false );
} elseif ( ! empty( $table['pod'] ) ) { } elseif ( ! empty( $table['pod'] ) ) {
$related_obj = pods( $table['pod']['name'], null, false ); $related_obj = call_user_func( $params->pods_callback, $table['pod']['name'], null, false );
} }
if ( $table && ( $related_obj || ! empty( $table['table'] ) ) ) { if ( $table && ( $related_obj || ! empty( $table['table'] ) ) ) {
...@@ -1314,10 +1333,11 @@ class Pods implements Iterator { ...@@ -1314,10 +1333,11 @@ class Pods implements Iterator {
$item = (object) $item; $item = (object) $item;
}//end if }//end if
} elseif ( 'pods' === $params->output ) { } elseif ( 'pods' === $params->output ) {
/** @var Pods $item */
if ( in_array( $object_type, array( 'user', 'media' ), true ) ) { if ( in_array( $object_type, array( 'user', 'media' ), true ) ) {
$item = pods( $object_type, (int) $item_id ); $item = call_user_func( $params->pods_callback, $object_type, (int) $item_id );
} else { } else {
$item = pods( $object, (int) $item_id ); $item = call_user_func( $params->pods_callback, $object, (int) $item_id );
} }
if ( ! $item || ! $item->valid() ) { if ( ! $item || ! $item->valid() ) {
...@@ -2473,11 +2493,19 @@ class Pods implements Iterator { ...@@ -2473,11 +2493,19 @@ class Pods implements Iterator {
* *
* @see PodsData::total_found * @see PodsData::total_found
* *
* @params null|array $params The list of Pods::find() parameters to use, otherwise use current dataset to calculate total found.
*
* @return int Number of rows returned by find(), regardless of the 'limit' parameter * @return int Number of rows returned by find(), regardless of the 'limit' parameter
* @since 2.0.0 * @since 2.0.0
* @link https://docs.pods.io/code/pods/total-found/ * @link https://docs.pods.io/code/pods/total-found/
*/ */
public function total_found() { public function total_found( $params = null ) {
// Support find() shorthand to get total_found() for a specific dataset.
if ( is_array( $params ) ) {
$this->find( $params );
return $this->total_found();
}
/** /**
* Runs directly before the value of total_found() is determined and returned. * Runs directly before the value of total_found() is determined and returned.
......
...@@ -227,7 +227,7 @@ class PodsAPI { ...@@ -227,7 +227,7 @@ class PodsAPI {
/** /**
* Save the meta for a meta type. * Save the meta for a meta type.
* *
* @since TBD * @since 2.8.11
* *
* @param string $meta_type The meta type. * @param string $meta_type The meta type.
* @param int $id The object ID. * @param int $id The object ID.
...@@ -2949,6 +2949,7 @@ class PodsAPI { ...@@ -2949,6 +2949,7 @@ class PodsAPI {
$params = (object) $params; $params = (object) $params;
/** @var false|array|Field $field */
$field = false; $field = false;
if ( isset( $params->field ) && $params->field instanceof Field ) { if ( isset( $params->field ) && $params->field instanceof Field ) {
...@@ -3196,6 +3197,11 @@ class PodsAPI { ...@@ -3196,6 +3197,11 @@ class PodsAPI {
$old_options = $field; $old_options = $field;
$old_sister_id = pods_v( 'sister_id', $old_options, 0 ); $old_sister_id = pods_v( 'sister_id', $old_options, 0 );
// Maybe clone the field object if we need to.
if ( $old_options instanceof Field ) {
$old_options = clone $old_options;
}
// When renaming a field, use the old ID for reference if empty. // When renaming a field, use the old ID for reference if empty.
if ( ( 'old_name' === $lookup_type || $params->overwrite ) && empty( $params->id ) ) { if ( ( 'old_name' === $lookup_type || $params->overwrite ) && empty( $params->id ) ) {
$params->id = $old_id; $params->id = $old_id;
...@@ -3243,7 +3249,7 @@ class PodsAPI { ...@@ -3243,7 +3249,7 @@ class PodsAPI {
} }
if ( false !== $this->field_exists( $params, false ) ) { if ( false !== $this->field_exists( $params, false ) ) {
return pods_error( sprintf( __( 'Field %1$s already exists, you cannot rename %2$s to that', 'pods' ), $field['name'], $old_name ), $this ); return pods_error( sprintf( __( 'Field %1$s already exists, you cannot rename %2$s to that on the %3$s pod', 'pods' ), $field['name'], $old_name, $pod['name'] ), $this );
} }
} }
...@@ -3265,11 +3271,11 @@ class PodsAPI { ...@@ -3265,11 +3271,11 @@ class PodsAPI {
* *
* @param string|false $field_definition The SQL definition to use for the field's table column. * @param string|false $field_definition The SQL definition to use for the field's table column.
* @param string $type The field type. * @param string $type The field type.
* @param array $field The field data. * @param array $old_options The field data.
* @param bool $simple Whether the field is a simple tableless field. * @param bool $simple Whether the field is a simple tableless field.
* @param Pods\Whatsit\Field $field_obj The field object. * @param Pods\Whatsit\Field $field_obj The field object.
*/ */
$field_definition = apply_filters( 'pods_api_save_field_old_definition', $field_definition, $old_type, $field, $old_simple, $field_obj ); $field_definition = apply_filters( 'pods_api_save_field_old_definition', $field_definition, $old_type, $old_options, $old_simple, $field_obj );
if ( ! empty( $field_definition ) ) { if ( ! empty( $field_definition ) ) {
$old_definition = "`{$old_name}` " . $field_definition; $old_definition = "`{$old_name}` " . $field_definition;
...@@ -3629,6 +3635,12 @@ class PodsAPI { ...@@ -3629,6 +3635,12 @@ class PodsAPI {
$field['id'] = $params->id; $field['id'] = $params->id;
if ( $field instanceof Field ) {
$field_obj = $field;
} elseif ( $field_obj instanceof Field && is_array( $field ) ) {
$field_obj->set_args( $field );
}
$simple = ( 'pick' === $field['type'] && in_array( pods_v( 'pick_object', $field ), $simple_tableless_objects, true ) ); $simple = ( 'pick' === $field['type'] && in_array( pods_v( 'pick_object', $field ), $simple_tableless_objects, true ) );
$definition = false; $definition = false;
...@@ -3693,6 +3705,35 @@ class PodsAPI { ...@@ -3693,6 +3705,35 @@ class PodsAPI {
} }
} }
/**
* Allow filtering the definition mode to use for the field definition handling.
*
* @since 2.8.14
*
* @param string $definition_mode The definition mode used for the table field.
* @param Pods\Whatsit\Pod $pod The pod object.
* @param string $type The field type.
* @param array $field The field data.
* @param array $extra_info {
* Extra information about the field.
*
* @type bool $simple Whether the field is a simple tableless field.
* @type string $definition The field definition.
* @type null|string $old_name The old field name (if preexisting).
* @type null|string $old_definition The old field definition (if preexisting).
* @type null|array $old_options The old field options (if preexisting).
* @type Pods\Whatsit\Field $field_obj The field object.
* }
*/
$definition_mode = apply_filters( 'pods_api_save_field_table_definition_mode', $definition_mode, $pod, $field['type'], $field, [
'simple' => $simple,
'definition' => $definition,
'old_name' => $old_name,
'old_definition' => $old_definition,
'old_options' => $old_options,
'field_obj' => $field_obj,
] );
if ( 'bypass' !== $definition_mode ) { if ( 'bypass' !== $definition_mode ) {
/** /**
* Allow hooking into before the table has been altered for any custom functionality needed. * Allow hooking into before the table has been altered for any custom functionality needed.
...@@ -9075,7 +9116,7 @@ class PodsAPI { ...@@ -9075,7 +9116,7 @@ class PodsAPI {
if ( ! is_wp_error( $related ) ) { if ( ! is_wp_error( $related ) ) {
$related_ids = $related; $related_ids = $related;
} }
} elseif ( ! $params->force_meta && ! pods_tableless() && pods_podsrel_enabled() ) { } elseif ( ! $params->force_meta && ! pods_tableless() && pods_podsrel_enabled( $params->field, 'lookup' ) ) {
$ids = implode( ', ', $params->ids ); $ids = implode( ', ', $params->ids );
$params->field_id = (int) $params->field_id; $params->field_id = (int) $params->field_id;
......
...@@ -49,6 +49,11 @@ class PodsData { ...@@ -49,6 +49,11 @@ class PodsData {
*/ */
public static $display_errors = true; public static $display_errors = true;
/**
* @var bool
*/
public $fetch_full = true;
/** /**
* @var PodsAPI * @var PodsAPI
*/ */
...@@ -1471,6 +1476,39 @@ class PodsData { ...@@ -1471,6 +1476,39 @@ class PodsData {
$joins = array(); $joins = array();
$pre_traverse_args = [
'find' => $find,
'replace' => $replace,
'traverse' => $traverse,
'params' => $params,
];
/**
* Allow filtering the pre-traverse arguments that will be used to build the query.
*
* @since 2.8.14
*
* @param array $pre_traverse_args The pre-traverse arguments.
* @param PodsData $pods_data The PodsData object.
*/
$pre_traverse_args = (array) apply_filters( 'pods_data_build_pre_traverse_args', $pre_traverse_args, $this );
if ( isset( $pre_traverse_args['find'] ) ) {
$find = $pre_traverse_args['find'];
}
if ( isset( $pre_traverse_args['replace'] ) ) {
$replace = $pre_traverse_args['replace'];
}
if ( isset( $pre_traverse_args['traverse'] ) ) {
$traverse = $pre_traverse_args['traverse'];
}
if ( isset( $pre_traverse_args['params'] ) ) {
$params = $pre_traverse_args['params'];
}
if ( ! empty( $find ) ) { if ( ! empty( $find ) ) {
// See: "#3294 OrderBy Failing on PHP7" Non-zero array keys. // See: "#3294 OrderBy Failing on PHP7" Non-zero array keys.
// here in PHP 7 cause odd behavior so just strip the keys. // here in PHP 7 cause odd behavior so just strip the keys.
...@@ -1992,7 +2030,7 @@ class PodsData { ...@@ -1992,7 +2030,7 @@ class PodsData {
* @param bool $fetch_full Whether to fetch the full row. * @param bool $fetch_full Whether to fetch the full row.
* @param PodsData $pods_data The PodsData object. * @param PodsData $pods_data The PodsData object.
*/ */
$fetch_full = (bool) apply_filters( 'pods_data_fetch_full', true, $this ); $fetch_full = (bool) apply_filters( 'pods_data_fetch_full', $this->fetch_full, $this );
if ( $fetch_full && ( null !== $row || ( $this->pod_data && 'settings' === $this->pod_data['type'] ) ) ) { if ( $fetch_full && ( null !== $row || ( $this->pod_data && 'settings' === $this->pod_data['type'] ) ) ) {
if ( $explicit_set ) { if ( $explicit_set ) {
...@@ -2374,8 +2412,22 @@ class PodsData { ...@@ -2374,8 +2412,22 @@ class PodsData {
// Run Query. // Run Query.
$params->sql = apply_filters( 'pods_data_query', $params->sql, $params ); $params->sql = apply_filters( 'pods_data_query', $params->sql, $params );
$wpdb_show_errors = null;
// Maybe disable wpdb errors.
if ( false === $params->error && ! empty( $wpdb->show_errors ) ) {
$wpdb_show_errors = false;
$wpdb->show_errors( false );
}
$result = $wpdb->query( $params->sql ); $result = $wpdb->query( $params->sql );
// Maybe show wpdb errors.
if ( $wpdb_show_errors ) {
$wpdb->show_errors( true );
}
$result = apply_filters( 'pods_data_query_result', $result, $params ); $result = apply_filters( 'pods_data_query_result', $result, $params );
if ( false === $result && ! empty( $params->error ) && ! empty( $wpdb->last_error ) ) { if ( false === $result && ! empty( $params->error ) && ! empty( $wpdb->last_error ) ) {
...@@ -3466,7 +3518,7 @@ class PodsData { ...@@ -3466,7 +3518,7 @@ class PodsData {
LEFT JOIN `{$table_info['pod_table']}` AS `{$field_joined}` ON LEFT JOIN `{$table_info['pod_table']}` AS `{$field_joined}` ON
`{$field_joined}`.`{$table_info['pod_field_id']}` = `{$traverse_recurse['rel_alias']}`.`{$joined_id}` `{$field_joined}`.`{$table_info['pod_field_id']}` = `{$traverse_recurse['rel_alias']}`.`{$joined_id}`
"; ";
} elseif ( pods_podsrel_enabled() ) { } elseif ( pods_podsrel_enabled( $the_field, 'lookup' ) ) {
if ( ( $traverse_recurse['depth'] + 2 ) === count( $traverse_recurse['fields'] ) && ( ! $is_pickable || ! in_array( $pick_object, $simple_tableless_objects, true ) ) && 'post_author' === $traverse_recurse['fields'][ $traverse_recurse['depth'] + 1 ] ) { if ( ( $traverse_recurse['depth'] + 2 ) === count( $traverse_recurse['fields'] ) && ( ! $is_pickable || ! in_array( $pick_object, $simple_tableless_objects, true ) ) && 'post_author' === $traverse_recurse['fields'][ $traverse_recurse['depth'] + 1 ] ) {
$table_info['recurse'] = false; $table_info['recurse'] = false;
} }
...@@ -3486,6 +3538,39 @@ class PodsData { ...@@ -3486,6 +3538,39 @@ class PodsData {
`{$field_joined}`.`{$table_info[ 'field_id' ]}` = `{$rel_alias}`.`related_item_id` `{$field_joined}`.`{$table_info[ 'field_id' ]}` = `{$rel_alias}`.`related_item_id`
"; ";
} }
} else {
$handle_join = [
'recurse' => $table_info['recurse'],
'the_join' => null,
];
/**
* Allow filtering the join parameters to be used for custom traversal logic.
*
* @since 2.8.14
*
* @param array $handle_join The join parameters to set.
* @param array $args The additional traverse recurse arguments.
* @param PodsData $pods_data The PodsData object.
*/
$handle_join = apply_filters( 'pods_data_traverse_recurse_handle_join', $handle_join, [
'traverse' => $traverse,
'traverse_recurse' => $traverse_recurse,
'the_field' => $the_field,
'table_info' => $table_info,
'field_joined' => $field_joined,
'rel_alias' => $rel_alias,
'is_pickable' => $is_pickable,
'pick_object' => $pick_object,
], $this );
if ( null !== $handle_join['recurse'] ) {
$table_info['recurse'] = $handle_join['recurse'];
}
if ( null !== $handle_join['the_join'] ) {
$the_join = $handle_join['the_join'];
}
}//end if }//end if
} elseif ( 'meta' === $pod_data['storage'] ) { } elseif ( 'meta' === $pod_data['storage'] ) {
if ( ( $traverse_recurse['depth'] + 2 ) === count( $traverse_recurse['fields'] ) && ( ! $is_pickable || ! in_array( $pick_object, $simple_tableless_objects, true ) ) && $table_info['meta_field_value'] === $traverse_recurse['fields'][ $traverse_recurse['depth'] + 1 ] ) { if ( ( $traverse_recurse['depth'] + 2 ) === count( $traverse_recurse['fields'] ) && ( ! $is_pickable || ! in_array( $pick_object, $simple_tableless_objects, true ) ) && $table_info['meta_field_value'] === $traverse_recurse['fields'][ $traverse_recurse['depth'] + 1 ] ) {
......
...@@ -584,7 +584,25 @@ class PodsView { ...@@ -584,7 +584,25 @@ class PodsView {
// Is the view's file somewhere within the plugin directory tree? // Is the view's file somewhere within the plugin directory tree?
// Note: we explicitly whitelist PODS_DIR for the case of symlinks (see issue #2945) // Note: we explicitly whitelist PODS_DIR for the case of symlinks (see issue #2945)
if ( false !== strpos( $_real_view, realpath( WP_PLUGIN_DIR ) ) || false !== strpos( $_real_view, realpath( WPMU_PLUGIN_DIR ) ) || false !== strpos( $_real_view, PODS_DIR ) ) { $path_checks = [
realpath( WP_PLUGIN_DIR ),
realpath( WPMU_PLUGIN_DIR ),
realpath( PODS_DIR ),
];
$path_checks = array_filter( $path_checks );
$path_match = false;
foreach ( $path_checks as $path_check ) {
if ( false !== strpos( $_real_view, $path_check ) ) {
$path_match = true;
break;
}
}
if ( $path_match ) {
if ( file_exists( $_view ) ) { if ( file_exists( $_view ) ) {
$located = $_view; $located = $_view;
} else { } else {
...@@ -598,11 +616,22 @@ class PodsView { ...@@ -598,11 +616,22 @@ class PodsView {
return false; return false;
} }
// Allow views in the theme or child theme // Allow views in the theme or child theme.
if ( file_exists( realpath( get_stylesheet_directory() . '/' . $_real_view ) ) ) { $path_checks = [
$located = realpath( get_stylesheet_directory() . '/' . $_real_view ); realpath( get_stylesheet_directory() . DIRECTORY_SEPARATOR . $_real_view ),
} elseif ( file_exists( realpath( get_template_directory() . '/' . $_real_view ) ) ) { realpath( get_template_directory() . DIRECTORY_SEPARATOR . $_real_view ),
$located = realpath( get_template_directory() . '/' . $_real_view ); ];
$path_checks = array_filter( $path_checks );
$path_match = false;
foreach ( $path_checks as $path_check ) {
if ( file_exists( $path_check ) ) {
$located = $path_check;
break;
}
} }
}//end if }//end if
......
...@@ -994,7 +994,7 @@ class PodsField_DateTime extends PodsField { ...@@ -994,7 +994,7 @@ class PodsField_DateTime extends PodsField {
/** /**
* Prepare the date/datetime/time field object or options for MomentJS formatting. * Prepare the date/datetime/time field object or options for MomentJS formatting.
* *
* @since TBD * @since 2.8.11
* *
* @param array|Field $options The field object or options. * @param array|Field $options The field object or options.
* *
...@@ -1043,7 +1043,7 @@ class PodsField_DateTime extends PodsField { ...@@ -1043,7 +1043,7 @@ class PodsField_DateTime extends PodsField {
/** /**
* Get the format from the options for a specific type (date/datetime/time). * Get the format from the options for a specific type (date/datetime/time).
* *
* @since TBD * @since 2.8.11
* *
* @param array|Field $options The field object or options. * @param array|Field $options The field object or options.
* @param string $type The specific field type. * @param string $type The specific field type.
...@@ -1144,7 +1144,7 @@ class PodsField_DateTime extends PodsField { ...@@ -1144,7 +1144,7 @@ class PodsField_DateTime extends PodsField {
/** /**
* Convert the source format to MomentJS format for PHP / jQuery UI formats. * Convert the source format to MomentJS format for PHP / jQuery UI formats.
* *
* @since TBD * @since 2.8.11
* *
* @param string|mixed $source_format The source format. * @param string|mixed $source_format The source format.
* @param array $args The list of format arguments including source (php/jquery_ui) and type (date/time). * @param array $args The list of format arguments including source (php/jquery_ui) and type (date/time).
......
...@@ -258,7 +258,7 @@ class PodsField_Pick extends PodsField { ...@@ -258,7 +258,7 @@ class PodsField_Pick extends PodsField {
static::$type . '_object' => array_merge( [ static::$type . '_object' => array_merge( [
'site', 'site',
'network', 'network',
], self::simple_objects() ), ], $this->simple_objects() ),
static::$type . '_allow_add_new' => false, static::$type . '_allow_add_new' => false,
], ],
'type' => 'boolean', 'type' => 'boolean',
...@@ -272,7 +272,7 @@ class PodsField_Pick extends PodsField { ...@@ -272,7 +272,7 @@ class PodsField_Pick extends PodsField {
static::$type . '_format_multi' => 'list', static::$type . '_format_multi' => 'list',
], ],
'excludes-on' => [ 'excludes-on' => [
static::$type . '_object' => array_merge( [ 'site', 'network' ], self::simple_objects() ), static::$type . '_object' => array_merge( [ 'site', 'network' ], $this->simple_objects() ),
], ],
'type' => 'boolean', 'type' => 'boolean',
'default' => 1, 'default' => 1,
...@@ -285,7 +285,7 @@ class PodsField_Pick extends PodsField { ...@@ -285,7 +285,7 @@ class PodsField_Pick extends PodsField {
static::$type . '_format_multi' => 'list', static::$type . '_format_multi' => 'list',
], ],
'excludes-on' => [ 'excludes-on' => [
static::$type . '_object' => array_merge( [ 'site', 'network' ], self::simple_objects() ), static::$type . '_object' => array_merge( [ 'site', 'network' ], $this->simple_objects() ),
], ],
'type' => 'boolean', 'type' => 'boolean',
'default' => 1, 'default' => 1,
...@@ -298,7 +298,7 @@ class PodsField_Pick extends PodsField { ...@@ -298,7 +298,7 @@ class PodsField_Pick extends PodsField {
static::$type . '_format_multi' => 'list', static::$type . '_format_multi' => 'list',
], ],
'excludes-on' => [ 'excludes-on' => [
static::$type . '_object' => array_merge( [ 'site', 'network' ], self::simple_objects() ), static::$type . '_object' => array_merge( [ 'site', 'network' ], $this->simple_objects() ),
], ],
'type' => 'boolean', 'type' => 'boolean',
'default' => 1, 'default' => 1,
...@@ -347,7 +347,7 @@ class PodsField_Pick extends PodsField { ...@@ -347,7 +347,7 @@ class PodsField_Pick extends PodsField {
'label' => __( 'Display Field in Selection List', 'pods' ), 'label' => __( 'Display Field in Selection List', 'pods' ),
'help' => __( 'Provide the name of a field on the related object to reference, example: {@post_title}', 'pods' ) . ' ' . $fallback_help, 'help' => __( 'Provide the name of a field on the related object to reference, example: {@post_title}', 'pods' ) . ' ' . $fallback_help,
'excludes-on' => [ 'excludes-on' => [
static::$type . '_object' => array_merge( [ 'site', 'network' ], self::simple_objects() ), static::$type . '_object' => array_merge( [ 'site', 'network' ], $this->simple_objects() ),
], ],
'default' => '', 'default' => '',
'type' => 'text', 'type' => 'text',
...@@ -367,7 +367,7 @@ class PodsField_Pick extends PodsField { ...@@ -367,7 +367,7 @@ class PodsField_Pick extends PodsField {
'label' => __( 'Customized <em>WHERE</em>', 'pods' ), 'label' => __( 'Customized <em>WHERE</em>', 'pods' ),
'help' => $fallback_help, 'help' => $fallback_help,
'excludes-on' => [ 'excludes-on' => [
static::$type . '_object' => array_merge( [ 'site', 'network' ], self::simple_objects() ), static::$type . '_object' => array_merge( [ 'site', 'network' ], $this->simple_objects() ),
], ],
'default' => '', 'default' => '',
'type' => 'text', 'type' => 'text',
...@@ -376,7 +376,7 @@ class PodsField_Pick extends PodsField { ...@@ -376,7 +376,7 @@ class PodsField_Pick extends PodsField {
'label' => __( 'Customized <em>ORDER BY</em>', 'pods' ), 'label' => __( 'Customized <em>ORDER BY</em>', 'pods' ),
'help' => $fallback_help, 'help' => $fallback_help,
'excludes-on' => [ 'excludes-on' => [
static::$type . '_object' => array_merge( [ 'site', 'network' ], self::simple_objects() ), static::$type . '_object' => array_merge( [ 'site', 'network' ], $this->simple_objects() ),
], ],
'default' => '', 'default' => '',
'type' => 'text', 'type' => 'text',
...@@ -385,7 +385,7 @@ class PodsField_Pick extends PodsField { ...@@ -385,7 +385,7 @@ class PodsField_Pick extends PodsField {
'label' => __( 'Customized <em>GROUP BY</em>', 'pods' ), 'label' => __( 'Customized <em>GROUP BY</em>', 'pods' ),
'help' => $fallback_help, 'help' => $fallback_help,
'excludes-on' => [ 'excludes-on' => [
static::$type . '_object' => array_merge( [ 'site', 'network' ], self::simple_objects() ), static::$type . '_object' => array_merge( [ 'site', 'network' ], $this->simple_objects() ),
], ],
'default' => '', 'default' => '',
'type' => 'text', 'type' => 'text',
...@@ -2005,7 +2005,7 @@ class PodsField_Pick extends PodsField { ...@@ -2005,7 +2005,7 @@ class PodsField_Pick extends PodsField {
*/ */
public function simple_value( $name, $value = null, $options = null, $pod = null, $id = null, $raw = false ) { public function simple_value( $name, $value = null, $options = null, $pod = null, $id = null, $raw = false ) {
if ( in_array( pods_v( static::$type . '_object', $options ), self::simple_objects(), true ) ) { if ( in_array( pods_v( static::$type . '_object', $options ), $this->simple_objects(), true ) ) {
if ( ! is_array( $value ) && 0 < strlen( $value ) ) { if ( ! is_array( $value ) && 0 < strlen( $value ) ) {
$simple = @json_decode( $value, true ); $simple = @json_decode( $value, true );
......
...@@ -1038,15 +1038,17 @@ class Pods_Pages extends PodsComponent { ...@@ -1038,15 +1038,17 @@ class Pods_Pages extends PodsComponent {
if ( ! is_object( $pods ) && 404 != $pods && 0 < strlen( pods_var( 'pod', self::$exists['options'] ) ) ) { if ( ! is_object( $pods ) && 404 != $pods && 0 < strlen( pods_var( 'pod', self::$exists['options'] ) ) ) {
$slug = pods_var_raw( 'pod_slug', self::$exists['options'], null, null, true ); $slug = pods_var_raw( 'pod_slug', self::$exists['options'], null, null, true );
$has_slug = 0 < strlen( $slug );
// Handle special magic tags // Handle special magic tags
if ( 0 < strlen( $slug ) ) { if ( $has_slug ) {
$slug = pods_evaluate_tags( $slug, true ); $slug = pods_evaluate_tags( $slug, true );
} }
$pods = pods( pods_var( 'pod', self::$exists['options'] ), $slug ); $pods = pods( pods_var( 'pod', self::$exists['options'] ), $slug );
// Auto 404 handling if item doesn't exist // Auto 404 handling if item doesn't exist
if ( 0 < strlen( $slug ) && ! $pods->exists() && apply_filters( 'pods_pages_auto_404', true, $slug, $pods, self::$exists ) ) { if ( $has_slug && ( empty( $slug ) || ! $pods->exists() ) && apply_filters( 'pods_pages_auto_404', true, $slug, $pods, self::$exists ) ) {
$pods = 404; $pods = 404;
} }
} }
...@@ -1230,7 +1232,7 @@ class Pods_Pages extends PodsComponent { ...@@ -1230,7 +1232,7 @@ class Pods_Pages extends PodsComponent {
/** /**
* Handle overriding the template used for a Pods Page. * Handle overriding the template used for a Pods Page.
* *
* @since TBD * @since 2.8.11
* *
* @param string $original_template The template to include. * @param string $original_template The template to include.
* *
...@@ -1317,7 +1319,7 @@ class Pods_Pages extends PodsComponent { ...@@ -1317,7 +1319,7 @@ class Pods_Pages extends PodsComponent {
/** /**
* Allow filtering the template to include for a Pods Page. * Allow filtering the template to include for a Pods Page.
* *
* @since TBD * @since 2.8.11
* *
* @param string $template The template to use. * @param string $template The template to use.
* @param array $exists The Pods Page data. * @param array $exists The Pods Page data.
......
...@@ -2385,7 +2385,7 @@ function pods_bool_to_int( $value ) { ...@@ -2385,7 +2385,7 @@ function pods_bool_to_int( $value ) {
/** /**
* Make replacements to a string using key=>value pairs. * Make replacements to a string using key=>value pairs.
* *
* @since TBD * @since 2.8.11
* *
* @param string|array|mixed $value The value to do replacements on. * @param string|array|mixed $value The value to do replacements on.
* @param array $replacements The key=>value replacements to make. * @param array $replacements The key=>value replacements to make.
......
...@@ -184,7 +184,7 @@ function pods_error( $error, $obj = null ) { ...@@ -184,7 +184,7 @@ function pods_error( $error, $obj = null ) {
/** /**
* Allow filtering whether to force the error mode in cases where multiple exceptions have been used. * Allow filtering whether to force the error mode in cases where multiple exceptions have been used.
* *
* @since TBD * @since 2.8.11
* *
* @param bool $error_mode_force Whether to force the error mode in cases where multiple exceptions have been used. * @param bool $error_mode_force Whether to force the error mode in cases where multiple exceptions have been used.
*/ */
...@@ -456,9 +456,12 @@ function pods_tableless() { ...@@ -456,9 +456,12 @@ function pods_tableless() {
* *
* @since 2.8.0 * @since 2.8.0
* *
* @param null|Field $field The field object.
* @param null|string $context The context of the podsrel check (lookup/save).
*
* @return bool Whether the wp_podsrel table is enabled. * @return bool Whether the wp_podsrel table is enabled.
*/ */
function pods_podsrel_enabled() { function pods_podsrel_enabled( $field = null, $context = null ) {
// Disabled when Pods Tableless mode is on. // Disabled when Pods Tableless mode is on.
if ( pods_tableless() ) { if ( pods_tableless() ) {
return false; return false;
...@@ -470,8 +473,10 @@ function pods_podsrel_enabled() { ...@@ -470,8 +473,10 @@ function pods_podsrel_enabled() {
* @since 2.8.0 * @since 2.8.0
* *
* @param bool $enabled Whether the wp_podsrel table is enabled. * @param bool $enabled Whether the wp_podsrel table is enabled.
* @param null|Field $field The field object.
* @param null|string $context The context of the podsrel check (lookup/save).
*/ */
return (bool) apply_filters( 'pods_podsrel_enabled', true ); return (bool) apply_filters( 'pods_podsrel_enabled', true, $field, $context );
} }
/** /**
...@@ -2940,7 +2945,7 @@ function pods_meta_hook_list( $object_type = 'post', $object = null ) { ...@@ -2940,7 +2945,7 @@ function pods_meta_hook_list( $object_type = 'post', $object = null ) {
/** /**
* Allow filtering the list of actions and filters for a specific object type. * Allow filtering the list of actions and filters for a specific object type.
* *
* @since TBD * @since 2.8.11
* *
* @param array $hooks List of filters and actions for a specific object type. * @param array $hooks List of filters and actions for a specific object type.
* @param string $object_type The object type. * @param string $object_type The object type.
...@@ -3774,7 +3779,7 @@ function pods_svg_icon( $icon_path, $default = 'dashicons-database', $mode = 'ba ...@@ -3774,7 +3779,7 @@ function pods_svg_icon( $icon_path, $default = 'dashicons-database', $mode = 'ba
/** /**
* Determine whether Pods is being used for content types only. * Determine whether Pods is being used for content types only.
* *
* @since TBD * @since 2.8.11
* *
* @param bool $check_constant_only Whether to only check the constant, unless there's a filter overriding things. * @param bool $check_constant_only Whether to only check the constant, unless there's a filter overriding things.
* *
...@@ -3797,7 +3802,7 @@ function pods_is_types_only( $check_constant_only = false ) { ...@@ -3797,7 +3802,7 @@ function pods_is_types_only( $check_constant_only = false ) {
/** /**
* Allow filtering whether Pods is being used for content types only. * Allow filtering whether Pods is being used for content types only.
* *
* @since TBD * @since 2.8.11
* *
* @param bool $is_types_only Whether Pods is being used for content types only. * @param bool $is_types_only Whether Pods is being used for content types only.
*/ */
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Plugin Name: Pods - Custom Content Types and Fields * Plugin Name: Pods - Custom Content Types and Fields
* Plugin URI: https://pods.io/ * Plugin URI: https://pods.io/
* Description: Pods is a framework for creating, managing, and deploying customized content types and fields * Description: Pods is a framework for creating, managing, and deploying customized content types and fields
* Version: 2.8.13 * Version: 2.8.15
* Author: Pods Framework Team * Author: Pods Framework Team
* Author URI: https://pods.io/about/ * Author URI: https://pods.io/about/
* Text Domain: pods * Text Domain: pods
...@@ -43,7 +43,7 @@ if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) { ...@@ -43,7 +43,7 @@ if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) {
add_action( 'init', 'pods_deactivate_pods_ui' ); add_action( 'init', 'pods_deactivate_pods_ui' );
} else { } else {
// Current version. // Current version.
define( 'PODS_VERSION', '2.8.13' ); define( 'PODS_VERSION', '2.8.15' );
// Current database version, this is the last version the database changed. // Current database version, this is the last version the database changed.
define( 'PODS_DB_VERSION', '2.3.5' ); define( 'PODS_DB_VERSION', '2.3.5' );
......
...@@ -5,7 +5,7 @@ Tags: pods, custom post types, custom taxonomies, content types, custom fields, ...@@ -5,7 +5,7 @@ Tags: pods, custom post types, custom taxonomies, content types, custom fields,
Requires at least: 5.5 Requires at least: 5.5
Tested up to: 5.9 Tested up to: 5.9
Requires PHP: 5.6 Requires PHP: 5.6
Stable tag: 2.8.13 Stable tag: 2.8.15
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
...@@ -156,6 +156,26 @@ Pods really wouldn't be where it is without all the contributions from our [dono ...@@ -156,6 +156,26 @@ Pods really wouldn't be where it is without all the contributions from our [dono
== Changelog == == Changelog ==
= 2.8.15 - April 16th, 2022 =
* Added: New `pods_callback` support in `Pods::find()` so that you can pass a callback function to use for `pods()` usage with relationships using the `output` as "pods". This allows for using shared instances across large data sets to reduce time. (@sc0ttkclark)
* Added: New property `$data->fetch_full` added to `PodsData` which can be used to turn off additional fetch requests when all of the table data was already returned by the query with `t.*`. (@sc0ttkclark)
* Fixed: When using table-based fields and a non-simple relationship has a field in the table, it will still be expanded like a normal relationship field when requesting it by name with no traversal. (@sc0ttkclark)
* Fixed: Call `PodsField_Pick::simple_objects()` using the object instead of statically to prevent PHP notices. (@sc0ttkclark)
* Fixed: Adjust the `Pods\REST\V1\Endpoints\Base::check_permission()` method so that it references the correct `\Pods` object. (@sc0ttkclark)
= 2.8.14 - April 15th, 2022 =
* Added: New `$params` support in `Pods::total_found( $params )` to support `Pods::find( $params )` shorthand lookups for getting total number of records found more easily. (@sc0ttkclark)
* Added: New `pods_api_save_field_table_definition_mode` filter allows overriding the definition mode when saving a field (bypass/add/drop/change) for schema management. (@sc0ttkclark)
* Added: New `pods_podsrel_enabled()` arguments to allow filtering based on the field and context. (@sc0ttkclark)
* Added: New `pods_data_build_pre_traverse_args` filter allows for overriding the find/replace/traverse/params arguments for a `PodsData::build()` request before relationship traversal runs. (@sc0ttkclark)
* Added: New `pods_data_traverse_recurse_handle_join` filter allows for overriding the JOIN SQL used for relationship traversal. (@sc0ttkclark)
* Fixed: Resolved potential PHP issues with path checks in `PodsView` on certain environments. (@sc0ttkclark)
* Fixed: When a slug is set on a Pods Page, if the slug value comes through as empty due to a path issue, it will now enforce a 404 as expected. (@sc0ttkclark)
* Fixed: Resolved a few issues with the old field data coming through to the `pods_api_save_field_old_definition` filter. (@sc0ttkclark)
* Fixed: No longer showing WPDB errors from WPDB when query errors are forced off. (@sc0ttkclark)
= 2.8.13 - April 10th, 2022 = = 2.8.13 - April 10th, 2022 =
* Fixed: Resolved PHP issues with PHP 7.x with the WPML integration. (@sc0ttkclark) * Fixed: Resolved PHP issues with PHP 7.x with the WPML integration. (@sc0ttkclark)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Pods\REST\V1\Endpoints; namespace Pods\REST\V1\Endpoints;
use Pods;
use Exception; use Exception;
use Pods\Whatsit; use Pods\Whatsit;
use Tribe__REST__Messages_Interface as Messages_Interface; use Tribe__REST__Messages_Interface as Messages_Interface;
...@@ -26,13 +27,13 @@ abstract class Base { ...@@ -26,13 +27,13 @@ abstract class Base {
public $route; public $route;
/** /**
* @since TBD * @since 2.8.11
* @var string * @var string
*/ */
public $rest_route; public $rest_route;
/** /**
* @since TBD * @since 2.8.11
* @var string * @var string
*/ */
public $rest_doc_route; public $rest_doc_route;
...@@ -220,7 +221,7 @@ abstract class Base { ...@@ -220,7 +221,7 @@ abstract class Base {
/** /**
* Get the Pod object for a specific item by ID or slug. * Get the Pod object for a specific item by ID or slug.
* *
* @since TBD * @since 2.8.11
* *
* @param int|string $id_or_slug The item ID or slug. * @param int|string $id_or_slug The item ID or slug.
* *
...@@ -239,7 +240,7 @@ abstract class Base { ...@@ -239,7 +240,7 @@ abstract class Base {
/** /**
* Validate the required params are set. * Validate the required params are set.
* *
* @since TBD * @since 2.8.11
* *
* @param object $params The object params. * @param object $params The object params.
* @param array $required_params The list of required params. * @param array $required_params The list of required params.
...@@ -273,7 +274,7 @@ abstract class Base { ...@@ -273,7 +274,7 @@ abstract class Base {
/** /**
* Check whether the user has access to the pod item. * Check whether the user has access to the pod item.
* *
* @since TBD * @since 2.8.11
* *
* @param Pods $pod The Pods object. * @param Pods $pod The Pods object.
* @param string $author_field The author field to check permissions against. * @param string $author_field The author field to check permissions against.
...@@ -715,7 +716,7 @@ abstract class Base { ...@@ -715,7 +716,7 @@ abstract class Base {
/** /**
* Register route for the endpoint automatically based on the supported methods. * Register route for the endpoint automatically based on the supported methods.
* *
* @since TBD * @since 2.8.11
* *
* @param string $namespace The route namespace. * @param string $namespace The route namespace.
* @param bool $add_to_docs Whether to add the route to the documentation endpoint. * @param bool $add_to_docs Whether to add the route to the documentation endpoint.
...@@ -782,7 +783,7 @@ abstract class Base { ...@@ -782,7 +783,7 @@ abstract class Base {
$registered = register_rest_route( $namespace, $rest_route, $methods ); $registered = register_rest_route( $namespace, $rest_route, $methods );
// Maybe register route with the documentation handler. // Maybe register route with the documentation handler.
if ( $registered ) { if ( $registered && $add_to_docs ) {
$rest_doc_route = $this->route; $rest_doc_route = $this->route;
if ( ! empty( $this->rest_doc_route ) ) { if ( ! empty( $this->rest_doc_route ) ) {
......
...@@ -20,14 +20,14 @@ class Field extends Base implements READ_Interface, UPDATE_Interface, DELETE_Int ...@@ -20,14 +20,14 @@ class Field extends Base implements READ_Interface, UPDATE_Interface, DELETE_Int
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_route = '/fields/(?P<id>\\d+)'; public $rest_route = '/fields/(?P<id>\\d+)';
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_doc_route = '/fields/{id}'; public $rest_doc_route = '/fields/{id}';
......
...@@ -16,14 +16,14 @@ class Field_Slug extends Field { ...@@ -16,14 +16,14 @@ class Field_Slug extends Field {
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_route = '/pods/(?P<pod>[\w\_\-]+)/fields/(?P<slug>[\w\_\-]+)'; public $rest_route = '/pods/(?P<pod>[\w\_\-]+)/fields/(?P<slug>[\w\_\-]+)';
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_doc_route = '/pods/{pod}/fields/{slug}'; public $rest_doc_route = '/pods/{pod}/fields/{slug}';
......
...@@ -20,14 +20,14 @@ class Group extends Base implements READ_Interface, UPDATE_Interface, DELETE_Int ...@@ -20,14 +20,14 @@ class Group extends Base implements READ_Interface, UPDATE_Interface, DELETE_Int
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_route = '/groups/(?P<id>\\d+)'; public $rest_route = '/groups/(?P<id>\\d+)';
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_doc_route = '/groups/{id}'; public $rest_doc_route = '/groups/{id}';
......
...@@ -16,14 +16,14 @@ class Group_Slug extends Group { ...@@ -16,14 +16,14 @@ class Group_Slug extends Group {
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_route = '/pods/(?P<pod>[\w\_\-]+)/groups/(?P<slug>[\w\_\-]+)'; public $rest_route = '/pods/(?P<pod>[\w\_\-]+)/groups/(?P<slug>[\w\_\-]+)';
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_doc_route = '/pods/{pod}/groups/{slug}'; public $rest_doc_route = '/pods/{pod}/groups/{slug}';
......
...@@ -20,14 +20,14 @@ class Pod extends Base implements READ_Interface, UPDATE_Interface, DELETE_Inter ...@@ -20,14 +20,14 @@ class Pod extends Base implements READ_Interface, UPDATE_Interface, DELETE_Inter
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_route = '/pods/(?P<id>\\d+)'; public $rest_route = '/pods/(?P<id>\\d+)';
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_doc_route = '/pods/{id}'; public $rest_doc_route = '/pods/{id}';
......
...@@ -16,14 +16,14 @@ class Pod_Slug extends Pod { ...@@ -16,14 +16,14 @@ class Pod_Slug extends Pod {
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_route = '/pods/(?P<slug>[\w\_\-]+)'; public $rest_route = '/pods/(?P<slug>[\w\_\-]+)';
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
* @since TBD * @since 2.8.11
*/ */
public $rest_doc_route = '/pods/{slug}'; public $rest_doc_route = '/pods/{slug}';
......
...@@ -68,7 +68,7 @@ class Service_Provider extends \tad_DI52_ServiceProvider { ...@@ -68,7 +68,7 @@ class Service_Provider extends \tad_DI52_ServiceProvider {
/** /**
* Get the list of endpoints. * Get the list of endpoints.
* *
* @since TBD * @since 2.8.11
* *
* @return string[] The list of endpoints. * @return string[] The list of endpoints.
*/ */
......
...@@ -27,7 +27,7 @@ class Base extends Validator_Base implements Validator_Interface { ...@@ -27,7 +27,7 @@ class Base extends Validator_Base implements Validator_Interface {
/** /**
* Determine whether a Pod / Item ID is valid. * Determine whether a Pod / Item ID is valid.
* *
* @since TBD * @since 2.8.11
* *
* @param string $pod The pod name. * @param string $pod The pod name.
* @param int|string $id_or_slug The Item ID or slug. * @param int|string $id_or_slug The Item ID or slug.
...@@ -43,7 +43,7 @@ class Base extends Validator_Base implements Validator_Interface { ...@@ -43,7 +43,7 @@ class Base extends Validator_Base implements Validator_Interface {
/** /**
* Determine whether a Pod / Item ID is valid. * Determine whether a Pod / Item ID is valid.
* *
* @since TBD * @since 2.8.11
* *
* @param string $pod The pod name. * @param string $pod The pod name.
* @param int|string $id The item ID. * @param int|string $id The item ID.
...@@ -57,7 +57,7 @@ class Base extends Validator_Base implements Validator_Interface { ...@@ -57,7 +57,7 @@ class Base extends Validator_Base implements Validator_Interface {
/** /**
* Determine whether a Pod / Item slug is valid. * Determine whether a Pod / Item slug is valid.
* *
* @since TBD * @since 2.8.11
* *
* @param string $pod The pod name. * @param string $pod The pod name.
* @param int|string $slug The Item slug. * @param int|string $slug The Item slug.
...@@ -172,7 +172,7 @@ class Base extends Validator_Base implements Validator_Interface { ...@@ -172,7 +172,7 @@ class Base extends Validator_Base implements Validator_Interface {
/** /**
* Handle other potential methods automatically if possible. * Handle other potential methods automatically if possible.
* *
* @since TBD * @since 2.8.11
* *
* @param string $name The method name. * @param string $name The method name.
* @param array $arguments The arguments provided to the method. * @param array $arguments The arguments provided to the method.
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<div class="l-map--cities" id="js-map--cities" data-source="plunge"></div> <div class="l-map--cities" id="js-map--cities" data-source="plunge"></div>
</div> </div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDe9Z7EJMROLUEYOUe05zUnRFwxDrH56k0" async defer></script>
<?php <?php
if ( is_active_sidebar( 'front_page_feedbacks' ) ) : if ( is_active_sidebar( 'front_page_feedbacks' ) ) :
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</div> </div>
</div> </div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDe9Z7EJMROLUEYOUe05zUnRFwxDrH56k0" async defer></script>
<?php <?php
if ( is_active_sidebar( 'front_page_feedbacks' ) ) : if ( is_active_sidebar( 'front_page_feedbacks' ) ) :
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<div class="l-map--cities" id="js-map--cities" data-source="kazlu-ruda"></div> <div class="l-map--cities" id="js-map--cities" data-source="kazlu-ruda"></div>
</div> </div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDe9Z7EJMROLUEYOUe05zUnRFwxDrH56k0" async defer></script>
<?php <?php
if ( is_active_sidebar( 'front_page_feedbacks' ) ) : if ( is_active_sidebar( 'front_page_feedbacks' ) ) :
......
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
?> ?>
<script src="/wp-content/themes/biuro/js/main-476e514c.min.js" async defer></script> <script src="/wp-content/themes/biuro/js/main-54c15b04.min.js" async defer></script>
<script src="/wp-content/themes/biuro/js/vendor/modernizr-custom.js" async defer></script> <script src="/wp-content/themes/biuro/js/vendor/modernizr-custom.js" async defer></script>
......
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{11:function(e,t,n){"use strict";n.r(t);var o,i=n(0);function s(e,t){const n=function(){function e(e,t,n="top"){this.position=e;var o=document.createElement("div");o.innerHTML=t||"",o.classList.add("popup-bubble"),o.classList.add("popup-bubble--"+n);var i=document.createElement("div");i.classList.add("popup-bubble-anchor"),i.appendChild(o),this.containerDiv=document.createElement("div"),this.containerDiv.classList.add("popup-container"),this.containerDiv.appendChild(i),window.google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.containerDiv)}return e.prototype=Object.create(window.google.maps.OverlayView.prototype),e.prototype.onAdd=function(){this.getPanes().floatPane.appendChild(this.containerDiv)},e.prototype.onRemove=function(){this.containerDiv.parentElement&&this.containerDiv.parentElement.removeChild(this.containerDiv)},e.prototype.draw=function(){var e=this.getProjection().fromLatLngToDivPixel(this.position),t=Math.abs(e.x)<4e3&&Math.abs(e.y)<4e3?"block":"none";"block"===t&&(this.containerDiv.style.left=e.x+"px",this.containerDiv.style.top=e.y+"px"),this.containerDiv.style.display!==t&&(this.containerDiv.style.display=t)},e}(),o=new window.google.maps.LatLngBounds;let i;for(var s=0;s<t.length;s++){const a=t[s],l=new window.google.maps.LatLng(a.lat,a.lng);i=new n(l,a.title,a.pos),i.setMap(e),o.extend(l)}e.fitBounds(o)}function a(e,t,n){for(var i=new window.google.maps.LatLngBounds,s=0;s<t.length;s++){const l=t[s],d=new window.google.maps.LatLng(l.lat,l.lng);var a=new window.google.maps.Marker({position:d,map:e,icon:"/wp-content/themes/biuro/i/ico--map-pin.svg",title:l.title||""});o&&o.close(),i.extend(d),l.content&&(a.content=l.content,window.google.maps.event.addListener(a,"click",(function(){o&&o.close(),(o=new window.google.maps.InfoWindow({content:this.content})).open(e,this)}))),n&&(window.innerWidth<960&&window.scrollTo(0,0),new google.maps.event.trigger(a,"click"))}e.fitBounds(i),window.innerWidth>1020?e.panBy(250,0):window.innerWidth>959&&e.panBy(180,0)}function l(e){var t=new window.google.maps.Map(e,{}),n=new window.google.maps.StyledMapType([{featureType:"all",elementType:"all",stylers:[{saturation:-92},{lightness:-8},{hue:"#004ed4"}]},{featureType:"water",elementType:"all",stylers:[{saturation:-95},{lightness:-25},{hue:"#004ed4"}]}],{name:"Biuro"});return t.mapTypes.set("biuro",n),t.setMapTypeId("biuro"),window.google.maps.event.addListenerOnce(t,"bounds_changed",(function(){this.getZoom()>15&&this.setZoom(14)})),t}t.default=()=>{const e=document.getElementById("js-map--divisions");e&&fetch("/wp-json/api/v1/divisions?langID="+e.dataset.id).then(e=>e.json()).then(t=>{!function(e,t){Object(i.a)("https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M").then(()=>{window.google&&setTimeout(()=>{var n=l(e);let o=[];Object.keys(t).forEach(e=>{const n=t[e];"city"===e.substr(0,4)&&(o=o.concat(n))}),document.querySelectorAll(".js-division").forEach(e=>{e.addEventListener("click",()=>{const i=e&&e.dataset.id?e.dataset.id:"";t[i]?a(n,t[i].filter(e=>e.lat&&e.lng),!0):a(n,o.filter(e=>e.lat&&e.lng))})}),a(n,o.filter(e=>e.lat&&e.lng))},50)})}(e,t)});const t=document.getElementById("js-map--cities");t&&fetch("/wp-content/themes/biuro/json/"+t.dataset.source+".json").then(e=>e.json()).then(e=>{!function e(t,n){if(window.google){var o=l(t);s(o,n),window.innerWidth>1020?o.panBy(-230,0):window.innerWidth>959&&o.panBy(-150,0)}else setTimeout(()=>{e(t,n)},250)}(t,e)});const n=document.getElementById("js-map--regions");n&&function e(t){if(!window.google)return void setTimeout(()=>{e(t)},250);a(l(t),[{title:"Vilnius",lat:54.687157,lng:25.279652},{title:"Rīga",lat:56.946285,lng:24.105078},{title:"Tallinn",lat:59.436962,lng:24.753574}])}(n)}}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{11:function(e,t,n){"use strict";n.r(t);var o,i=n(0);function s(e,t){const n=function(){function e(e,t,n="top"){this.position=e;var o=document.createElement("div");o.innerHTML=t||"",o.classList.add("popup-bubble"),o.classList.add("popup-bubble--"+n);var i=document.createElement("div");i.classList.add("popup-bubble-anchor"),i.appendChild(o),this.containerDiv=document.createElement("div"),this.containerDiv.classList.add("popup-container"),this.containerDiv.appendChild(i),window.google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.containerDiv)}return e.prototype=Object.create(window.google.maps.OverlayView.prototype),e.prototype.onAdd=function(){this.getPanes().floatPane.appendChild(this.containerDiv)},e.prototype.onRemove=function(){this.containerDiv.parentElement&&this.containerDiv.parentElement.removeChild(this.containerDiv)},e.prototype.draw=function(){var e=this.getProjection().fromLatLngToDivPixel(this.position),t=Math.abs(e.x)<4e3&&Math.abs(e.y)<4e3?"block":"none";"block"===t&&(this.containerDiv.style.left=e.x+"px",this.containerDiv.style.top=e.y+"px"),this.containerDiv.style.display!==t&&(this.containerDiv.style.display=t)},e}(),o=new window.google.maps.LatLngBounds;let i;for(var s=0;s<t.length;s++){const a=t[s],l=new window.google.maps.LatLng(a.lat,a.lng);i=new n(l,a.title,a.pos),i.setMap(e),o.extend(l)}e.fitBounds(o)}function a(e,t,n){for(var i=new window.google.maps.LatLngBounds,s=0;s<t.length;s++){const l=t[s],d=new window.google.maps.LatLng(l.lat,l.lng);var a=new window.google.maps.Marker({position:d,map:e,icon:"/wp-content/themes/biuro/i/ico--map-pin.svg",title:l.title||""});o&&o.close(),i.extend(d),l.content&&(a.content=l.content,window.google.maps.event.addListener(a,"click",(function(){o&&o.close(),(o=new window.google.maps.InfoWindow({content:this.content})).open(e,this)}))),n&&(window.innerWidth<960&&window.scrollTo(0,0),new google.maps.event.trigger(a,"click"))}e.fitBounds(i),window.innerWidth>1020?e.panBy(250,0):window.innerWidth>959&&e.panBy(180,0)}function l(e){var t=new window.google.maps.Map(e,{}),n=new window.google.maps.StyledMapType([{featureType:"all",elementType:"all",stylers:[{saturation:-92},{lightness:-8},{hue:"#004ed4"}]},{featureType:"water",elementType:"all",stylers:[{saturation:-95},{lightness:-25},{hue:"#004ed4"}]}],{name:"Biuro"});return t.mapTypes.set("biuro",n),t.setMapTypeId("biuro"),window.google.maps.event.addListenerOnce(t,"bounds_changed",(function(){this.getZoom()>15&&this.setZoom(14)})),t}t.default=()=>{const e=document.getElementById("js-map--divisions");e&&fetch("/wp-json/api/v1/divisions?langID="+e.dataset.id).then(e=>e.json()).then(t=>{!function(e,t){Object(i.a)("https://maps.googleapis.com/maps/api/js?key=AIzaSyDe9Z7EJMROLUEYOUe05zUnRFwxDrH56k0").then(()=>{window.google&&setTimeout(()=>{var n=l(e);let o=[];Object.keys(t).forEach(e=>{const n=t[e];"city"===e.substr(0,4)&&(o=o.concat(n))}),document.querySelectorAll(".js-division").forEach(e=>{e.addEventListener("click",()=>{const i=e&&e.dataset.id?e.dataset.id:"";t[i]?a(n,t[i].filter(e=>e.lat&&e.lng),!0):a(n,o.filter(e=>e.lat&&e.lng))})}),a(n,o.filter(e=>e.lat&&e.lng))},50)})}(e,t)});const t=document.getElementById("js-map--cities");t&&fetch("/wp-content/themes/biuro/json/"+t.dataset.source+".json").then(e=>e.json()).then(e=>{!function e(t,n){if(window.google){var o=l(t);s(o,n),window.innerWidth>1020?o.panBy(-230,0):window.innerWidth>959&&o.panBy(-150,0)}else setTimeout(()=>{e(t,n)},250)}(t,e)});const n=document.getElementById("js-map--regions");n&&function e(t){if(!window.google)return void setTimeout(()=>{e(t)},250);a(l(t),[{title:"Vilnius",lat:54.687157,lng:25.279652},{title:"Rīga",lat:56.946285,lng:24.105078},{title:"Tallinn",lat:59.436962,lng:24.753574}])}(n)}}}]);
\ No newline at end of file \ No newline at end of file
...@@ -199,7 +199,7 @@ function initRegionsMap (node) { ...@@ -199,7 +199,7 @@ function initRegionsMap (node) {
} }
function initDivisionsMap (node, data) { function initDivisionsMap (node, data) {
loadJS('https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M').then(() => { loadJS('https://maps.googleapis.com/maps/api/js?key=AIzaSyDe9Z7EJMROLUEYOUe05zUnRFwxDrH56k0').then(() => {
if (!window.google) { if (!window.google) {
return; return;
} }
...@@ -235,7 +235,7 @@ function initDivisionsMap (node, data) { ...@@ -235,7 +235,7 @@ function initDivisionsMap (node, data) {
} }
const inititateMap = () => { const inititateMap = () => {
// <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script> // <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDe9Z7EJMROLUEYOUe05zUnRFwxDrH56k0" async defer></script>
const division = document.getElementById('js-map--divisions'); const division = document.getElementById('js-map--divisions');
......
...@@ -40,6 +40,6 @@ get_header(); ?> ...@@ -40,6 +40,6 @@ get_header(); ?>
</div><!-- #content --> </div><!-- #content -->
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBQjPQnLGLeICbpTTu8kLjVRrLUYYCTS2M" async defer></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDe9Z7EJMROLUEYOUe05zUnRFwxDrH56k0" async defer></script>
<?php get_footer(); <?php get_footer();
...@@ -3,6 +3,6 @@ Theme Name: Biuro ...@@ -3,6 +3,6 @@ Theme Name: Biuro
Author: Biuro Author: Biuro
Author URI: https://www.biuro.lt/ Author URI: https://www.biuro.lt/
Description: Biuro multiregion theme Description: Biuro multiregion theme
Version: 1.33.1 Version: 1.33.2
Text Domain: biuro Text Domain: biuro
*/ */
...@@ -23,7 +23,7 @@ versionAkismet=4.2.2; ...@@ -23,7 +23,7 @@ versionAkismet=4.2.2;
versionClassicWidgets=0.3; versionClassicWidgets=0.3;
versionGoogleSitemapGenerator=4.1.1; versionGoogleSitemapGenerator=4.1.1;
versionLocoTranslate=2.6.1; versionLocoTranslate=2.6.1;
versionPods=2.8.13; versionPods=2.8.15;
versionPolylang=3.2.1; versionPolylang=3.2.1;
versionSiteReviews=5.23.6; versionSiteReviews=5.23.6;
versionWordpressSeo=18.5.1; versionWordpressSeo=18.5.1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment