Admin approval for editing user profile

The update_option() function has a filter for that: $value = apply_filters( “pre_update_option_{$option}”, $new_value, $old_value ); Immediately after that filter, there’s another filter that you do not want to use. $value = apply_filters( ‘pre_update_option’, $value, $option, $old_value ); (If you would use that, you will have to check the option name inside the callback, which adds … Read more

Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]

If you’r using ACF plugin you should look the documentation first, here’s relevant ACF saves taxonomies terms meta to options table, and they can be accesed using get_field( “{$field_key}”, “{$term->taxonomy}_{$term->term_id}” ); So in you’r example it would be: $image = get_field( ‘featured_image’, ‘product-category_’ . $product_category[0]->term_id );

ACF no print data [closed]

I assume you want the field for the current category archive, not the category of the post inside the loop? Try get_queried_object_id() instead of the_category_ID( $echo ). In single.php, you just need a slightly different iteration of your original attempt: if ( $terms = get_the_category() ) the_field( ‘bgcolor’, ‘category_’ . $terms[0]->term_id );

Conditional custom redirect

It should not be tough. As you suggested you can use ACF to add a custom field in post/page and then use the template_redirect action hook to check if the current page’s custom field is a valid URL as well as $_GET[‘redirect’] is true, wp_redirect to that URL. function my_page_template_redirect() { if( is_url(GET_ACF_FIELD_VALUE( ‘CUSTOM_FIELD’ )) … Read more

Random images with no duplicates (ACF Gallery) [closed]

Use array_unique() before foreach: Edited: <?php while ( have_posts() ) : the_post(); $images = get_field(‘gallery’); // thumbnail if( $images ): ?> <ul id=”container” class=”tiles-wrap animated”> <?php $images = array_rand($images); $images = array_unique($images); foreach( $images as $image ): // $rand_class = array(‘small’, ‘medium’, ‘large’); $size=”medium”; $thumb = $image[‘sizes’][ $size ]; $width = $image[‘sizes’][ $size . ‘-width’ … Read more