I assume that you’re trying to set the “points” user meta value to 1000 when the user logs in for the first time, is that correct?
I also assume that that field is empty or 0 when the user registers, and that’s why your code does not work. Change
if( $first_login == '1' ) {
to
if( ! $first_login ) {
if that is the case. If it’s not, please add more details to the question, it’s hard to take a stab in the dark.
Related Posts:
- Add self-closing shortcode button to TinyMCE in WP 4.6
- How Do I Use jQuery UI In My Plugin
- Checking if a file is already in the Media Library
- How to implement add_image_size in a plugin
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- How to make dynamically-generated content searchable in WordPress?
- Nav Menu meta failing to import
- How can I track active users of my plugin? and why doesn’t WordPress.Org offer this?
- Is it possible to remove next-post / previous-post with out creating a custom template?
- Escaping built-in WP function return strings
- Custom Rewriting to Plugin with Parameters
- Help adding image upload functionality to widget
- ERROR: Options page not found – saving settings page with tabs
- The plugin generated 80 characters of unexpected output!
- Script won’t load via plugin class
- What’s the Right Way to get and save remote data for a Gutenberg block?
- How to override a function call in functions.php?
- Is there a need to do apply_filter(‘widget_title’, $instance[‘title’]) or any other ‘widget_xxx’ filters?
- Passing array of strings to a SQL statement in a WordPress plugin
- Add multiple shipping rates from add_rate function with custom ID
- How can I render shortcode so that its not cached by Caching plugins?
- Does WordPress support WebP images?
- Filter, or any way to dynamically change theme screenshot image?
- Sidebar widget to show popular post not working?
- WP_Query returns no results
- On Plugin Activation, How Do I Check for Proper Transport Mechanism?
- Show add_meta_box by selecting a specific category
- Is It Always a Best Practice to Decouple the Frontend from the Admin Area When Developing a WordPress Application?
- How to render a time-of-day string like ’16:42′ with a site’s chosen time format?
- Are block templates incompatible with serialize_blocks?
- Will setcookie work if there is a cache plugin installed?
- Adding settings link to plugin doesn’t work
- Check Paypal Purchase is Success or Not in Easy Digital Download Plugin
- Render content after post title in wp-admin
- WordPress clean internationalization for menus?
- Dashboard – get status and position of metaboxes and pass them to ajax method
- Is it possible to install a theme via a plugin?
- W3 Total Cache JS and css Minify folder are empty
- Form doesnt save to database
- Wp_list_table search box not working for custom value from database
- Notice: Trying to get property ‘term_id’ of non-object
- javascript datatables in a plugin
- How to add user details to different tables immediately after user registration
- How to change the column label in screen options for a custom column?
- Including comments meta box on a plugin page
- include php file if page_id matches
- Optimising a big WordPress site
- How to create custom settings page for custom plugin
- Why wp_die() doesn’t work with wp_redirect but exit() works
- Is it possible to abort post update if specific conditions on metadata are met?
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- Taxonomies within plugin invalid
- Category select options for plugin settings
- shortcode executed in the page editor
- Plugin header: WP and PHP version control uses wp_die(), can I change that?
- Completely isolate a plugin view so it doesn’t load the theme
- Does is_admin() really provide a plugin performance improvement?
- Enqueueing common php scripts in a plugin
- How to translate wordpress backend to another language
- How can I save a password securely as a settings field
- How to localize data array in plugin’s option page
- Changing permalink structure breaks link to .php file which generates files dynamically
- rewrite_rules problem
- Decontruct serialized data array from wp_options
- Custom post type change permalink query
- Upload product image from frontside for administrator only
- $wpbd->insert_id is returning null
- Allowing duplicating users with same user_login and user_email
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- Redirect WooCommerce checkout to cart
- Initializing rest endpoint issue
- Plugin Activation Causes wp_register errors
- WordPress plugin how to run function when button is clicked
- How to get values from Tinymce visual editor popup?
- How to display archive by selecting year and then selecting month
- Ajax call not working with
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- Undefined notice on unset field
- Theming Custom Plugin Page
- From my Plugin Settings Page use check boxes to load specific css files (e.g. Bootstrap / Foundation)
- Script work on non logged in user but not work for logged in user?
- Sessions in plugin development?
- Can wp_schedule_single_event be used to run background proccess?
- Is it possible to make WordPress as a RESTful app?
- List all content by post type
- Best Way to Grab Post ID from Plugin
- Get user logged in status from within a plugin. $current_user not defined
- Widget plugin and input file
- How to inject html to every page with a plugin?
- Custom plugin not appearing
- Gutenberg’s Popover component position relative to the focused element
- How to replace plugin icon?
- How to change the headline title for an admin page in a plugin?
- Personalized URL for non-logged in WordPress
- WordPress Breadcrumb Taxonomy Display
- Adding custom avatar field to comments
- i want to auto create pages with shortcode when plugin is activated and delete when deactivated
- Is using upgrader_process_complete the correct way to perform plugin updates?
- Load images from CDN and custom features to “Add Media” dialogue
- Saving metabox updates causing fatal error