NEWS

Atelier de création composé du duo de directeurs artistiques Virginie Sala et Thomas Desgrippes
read more
Nouveau site, nouvelle identité pour la Fédération Française du Paysage.
read moreNotice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
To update field link, we have to use an array :
1 2 3 4 5 6 7 8 9 10 |
<?php $site = array( 'title' => $my_title, 'url' => $my_url, 'target' => "_blank", ); update_field('site', $site, 'user_' . $user_id); ?> |
read more
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
I recently tried to use screen options for a wordpress backend plugin. I wanted to use a per page variable to be able to easily manage a number of users to request. I first init the screen options :
1 2 3 4 5 6 7 8 |
add_action('my_plugin_slug', array( $this, 'screen_set_option')); function screen_set_option() { add_screen_option('per_page', array( 'default'=>10, 'label'=>__('Users per page', 'my_domain'), 'option'=>'users_per_page')); } |
But then I couldn’t find a way to make the filter set-screen-option to work. This […]
read moreNotice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/tigerbal/www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Get membership object from user id
1 2 3 |
function get_membership($user_id) { return wc_memberships()->get_user_memberships_instance()->get_user_memberships( $user_id )[0] ??null; } |
Get member id from user id
1 2 3 4 5 |
function get_member_id($user_id) { if (get_membership($user_id)) return get_membership($user_id)->get_id(); else return null; } |
Get subscription id from member id
1 2 3 4 |
function get_subscription_id($member_id) { $subscription_id = get_post_meta( $member_id, '_subscription_id', true ); return $subscription_id; } |
read more