WooCommerce: Add New Report Tab

add_filter(‘woocommerce_admin_reports’,’custom_tab’); function custom_tab($reports) { $reports[‘custom_tab’]= array( ‘title’=>__(‘Custom Reports’,’woocommerce’), ‘description’=> ‘WooCommerce Orders Listing Here…’, ‘hide_title’=> true, ‘callback’=>array(‘wc_admin_orders_customers’, ‘display_orders_list_cusotomers’) ); return $reports; }

Hide certain tags on Product Edit tag cloud

You can add a filter via the theme’s functions.php file (I’d recommend you use a child-theme for customizations, but that’s outside the scope of this question) The following will limit the tag-cloud in the wp-admin backend to the first 5. function tryme($tag_data){ $short_tag_data = array_slice($tag_data, 0, 5, true); return $short_tag_data; } add_filter( ‘wp_generate_tag_cloud_data’, ‘tryme’ ); … Read more

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

How to build a plugin that supports authenticated POST requests to the REST API from external servers?

Answering my own question. For plugin developers, the directive is to use current_user_can() in your code as usual in the REST endpoints, as Core does. WordPress 5.4 does not support authenticated requests originated from outside WordPress to the REST API yet. But your clients can use plugins such as Basic Auth, OAuth2 or JWT to … Read more

User profiles and object associations

I don’t know Drupal, however, seems to me that what is “node” in drupal is “post type” in WordPress. By default WordPress has several post types: posts, pages, atthachments, menu items, revisions (these post types are often referred as “built-in”). You can register any number of custom post types, aka CPT. Post types, in database, … Read more

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