How to get sub items of parent menu item?

As a workaround I have this temporary solution: $the_menu = wp_get_nav_menu_object(‘Some Menu’); $the_menu_items = wp_get_nav_menu_items($the_menu); $category_products = []; foreach ($the_menu_items as $index => $menu_category) { if ($menu_category->object_id == $category->term_id ) { $category_submenu = $menu_category; } } foreach ($the_menu_items as $index => $menu_product) { if ($menu_product->type_label == ‘Product’ && $menu_product->menu_item_parent == $category_submenu->ID ) { $category_products[] = … Read more

How to create custome pdf file of my invioice in wordpress

Assuming you’re creating this as a plugin and you’ve saved the dompdf directory within your plugin directory you can include it with the following. // wp-content/plugins/yourplugin/yourplugin.php // Set up paths to include DOMPDF $plugin_path = plugin_dir_path( __FILE__ ); define( ‘YOURPLUGIN_DOMPDF’, $plugin_path . ‘dompdf/’ ); // Set up directory to save PDF $upload_dir = wp_upload_dir(); define( … Read more