Skip to content

Commit

Permalink
Merge branch 'release/3.0.9' into feature/support-disabling-quick-edit
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark authored Dec 7, 2023
2 parents fabc03c + 6917ebe commit 2b683ba
Show file tree
Hide file tree
Showing 25 changed files with 555 additions and 1,760 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/wporg-replace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ on:
description: 'Minimum PHP version'
required: false
jobs:
prepare_release:
wporg_replace:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: What are we doing?
run: |
echo plugin_version: ${{ github.event.inputs.plugin_version }}
echo tested_wp_version: ${{ github.event.inputs.tested_wp_version }}
echo minimum_wp_version: ${{ github.event.inputs.minimum_wp_version }}
echo minimum_php_version: ${{ github.event.inputs.minimum_php_version }}
- name: Checkout the code
uses: actions/checkout@v4
- name: Run wporg-replace
uses: sc0ttkclark/wporg-replace@v1.0.0
uses: sc0ttkclark/wporg-replace@v1.0.6
with:
plugin_version: ${{ github.event.inputs.plugin_version }}
plugin_version_constant_name: ${{ env.WPORG_PLUGIN_VERSION_CONSTANT_NAME }}
Expand Down
60 changes: 0 additions & 60 deletions Gruntfile.js

This file was deleted.

23 changes: 18 additions & 5 deletions classes/PodsAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -5464,7 +5464,11 @@ public function save_pod_item( $params ) {
|| $save_non_simple_to_table
)
) {
$value_data = $this->prepare_tableless_data_for_save( $pod, $field_data, $value, compact( $pieces ) );
try {
$value_data = $this->prepare_tableless_data_for_save( $pod, $field_data, $value, compact( $pieces ) );
} catch ( Throwable $throwable ) {
return pods_error( $throwable->getMessage(), $error_mode );
}
}

// Prepare all table / meta data.
Expand Down Expand Up @@ -5991,10 +5995,19 @@ public function prepare_tableless_data_for_save( $pod, $field, $values, $pieces
if ( empty( $v ) ) {
try {
$v = pods_attachment_import( $v );
} catch ( Exception $exception ) {
pods_debug_log( $exception );

continue;
} catch ( Throwable $throwable ) {
pods_debug_log( $throwable );

throw new Exception(
sprintf(
// translators: %1$s is the field label, %2$s is the file value.
__( 'Pods file field error for field "%1$s" - Unable to import file from: %2$s', 'pods' ),
esc_html( $field->get_label() ),
esc_html( $v )
),
500,
$throwable
);
}
}
} elseif ( $search_data ) {
Expand Down
6 changes: 3 additions & 3 deletions classes/PodsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function admin_menu() {
if ( 'edit' === pods_v( 'action', 'get', 'manage' ) ) {
$all_title = pods_v( 'label_edit_item', $pod['options'], __( 'Edit', 'pods' ) . ' ' . $singular_label );
} elseif ( 'add' === pods_v( 'action', 'get', 'manage' ) ) {
$all_title = pods_v( 'label_add_new_item', $pod['options'], __( 'Add New', 'pods' ) . ' ' . $singular_label );
$all_title = pods_v( 'label_add_new_item', $pod['options'], sprintf( __( 'Add New %s', 'pods' ), $singular_label ) );
}
}

Expand All @@ -307,8 +307,8 @@ public function admin_menu() {
add_menu_page( $page_title, $menu_label, 'read', $parent_page, '', $menu_icon, $menu_position );
}

$add_title = pods_v( 'label_add_new_item', $pod['options'], __( 'Add New', 'pods' ) . ' ' . $singular_label );
$add_label = pods_v( 'label_add_new', $pod['options'], __( 'Add New', 'pods' ) );
$add_title = pods_v( 'label_add_new_item', $pod['options'], sprintf( __( 'Add New %s', 'pods' ), $singular_label ) );
$add_label = pods_v( 'label_add_new', $pod['options'], sprintf( __( 'Add New %s', 'pods' ), $singular_label ) );

add_submenu_page(
$parent_page, $add_title, $add_label, 'read', $page, array(
Expand Down
2 changes: 1 addition & 1 deletion classes/PodsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public function select( $params ) {

// Cache if enabled.
if ( false !== $cache_key ) {
pods_view_set( $cache_key, $results, pods_v( 'expires', $params, 0, false ), pods_v( 'cache_mode', $params, 'cache', true ), 'pods_data_select' );
pods_view_set( $cache_key, $results, (int) pods_v( 'expires', $params, 0, false ), pods_v( 'cache_mode', $params, 'cache', true ), 'pods_data_select' );
}
}//end if

Expand Down
2 changes: 1 addition & 1 deletion classes/PodsInit.php
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ public static function object_label_fix( $args, $type = 'post_type' ) {
if ( 'post_type' === $type ) {
$labels['menu_name'] = strip_tags( pods_v( 'menu_name', $labels, $label, true ) );
$labels['name_admin_bar'] = pods_v( 'name_admin_bar', $labels, $singular_label, true );
$labels['add_new'] = pods_v( 'add_new', $labels, __( 'Add New', 'pods' ), true );
$labels['add_new'] = pods_v( 'add_new', $labels, sprintf( __( 'Add New %s', 'pods' ), $singular_label ), true );
$labels['add_new_item'] = pods_v( 'add_new_item', $labels, sprintf( __( 'Add New %s', 'pods' ), $singular_label ), true );
$labels['new_item'] = pods_v( 'new_item', $labels, sprintf( __( 'New %s', 'pods' ), $singular_label ), true );
$labels['edit'] = pods_v( 'edit', $labels, __( 'Edit', 'pods' ), true );
Expand Down
4 changes: 2 additions & 2 deletions classes/PodsUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public function setup( $options ) {
$options->validate(
'heading', array(
'manage' => pods_v( 'label_manage', $this->label, __( 'Manage', 'pods' ) ),
'add' => pods_v( 'label_add_new', $this->label, __( 'Add New', 'pods' ) ),
'add' => pods_v( 'label_add_new', $this->label, sprintf( __( 'Add New %s', 'pods' ), $options->item ) ),
'edit' => pods_v( 'label_edit', $this->label, __( 'Edit', 'pods' ) ),
'duplicate' => pods_v( 'label_duplicate', $this->label, __( 'Duplicate', 'pods' ) ),
'view' => pods_v( 'label_view', $this->label, __( 'View', 'pods' ) ),
Expand All @@ -769,7 +769,7 @@ public function setup( $options ) {
$options->validate(
'label', array(
'add' => pods_v( 'label_add_new_item', $this->label, sprintf( __( 'Add New %s', 'pods' ), $options->item ) ),
'add_new' => pods_v( 'label_add_new', $this->label, __( 'Add New', 'pods' ) ),
'add_new' => pods_v( 'label_add_new', $this->label, sprintf( __( 'Add New %s', 'pods' ), $options->item ) ),
'edit' => pods_v( 'label_update_item', $this->label, sprintf( __( 'Update %s', 'pods' ), $options->item ) ),
'duplicate' => pods_v( 'label_duplicate_item', $this->label, sprintf( __( 'Duplicate %s', 'pods' ), $options->item ) ),
'delete' => pods_v( 'label_delete_item', $this->label, sprintf( __( 'Delete this %s', 'pods' ), $options->item ) ),
Expand Down
6 changes: 3 additions & 3 deletions classes/PodsView.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public static function clear( $key = true, $cache_mode = null, $group = '' ) {
$wpdb->query( "DELETE FROM `{$wpdb->options}` WHERE option_name LIKE '_transient_{$group_key}%'" );

if ( $object_cache_enabled ) {
if ( $group && function_exists( 'wp_cache_flush_group' ) ) {
if ( $group && function_exists( 'wp_cache_flush_group' ) && wp_cache_supports( 'flush_group' ) ) {
wp_cache_flush_group( $group );
} else {
wp_cache_flush();
Expand All @@ -618,7 +618,7 @@ public static function clear( $key = true, $cache_mode = null, $group = '' ) {
$wpdb->query( "DELETE FROM `{$wpdb->options}` WHERE option_name LIKE '_site_transient_{$group_key}%'" );

if ( $object_cache_enabled ) {
if ( $group && function_exists( 'wp_cache_flush_group' ) ) {
if ( $group && function_exists( 'wp_cache_flush_group' ) && wp_cache_supports( 'flush_group' ) ) {
wp_cache_flush_group( $group );
} else {
wp_cache_flush();
Expand All @@ -633,7 +633,7 @@ public static function clear( $key = true, $cache_mode = null, $group = '' ) {
}
} elseif ( 'cache' === $cache_mode && $object_cache_enabled ) {
if ( true === $key ) {
if ( $group && function_exists( 'wp_cache_flush_group' ) ) {
if ( $group && function_exists( 'wp_cache_flush_group' ) && wp_cache_supports( 'flush_group' ) ) {
wp_cache_flush_group( $group );

self::reset_cached_keys( $cache_mode, $group );
Expand Down
19 changes: 16 additions & 3 deletions includes/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -1337,21 +1337,34 @@ function pods_shortcode( $tags, $content = null ) {

try {
$return = pods_shortcode_run( $tags, $content );
} catch ( Exception $exception ) {
} catch ( Throwable $throwable ) {
/**
* Allow filtering whether to throw errors for the shortcode.
*
* @since 3.0.9
*
* @param bool $throw_errors Whether to throw errors for the shortcode.
*/
$throw_errors = apply_filters( 'pods_shortcode_throw_errors', false );

if ( $throw_errors ) {
throw $throwable;
}

$return = '';

if ( pods_is_debug_display() ) {
$return = pods_message(
sprintf(
'<strong>%1$s:</strong> %2$s',
esc_html__( 'Pods Renderer Error', 'pods' ),
esc_html( $exception->getMessage() )
esc_html( $throwable->getMessage() )
),
'error',
true
);

$return .= '<pre style="overflow:scroll">' . esc_html( $exception->getTraceAsString() ) . '</pre>';
$return .= '<pre style="overflow:scroll">' . esc_html( $throwable->getTraceAsString() ) . '</pre>';
} elseif (
is_user_logged_in()
&& (
Expand Down
4 changes: 2 additions & 2 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Pods - Custom Content Types and Fields
* Plugin URI: https://pods.io/
* Description: Pods is a framework for creating, managing, and deploying customized content types and fields
* Version: 3.0.8
* Version: 3.0.9-a-2
* Author: Pods Framework Team
* Author URI: https://pods.io/about/
* Text Domain: pods
Expand Down Expand Up @@ -43,7 +43,7 @@
add_action( 'init', 'pods_deactivate_pods_ui' );
} else {
// Current version.
define( 'PODS_VERSION', '3.0.8' );
define( 'PODS_VERSION', '3.0.9-a-2' );

// Current database version, this is the last version the database changed.
define( 'PODS_DB_VERSION', '2.3.5' );
Expand Down
Loading

0 comments on commit 2b683ba

Please sign in to comment.