Append country to ‘pretty’ url but serve same page

If you are needing one rewrite rule for that single page, this snippet should get you there. You’ll need to replace the XXXX in that snippet to be your post ID of your signup page. function signup_pg_rewrite_rule() { add_rewrite_rule(‘^signup/([^/]*)/?’,’index.php?page_id=XXXX&country_code=$matches[1]’,’top’); } add_action(‘init’, ‘signup_pg_rewrite_rule’, 10, 0); After you drop this in, you’ll need to flush that rewrite … Read more

Custom attribute type not displaying terms in edit product – WooCommerce

I just had that problem and resolved it alone since i could not find the answer online. You just need to put that code inside an if. Only to run that code on attribute page. if ($_GET[‘page’]==’product_attributes’) { add_filter( ‘product_attributes_type_selector’, function($array){ $array[‘test’] = __( ‘Test’, ‘awcs’ ); } ); }

WP nonce invalid

Found out what the problem was. Polylang plugin verifies the nonces, so you need to pass it the ‘new-post-translation’ arg. The solution is: wp_nonce_url( $link, ‘new-post-translation’ ); it might help someone, but maybe no 😉

Add column and post filter for a custom post type field on the edit.php page

First couple of handy helper functions, function my_custom_post_type() { return ‘post’; // edit this } function custom_field_status_metakey() { return ‘status’; } function custom_field_status_options() { return array( ” => __( ‘All statuses’, ‘textdomain’ ), // edit text domains ‘open’ => __( ‘Open’, ‘textdomain’ ), ‘closed’ => __( ‘Closed’, ‘textdomain’ ), ); } Add your custom column … Read more