Change woocommerce product addons position in the product page

For anyone wanting to do this outside of the plugin, to future proof this from updates, you can use the global var in place of the $this add_action( ‘woocommerce_after_add_to_cart_button’, array( $GLOBALS[‘Product_Addon_Display’], ‘display’ ), 10 ); add_action( ‘woocommerce_before_add_to_cart_button’, array( $GLOBALS[‘Product_Addon_Display’], ‘totals’ ), 20 );

Setting a default parent page

This hooks onto the wp_insert_post_data filter, and checks if the post to be inserted is both a page and an auto-draft (which happens when you first create a new post/page). add_filter( ‘wp_insert_post_data’, ‘wpse_59007_set_default_page_parent’ ); function wpse_59007_set_default_page_parent( $data ) { if ( $data[‘post_status’] == ‘auto-draft’ && $data[‘post_type’] == ‘page’ ) $data[‘post_parent’] = 495; return $data; }