Insert data in database using form

The two variables $name and $email are unknown inside the function. You have to make them globally available inside it by changing global $wpdb into global $wpdb, $name, $email: require_once(‘../../../wp-load.php’); /** * After t f’s comment about putting global before the variable. * Not necessary (http://php.net/manual/en/language.variables.scope.php) */ global $name = $_POST[‘name’]; global $email = $_POST[’email’]; … Read more

WordPress Unit Testing – Cannot Create Tables

You’ve just discovered an important feature of the core test suite: it forces any tables created during the test to be temporary tables. If you look in the WP_UnitTestCase::setUp() method you’ll see that it calls a method called start_transaction(). That start_transaction() method starts a MySQL database transaction: function start_transaction() { global $wpdb; $wpdb->query( ‘SET autocommit … Read more

Removing filter dropdown in posts table (in this case Yoast SEO)

These additional dropdowns are added via the restrict_manage_posts action hook. This means the dropdown output isn’t filterable, but you can remove the hooked action from Yoast SEO. The filter dropdown is added by the posts_filter_dropdown() method in the WPSEO_Metabox class. It’s added in the setup_page_analysis() method of the same class, which is hooked into admin_init … Read more

What is the use of to_ping and pinged column?

to_ping is a list of URLs WordPress should send pingbacks to. pinged is a list of URLs WordPress has sent pingbacks to. Do not use these fields for something else. They are parsed many times in core code (69 matches for to_ping); their format is fixed. You cannot reduce the query load by using these … Read more