| Server IP : 151.101.66.159 / Your IP : 216.73.216.66 Web Server : Flywheel/5.1.0 System : Linux wordpress 6.12.113+ #1 SMP Thu Oct 22 02:38:20 UTC 2026 x86_64 User : root ( ) PHP Version : 7.4.33.18 Disable Function : disk_free_space,diskfreespace,dl,exec,fpassthru,getmypid,getmyuid,highlight_file,link,opcache_compile_file,opcache_get_configuration,opcache_is_script_cached,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,phpinfo,popen,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,socket_listen,source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wp-content/plugins/pods/ui/admin/ |
Upload File : |
<?php
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
// phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
// Prevent non-admins.
if ( ! pods_is_admin( 'pods_settings' ) ) {
die( '-1' );
}
use Pods\Whatsit\Field;
wp_enqueue_script( 'pods' );
pods_form_enqueue_style( 'pods-form' );
/**
* Allow filtering the list of fields for the settings page.
*
* @since 2.8.0
*
* @param array $fields List of fields for the settings page.
*/
$fields = apply_filters( 'pods_admin_settings_fields', [] );
// Convert into Field objects.
foreach ( $fields as $key => $field ) {
if ( ! $field instanceof Field ) {
$field['name'] = ! empty( $field['name'] ) ? $field['name'] : $key;
$field = new Field( $field );
// Replace dependency logic with conditional logic.
$field->maybe_migrate_dependency();
$fields[ $key ] = $field;
}
}
if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'pods-settings' ) ) {
if ( isset( $_POST['pods_cache_flush'] ) ) {
// Handle clearing cache.
$api = pods_api();
$api->cache_flush_pods();
if ( defined( 'PODS_PRELOAD_CONFIG_AFTER_FLUSH' ) && PODS_PRELOAD_CONFIG_AFTER_FLUSH ) {
$api->load_pods( [ 'bypass_cache' => true ] );
}
pods_redirect( pods_query_arg( [ 'pods_cache_flushed' => 1 ], [ 'page', 'tab' ] ) );
} else {
// Handle saving settings.
$action = __( 'saved', 'pods' );
$params = pods_unslash( (array) $_POST );
$settings_to_save = [];
$layout_field_types = PodsForm::layout_field_types();
foreach ( $fields as $key => $field ) {
// Auto set the field name.
if ( ! isset( $field['name'] ) ) {
$field['name'] = $key;
}
// Skip layout field types.
if ( isset( $field['type'] ) && in_array( $field['type'], $layout_field_types, true ) ) {
continue;
}
$value = '';
if ( isset( $params[ 'pods_field_' . $field['name'] ] ) ) {
$value = $params[ 'pods_field_' . $field['name'] ];
} elseif ( 'boolean' === $field['type'] ) {
$value = '0';
}
$sanitize_callback = pods_v( 'sanitize_callback', $field, 'sanitize_text_field', true );
// Sanitize value if needed.
if ( is_callable( $sanitize_callback ) ) {
if ( is_array( $value ) ) {
$value = array_map( $sanitize_callback, $value );
} else {
$value = $sanitize_callback( $value );
}
}
$settings_to_save[ $field['name'] ] = $value;
}
if ( $settings_to_save ) {
pods_update_settings( $settings_to_save );
// Flush cache after changing settings.
pods_api()->cache_flush_pods();
// translators: %1$s is the settings label, %2$s is the action performed.
$message = sprintf( __( '<strong>Success!</strong> %1$s %2$s successfully.', 'pods' ), __( 'Settings', 'pods' ), $action );
pods_message( $message );
} else {
// translators: %1$s is the settings label, %2$s is the action performed.
$error = sprintf( __( '<strong>Error:</strong> %1$s %2$s successfully.', 'pods' ), __( 'Settings', 'pods' ), $action );
pods_message( $error, 'error' );
}
}
} elseif ( 1 === (int) pods_v( 'pods_cache_flushed' ) ) {
pods_message( __( 'Pods transients and cache have been cleared.', 'pods' ) );
}
$do = 'save';
?>
<h3><?php esc_html_e( 'Pods Cache Reset', 'pods' ); ?></h3>
<p><?php esc_html_e( 'You can clear all of the transients and object caches that are used by Pods and your site.', 'pods' ); ?></p>
<p class="submit">
<input type="submit" class="button button-secondary" name="pods_cache_flush"
value="<?php esc_attr_e( 'Clear Pods Cache', 'pods' ); ?>" />
</p>
<hr />
<div class="pods-submittable-fields pods-dependency">
<?php PodsForm::output_field( 'do', $do, 'hidden' ); ?>
<?php
foreach ( $fields as $key => $field ) {
// Auto set the field name.
if ( ! isset( $field['name'] ) ) {
$fields[ $key ]['name'] = $key;
}
// Skip if not hidden.
if ( 'hidden' !== $field['type'] ) {
continue;
}
$field['name_prefix'] = 'pods_field_';
// Output hidden field at top.
PodsForm::output_field( $field['name'], pods_get_setting( $field['name'], pods_v( 'default', $field ) ), 'hidden' );
// Remove from list of fields to render below.
unset( $fields[ $key ] );
}
?>
<table class="form-table pods-manage-field">
<?php
$field_prefix = 'pods_field_';
$field_row_classes = '';
$id = '';
$value_callback = static function ( $field_name, $id, $field, $pod ) {
return pods_get_setting( $field_name, pods_v( 'default', $field ) );
};
pods_view( PODS_DIR . 'ui/forms/table-rows.php', compact( array_keys( get_defined_vars() ) ) );
?>
</table>
<p class="submit">
<input type="submit" name="submit" id="submit" class="button button-primary"
value="<?php esc_attr_e( 'Save Settings', 'pods' ); ?>">
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
</p>
</div>
<script type="text/javascript">
jQuery( function( $ ) {
$( document ).Pods( 'validate' );
$( document ).Pods( 'dependency', true );
$( document ).Pods( 'qtip', '.pods-submittable' );
} );
</script>