WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end

Since this isn’t getting much action I’ll put our band-aid fix as the current solution. Problem 1 Solution The added item meta data shows on the order confirmation page and does not show on the confirmation email. We solved this by utilizing the woocommerce_order_item_meta_end hook to add the extra item meta. Problem 2 Solution Adding … Read more

Custom metabox for menu administration page?

Just as a follow up for anybody looking to add their own meta boxes to the menu screen, you can do it by using ‘nav-menus’ for the post type: add_action( ‘admin_init’, ‘my_add_meta_box’ ); function my_add_meta_box() { add_meta_box( ‘custom-meta-box’, __(‘My meta box’), ‘my_nav_menu_item_link_meta_box’, ‘nav-menus’, ‘side’, ‘default’ ); } function my_nav_menu_item_link_meta_box() { ?> <div class=”custom-meta-box” id=”custom-meta-box”> Your … Read more

Only show metabox when date-value in other metabox is over?

Not sure about the linked class – it seems they collect metaboxes immediately and so there is no information regarding what post is being viewed. In general though – yes it is possible. To add a metabox: add_action( ‘add_meta_boxes’, ‘myplugin_add_my_custom_box’,10,2); See the source code here. This add_meta_boxes hook passes two variables: the post type and … Read more

Retrieving custom fields with $wpdb->get_results

Note, before going further: Take care about portability and security: function wpse50056_get_post_meta() { global $wpdb; $results = $wpdb->get_results( ” SELECT ID, post_date, post_title, post_content, meta_key, meta_value FROM {$wpdb->posts} INNER JOIN {$wpdb->postmeta} ON ( $wpdb->posts.ID = {$wpdb->postmeta}.post_id ) ” ); foreach( $results as $result ) { printf( ‘<pre>%s</pre>’, htmlspecialchars( var_export( $result, true ) ) ); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)