Sending WordPress database information to cross domain the safe way?

If you have to do this with php then you are going to want to use the WP_Http class. Specifically, you’ll probably want to use wp_remote_post(). Something like this should get you started. function pushData($data){ //data is an associative array of the things you want to send $url = “https://yourhost.com/your_catch_script.php”; return wp_remote_post($url, array( ‘method’ => … Read more

live site do not update after importing sql database

I had something similar, entries of some post types didnt show. If your posts have the same IDs between dev/live environment, get the edit URL and replace the ID to see if it loads. Like : http://yoursite.com/wp-admin/post.php?post=23&action=edit Replace the ID (here ’23’) by the ID of the post/page/anythingelse you cannot see in live. If this … Read more

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

#1115 – Unknown character set: ‘utf8mb4’

WordPress does not support MySQL 4 : To run WordPress your host just needs a couple of things: MySQL version 5.0 or greater (recommended: MySQL 5.5 or greater) https://wordpress.org/about/requirements/ While the utf8mb4 encoding is recent change and you might work around it, overall you still need compatible MySQL version.

Saving custom term value to the database in new table

short exmaple how i do it… (tables naming not really correct.) in this example i am trying to save _description $_POST variable. add_action ( ‘edited_term’, ‘custom_edited_term’, 10, 3); function custom_edited_term($term_id, $tt_id, $taxonomy){ if ( defined(‘DOING_AJAX’) || defined(‘DOING_CRON’) ) return; $_POST = stripslashes_deep($_POST); if (isset($_POST[‘_description’]) && trim($_POST[‘_description’]) != ”){ update_term_meta($term_id, ‘_description’, trim($_POST[‘_description’])); } else { delete_term_meta($term_id, … Read more

Apache Redirect based on WordPress permissions

What you’re describing is likely best done in a simple WordPress plugin. You’re user roles are already stored in WordPress, so a plugin to do this is likely only a few lines long. Also an existing plugin like File Away may accomplish what your attempting. This plugin surfaced when I did a plugin search for … Read more