Removing comment lines from all enqueued js files using a filter function
Removing comment lines from all enqueued js files using a filter function
Removing comment lines from all enqueued js files using a filter function
Child theme overirde template-tags in a theme built on underscores in inc/template-tags
Best way to use variables in multiple functions?
You have to think into the opposite direction: Don’t pull the variables from the template, push them into it. Templates should be as simple as possible, the shouldn’t know anything about the content of the rest of your code, for example function names. In other words: use hooks. In your template: // the numbers are … Read more
You can check the current user role in the same action and apply “display none” for that specific user role $user = wp_get_current_user(); if ( in_array( ‘author’, (array) $user->roles ) ) { //The user has the “author” role }
Deleting guests profile users after 1.5 hours
Your code is fine to me, except you made a mistake here: template_redirect(‘/product/channel-mcgilchrist’); WordPress does not have a function named template_redirect, only a hook with that name. So you should have used either wp_redirect() or wp_safe_redirect() which are valid functions to perform URL/page redirections in WordPress. wp_safe_redirect( ‘/product/channel-mcgilchrist’ );
Class parameter in get_avatar args doesn’t get added to output
custom error message for empty username and password using authenticate filter not working
add_action(‘wpcf7_mail_sent’, function ($cf7) { $submission = WPCF7_Submission::get_instance(); $data = $submission->get_posted_data(); if( empty($data[‘_wpcf7_container_post’]) ) return; $post_id = (int) $data[‘_wpcf7_container_post’]; wp_remove_object_terms( $post_id, ‘available’, ‘category’); wp_set_object_terms( $post_id, ‘booked’, ‘category’); });