Get user custom field value on function.php

EDIT I think the solution given by @dboris may work. Alternatively you could try to hook your email sending after the user registration like this global $uID; //to keep the value to reuse it later, null at this step function mailInscriptionSecteurRhone() { global $uID; $user_ID = $uID; $headers = array(‘Content-Type: text/html; charset=UTF-8’); $candidat = get_userdata( … Read more

WordPress produces identical hash all the time

The point of hashing a password when storing it in the DB is that it will not be disclosed if anyone got a dump of the DB. There has to be a 1:1 relationship between the password and the hash here as you need to be able to compute the hash of a given password … Read more

PHP Strict Standards: Only variables should be assigned by reference

The issue is caused by the arguments for separate_comments being passed by-reference. Source: function separate_comments(&$comments). This means passing a function as an argument is restricted. To resolve the issue you need to assign the get_comments function results to a variable. $comments = get_comments(‘status=approve&post_id=’ . $id); $comments_by_type = separate_comments($comments); return count($comments_by_type[‘comment’]);

Include style.css in the Child Theme with PHP

You posted in a comment that the current theme uses the following code in its header.php <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/318269/<?php bloginfo(“template_url’); ?>/style.css” type=”text/css” media=”screen”/> This is not WordPress best practice and hence the linked tutorials fail you. How to go on from this? Copy header.php from parent to child theme, remove the line containing style.css, then … Read more

Background Music WP [closed]

I would do your best to talk them out of it. https://moz.com/blog/how-to-convince-a-client-their-site-doesnt-need-music If all else fails <audio src=”https://wordpress.stackexchange.com/questions/318546/horse.ogg” controls> Your browser does not support the audio element. </audio> https://www.w3schools.com/tags/att_audio_src.asp

Template Loop – add switch case php

if ( $query->have_posts() ) : ?> <ul id=”list-con”> <?php while ($query->have_posts()) : $query->the_post(); ?> <?php switch ( get_post_type( $post->ID ) ) { case “firstcase”: ?> <li>code as defined above</li> <?php break; case “secondcase”: ?> <li>another code as defined above</li> <?php break; } ?> <?php endwhile; ?> </ul> <?php endif;

Shortcode not working – quotes seems strange

You need to use “, and not ”. They’re different characters. You can end up with the latter if you’ve copied them from a forum or blog post where the writer’s CMS converts ” to ‘fancy quotes’. Just delete the quote marks and type them again yourself, or if that doesn’t work, just copy them … Read more