ACF – Get unique values of array

Is correct to do this way? `<ul id=”filters” class=”clearfix”> <?php $taxonomy = ‘categoria_sistemas_sanitarios’; $terms = get_terms( $taxonomy ); $unique = array(); echo ‘<li><span class=”filter-‘. $title . ‘ active” data-filter=”‘; $li = ‘ ‘; foreach ( $terms as $term) { $li .= ‘.’ . $term->slug.’, ‘; } $li = rtrim($li, ‘, ‘); echo $li; echo ‘”>Todos … Read more

Get field in readable word

(Updated/new answer) How to make it show “United States (US)” instead, on the frontend, in a shortcode? First off, you got united-states (the country slug/key) instead of United States (US) (the country name) because your extrainfo_save_extra_user_profile_fields() function is saving the country slug/key instead of the country name. That’s not a problem, and I’d do the … Read more

custom fields anchor points php

What you wanna do is use the name attribute. <a href=”#my-anchor”>Link to the anchor</a> <p name=”my-anchor”>This is the anchor</p> Also, I would use something consistent, like the post/page slug to be able to link to each section. <?php global $post; ?> <div class=”guide-section” name=”<?php echo $post->post_name; ?>”> And then for your list use the slug … Read more

Custom plugin issue – Notice: Trying to get property of non-object in

try use global $post; at the beginning of your function Note that you’ve to run on a specific hook in order to work. see this post: https://www.ibenic.com/how-to-add-woocommerce-custom-product-fields/ function spinna360_nof() { $noy=array( ‘id’ => ‘_select_noi’, ‘label’ => __( ‘Select number of images: ‘, ‘spinna360’ ), ‘selected’ => true, ‘options’ => [ ’24’ => __( ’24’, ‘spinna360’ … Read more