plugin updates

This commit is contained in:
Tony Volpe
2024-07-16 13:57:46 +00:00
parent 41f50eacc4
commit 8f93917880
1529 changed files with 259452 additions and 25451 deletions

View File

@@ -682,27 +682,32 @@ function acf_verify_nonce( $value ) {
}
/**
* acf_verify_ajax
*
* This function will return true if the current AJAX request is valid
* Returns true if the current AJAX request is valid.
* It's action will also allow WPML to set the lang and avoid AJAX get_posts issues
*
* @since 5.2.3
*
* @param n/a
* @return (boolean)
* @param string $nonce The nonce to check.
* @param string $action The action of the nonce.
* @return boolean
*/
function acf_verify_ajax() {
// bail early if not acf nonce
if ( empty( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( $_REQUEST['nonce'] ), 'acf_nonce' ) ) {
function acf_verify_ajax( $nonce = '', $action = '' ) {
// Bail early if we don't have a nonce to check.
if ( empty( $nonce ) && empty( $_REQUEST['nonce'] ) ) {
return false;
}
// action for 3rd party customization
$nonce_to_check = ! empty( $nonce ) ? $nonce : $_REQUEST['nonce']; // phpcs:ignore WordPress.Security -- We're verifying a nonce here.
$nonce_action = ! empty( $action ) ? $action : 'acf_nonce';
// Bail if nonce can't be verified.
if ( ! wp_verify_nonce( sanitize_text_field( $nonce_to_check ), $nonce_action ) ) {
return false;
}
// Action for 3rd party customization (WPML).
do_action( 'acf/verify_ajax' );
// return
return true;
}
@@ -1361,22 +1366,26 @@ function acf_get_grouped_posts( $args ) {
return $data;
}
function _acf_orderby_post_type( $ordeby, $wp_query ) {
// global
/**
* The internal ACF function to add order by post types for use in `acf_get_grouped_posts`
*
* @param string $orderby The current orderby value for a query.
* @param object $wp_query The WP_Query.
* @return string The potentially modified orderby string.
*/
function _acf_orderby_post_type( $orderby, $wp_query ) {
global $wpdb;
// get post types
$post_types = $wp_query->get( 'post_type' );
// prepend SQL
// Prepend the SQL.
if ( is_array( $post_types ) ) {
$post_types = array_map( 'esc_sql', $post_types );
$post_types = implode( "','", $post_types );
$ordeby = "FIELD({$wpdb->posts}.post_type,'$post_types')," . $ordeby;
$orderby = "FIELD({$wpdb->posts}.post_type,'$post_types')," . $orderby;
}
// return
return $ordeby;
return $orderby;
}
function acf_get_post_title( $post = 0, $is_search = false ) {
@@ -3109,28 +3118,19 @@ function acf_is_row_collapsed( $field_key = '', $row_index = 0 ) {
}
/**
* acf_get_attachment_image
* Return an image tag for the provided attachment ID
*
* description
* @since 5.5.0
* @deprecated 6.3.2
*
* @since 5.5.0
*
* @param $post_id (int)
* @return $post_id (int)
* @param integer $attachment_id The attachment ID
* @param string $size The image size to use in the image tag.
* @return false
*/
function acf_get_attachment_image( $attachment_id = 0, $size = 'thumbnail' ) {
// vars
$url = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
$alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true );
// bail early if no url
if ( ! $url ) {
return '';
}
// return
$value = '<img src="' . $url . '" alt="' . $alt . '" />';
// report function as deprecated
_deprecated_function( __FUNCTION__, '6.3.2' );
return false;
}
/**