Server IP : 104.21.14.103 / Your IP : 3.147.28.206 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/sieuthiweb.com.vn/wp-content/plugins/wpai-acf-add-on/helpers/ |
Upload File : |
<?php if ( ! function_exists('pmai_get_join_attr') ) { /** * @param bool $attributes * @return string */ function pmai_get_join_attr($attributes = false ) { // validate if( empty($attributes) ) { return ''; } // vars $e = array(); // loop through and render foreach( $attributes as $k => $v ) { $e[] = $k . '="' . esc_attr( $v ) . '"'; } // echo return implode(' ', $e); } } if ( ! function_exists('pmai_join_attr') ) { /** * @param bool $attributes */ function pmai_join_attr($attributes = false ){ echo pmai_get_join_attr( $attributes ); } } if ( ! function_exists('pmai_get_acf_group_by_slug') ) { function pmai_get_acf_group_by_slug( $slug ) { $local_groups = acf_get_local_field_groups(); if ( ! empty( $local_groups[ $slug ] ) ) { $group = new stdClass(); $group->ID = $slug; return $group; } if (!empty($local_groups)) { foreach ($local_groups as $local_group) { if (isset($local_group['id']) && $local_group['id'] == $slug) { $group = new stdClass(); $group->ID = $slug; return $group; } } } global $wpdb; $group = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->posts} WHERE {$wpdb->posts}.post_type = %s AND {$wpdb->posts}.post_excerpt = %s", 'acf-field-group', $slug )); if ( ! empty($group) ) { return $group; } return false; } }