FIXED query problem
This commit is contained in:
parent
807b1d5796
commit
0f6023a27b
1 changed files with 10 additions and 8 deletions
|
|
@ -4,7 +4,7 @@
|
|||
* Plugin Name: Efabi.net Core Plugin
|
||||
* Plugin URI: https://github.com/rpi-virtuell/rpi-newsletter
|
||||
* Description: Efabi.net Hauptplugin
|
||||
* Version: 1.0
|
||||
* Version: 1.1
|
||||
* Author: reintanz
|
||||
* Author URI: https://github.com/FreelancerAMP
|
||||
* License: GPL2 or later
|
||||
|
|
@ -14,8 +14,8 @@ class EfabiNetCore
|
|||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
add_action('wp_login', array($this, 'register_new_user_on_login'));
|
||||
add_shortcode('efabinetcore_debug', array($this, 'register_new_user_on_login'));;
|
||||
}
|
||||
|
||||
public function register_new_user_on_login()
|
||||
|
|
@ -27,20 +27,22 @@ class EfabiNetCore
|
|||
'numberposts' => -1,
|
||||
'meta_query' =>
|
||||
array(
|
||||
'key' => 'user_id',
|
||||
'value' => $user->ID,
|
||||
'compare' => '='
|
||||
array(
|
||||
'key' => 'user_id',
|
||||
'value' => $user->ID,
|
||||
'compare' => '='
|
||||
)
|
||||
)
|
||||
);
|
||||
$profil = get_posts($args);
|
||||
if (count($profil) == 0) {
|
||||
$profile = get_posts($args);
|
||||
if (count($profile) == 0) {
|
||||
// Kein Profil gefunden, neues Profil erstellen
|
||||
$new_profil = array(
|
||||
'post_title' => $user->user_login,
|
||||
'post_status' => 'publish',
|
||||
'post_type' => 'profil',
|
||||
);
|
||||
|
||||
|
||||
$new_profil = wp_insert_post($new_profil);
|
||||
add_post_meta($new_profil, 'user_id', $user->ID);
|
||||
add_post_meta($new_profil, 'email', $user->user_email);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue