Notification When Post Approved

You can use publish_post action hook for notifying post author. function wpcs_author_notification( $post_id ) { $post = get_post( $post_id ); $author = get_userdata( $post->post_author ); $message = “Hi ” . $author->display_name . “, Your post, ” . $post->post_title . ” has just been published at ” . get_permalink( $post_id ); wp_mail( $author->user_email, “Your article is … Read more

Woocommerce quick checkout form [closed]

I got it by using wc_create_order here is the full code `if ( isset( $_POST[‘submitted’] ) ) { $address = array( ‘first_name’ => $_POST[‘fullname’], ’email’ => $_POST[’email’], ‘phone’ => $_POST[‘phone’], ‘address_1’ => $_POST[‘address’], ‘city’ => $_POST[‘city’], ); $order = wc_create_order(); $order->add_product( get_product( get_the_id() ), $_POST[‘quantity’] ); $order->set_address( $address, ‘billing’ ); $order->set_address( $address, ‘shipping’ ); $order->set_payment_method( … Read more

WooCommerce doesn’t show UK countries in the shipping options [closed]

You won’t be able to find England specifically in their list. The UK treats several areas as separate countries, and other regions can only be separated by postal code. United Kingdom Republic of Ireland Jersey Guernsey Isle of Man https://github.com/woocommerce/woocommerce/blob/master/i18n/countries.php I should also mention that the “Sell to countries…” field controls the Billing side of … Read more

adding a css file to my plugin

Don’t put the full path to the file in wp_register_style() use plugins_url() to get the full url with just the path from the plugins folder. So change: ‘localhost/wordpress/wp-content/plugins/mein-plugin/style.css’ To: plugins_url( ‘style.css’, __FILE__ )