php dynamic content inside shortcode
php dynamic content inside shortcode
php dynamic content inside shortcode
You can exclude certain roles like this: 1- Create a function to check if the current user role is excluded: function isPasswordValidationSkipped() { // Fill this array with roles that you want to exclude from password validation $excludedRoles = [‘subscriber’]; $user = wp_get_current_user(); foreach ($user->roles as $role) { if(in_array($role, $excludedRoles)) { return true; } } … Read more
Here is a way to achieve the validation while typing the value in the ACF field, put the code inside your theme’s functions.php or create a plugin for it: You will need to change the $fieldName, $fieldKey properties values to the correct values of your field —they are the field name and field key of … Read more
REST api returns 404 on some WordPress sites
error in my request with meta_key and meta_value
Filter wordpress posts without searching the keywords in the post content
How to update ticket price programatically when adding to cart and checkout in woocommerce
How to Add a cutsom slug to my custom author role
Adding wp users ID into a link address from a DIVI modul
You can always do a var_dump() of $current_user to see what it contains. You’ll see there is a similar property to user_firstname: user_lastname. You’ll probably want a space between the first and last name, so a small edit should add the last name: function custom_shortcode_func() { ob_start(); $current_user = wp_get_current_user(); echo ‘Willkommen ‘ . $current_user->user_firstname … Read more