Checking if the data already exsis in the wp database – custom plugin

You can improve your code a lot. I’ll treat the email address as the student’s unique identification, since I can definitely have 2 students named ‘John Doe’. global $wpdb; $tablename = $wpdb->prefix.”students”; if(isset($_POST[‘submit’])){ $name = esc_attr($_POST[‘firstname’]); $surname = esc_attr($_POST[‘lastname’]); $email = sanitize_email($_POST[’email’]); if(!is_email($email)) { //Display invalid email error and exit echo ‘<div class=”error”><p>Invalid e-mail!</p></div>’; //return … Read more

WPML – Auto Duplicate Post Issue

The problem is that you are unsetting the default language form $langs array, so when you loop over $langs to make the duplicates, the default language is never included. This may be the cause of your problem (nothing to do with WordPress by the way). function wpml_duplicate_on_publish($post_id) { global $post, $sitepress, $iclTranslationManagement; // don’t save … Read more

Duplicated WordPress Site STILL Linked to Old Site

Turns out I was the culprit after all. I searched through all my files for domain1.com and sure enough on lines 7/8 of wp-config.php, I found these lines (which I completely forgot about): define( ‘WP_CONTENT_URL’, ‘http://domain1.com/customlogin’ ); define( ‘WP_CONTENT_DIR’, ‘/user/domain1.com/customlogin’ );

How to remove Base URL Duplication?

I just examined your URL http://www.homecredit.ph/wp-content/uploads/home1/homecre1/public_html/files/News-26.jpg and code and noticed that, you are saving your image in http://www.homecredit.ph/files/News-26.jpg path but trying to access from upload directory of WordPress. /home1/homecre1/public_html/files/News-26.jpg – this is the path stored in database for your attachment ID. /home1/homecre1/public_html/ – This is your root directory where WordPress installed. So better save only … Read more