Title: Add function Admin -&gt; Mark as Sold
Last modified: March 8, 2024

---

# Add function Admin -> Mark as Sold

 *  Resolved [Houdini](https://wordpress.org/support/users/romariokg/)
 * (@romariokg)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/add-function-admin-mark-as-sold/)
 * I found this discussion on the forum, but the code doesn’t work! If you add this
   code, the site crashes when you enter the admin panel!
 * add following code in theme functions.php file –
   add_action(‘admin_init’, function(){
   update_post_meta(post_id, ‘_rtcl_mark_as_sold’, ‘1’);});
 * Can you give me the current code?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadd-function-admin-mark-as-sold%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Muhammad Ali Akbar](https://wordpress.org/support/users/alireyad/)
 * (@alireyad)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/add-function-admin-mark-as-sold/#post-17489139)
 * Hi,
   That user wanted to mark as sold for a listing. that’s why provided the code.
   Not sure about your requirements. Here, post_id means specific listing id. If
   you want to mark as sold a specific listing then use that listing id here.
 * Thank you
 *  Thread Starter [Houdini](https://wordpress.org/support/users/romariokg/)
 * (@romariokg)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/add-function-admin-mark-as-sold/#post-17495021)
 * Hello!
 * In short, I would like to see the mark_as_sold button in the admin area under
   each user announcement.
 * Maybe there is some kind of hook that I can add to the functions.php file???
 *  Plugin Support [Muhammad Ali Akbar](https://wordpress.org/support/users/alireyad/)
 * (@alireyad)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/add-function-admin-mark-as-sold/#post-17495768)
 * Hi,
   Sorry, not possible it right now. You have to add custom meta for admin area.
 * Please, create ticket from our site for pro feature related issues.
 * Thank you

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add function Admin -> Mark as Sold’ is closed to new replies.

 * ![](https://ps.w.org/classified-listing/assets/icon-256x256.gif?rev=3004059)
 * [Classified Listing – AI-Powered Classified ads & Business Directory Plugin](https://wordpress.org/plugins/classified-listing/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/classified-listing/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/classified-listing/)
 * [Active Topics](https://wordpress.org/support/plugin/classified-listing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/classified-listing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/classified-listing/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Muhammad Ali Akbar](https://wordpress.org/support/users/alireyad/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/add-function-admin-mark-as-sold/#post-17495768)
 * Status: resolved