Marketpress: Edit Order screen is missing the order id

WP 4.7, Marketpress 3.1.2
When I edit an order in the backend, there is no way to see the order id as soon as I am "in" the order. E.g. in Marketpress 2.x the headline of the screen was like
"Order Details (e32e369ff5e0)"
In MP 3.1.2 the headline is just "Edit Order" and nowhere on the screen is the order number.
I tried to find the place where I can add the order id to the headline, but these screens are so "automated", that this is not possible (or I could not find it).
So finally I had to put the order number in the first section "Order Details" by changing the source code (!) in class-mp-orders-admin.php function meta_box_order_details to make the order id appear.

Is there any simpler way (without source code changes) to make the order id appear on the edit screen at a prominent place?
Thank you for all hints!

  • Sajid

    Hello Emanaku,
    Hope you are doing good today :slight_smile:

    First of all never edit the core files of a plugin or WordPress. I have come up with following code snippet that will display the number of order right ahead of Edit order.

    Add this code in functions.php file of your child theme of use it as mu-plugin.

    function wpmudev_mp_sho_order_number( $post ){
    
    	if( 'mp_order' != get_post_type( $post ) ) return $post;
    
    	echo '<h1 class=&quot;order_number&quot;> # ' .$post->post_title . '</h1>';
    
    	echo '<style>
    		h1.order_number{
    			margin-top: -42px;
        		margin-left: 104px;
    		}
    	</style>';
    
    }
    add_action('edit_form_top', 'wpmudev_mp_sho_order_number');

    See screenshot of the end result below:

    If you go with mu-plugin route then, go to your /wp-content/ folder via FTP, and find the folder called "mu-plugins". If there is no folder with that name, then you'll want to create one. Then, create a file inside that folder, and give the file any name you like and paste the code in there.

    You don't need to activate that plugin, as it will be always be automatically activated. Please be sure to add a PHP start tag at the beginning of the code if you insert this code as a mu-plugin, like this:

    <?php

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid