A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

New answers tagged

0

Follow these instructions: Allow Users to Set Password During Registration


1

The best place to add this would be in the plugin's activation hook. You can either call the dynamic activate_{$plugin} hook, or better yet use the provided register_activation_hook method. Using your code example above - something like this would be what you're looking for: register_activation_hook( __FILE__, function() { $role = get_role( 'editor' );...


0

Cleanest way is to add CSS to your own column. In this case wp_enqueue_style(...); with: .column-purchased-leads { width: 74px; text-align: center } You'll get neat column as "Posts".


0

I have found the answer there: http://jhewitt.net/2018/12/improving-wordpress-speed-with-cloudflare-workers/ Using Workers you can examine a request for WP cookies and exclude it from the cache. This solution works well as I have implemented it.


0

Maybe they've already solved this issue. But, now I just wrote this and I decided to share it. <?php //Get role name by user ID if( !function_exists('get_user_role_name') ){ function get_user_role_name($user_ID){ global $wp_roles; $user_data = get_userdata($user_ID); $user_role_slug = $user_data->roles[0]; return ...


0

You should be able to use get_current_user_id(). Note that it will return '0' if the user isn't logged in. <a href="https://example.com/?user_id=<?php echo get_current_user_id(); ?>">Link</a> Update 2: Got bored, made a plugin: https://github.com/AndyMardell/append-user-id/releases/tag/v1.0.0-alpha Download the zip and install :) ...


0

In your sample code the $latest_posts is an instance of WP_Query class. If you want to get the latest post's date, you should do this: $latest_posts = new WP_Query( $args ); $last_date = ''; if ( $latest_posts->have_posts() ) { $latest_posts->the_post(); $last_date = get_the_date(); } return $last_date;


Top 50 recent answers are included