Help with preg_replace

As you said in your comment: I only want to remove 2 per post.For each post I get a line tht reads “The Post xxx appeared first on xxx” at the bottom of both the excerpt and full text. I’m glad you said so, regular expressions and XML parsing aren’t the nicest to deal with, … Read more

Wp redirect – reset password

(Revised answer) The problem with your code is that the password reset link/URL is missing the proper password reset key and user login slug — the $key (password reset key) and $user_login (user login slug) as you can see below, are both missing (i.e. not defined anywhere in your code): network_site_url(“wp-login.php?action=rp&key=$key&login=” . rawurlencode($user_login), ‘login’) So … Read more

Meta inserted through wp_insert_post gets messed up

So I ended up just adding the meta after inserting the post, which doesn’t give any error. It bypasses the problem without explaining it though… $postarr = array( ‘post_title’ => $link[‘caption’], ‘post_type’ => ‘ct_external_link’, ‘post_status’ => ‘publish’, ‘post_excerpt’ => $link[‘caption’], ); $external_link_id = wp_insert_post($postarr); if( !empty($external_link_id) ) { add_post_meta($external_link_id, ‘ct_external_link_url’, $doc[‘file’], true); if( isset($doc[‘hide’]) ) … Read more