Articles of admin

WooCommerce – Email admin with new user details

I am trying to send a custom email to the admin account when any user registers through WooCommerce. I have managed to get it to send the username ($user_login) but have been unsuccessful in managing to provide the admin with info such as customer email and names. Is there anything obvious I’m missing? This is […]

what is best way to keep track of changes made in wordpress website?

I have a website which has many admins. What is the best plugin or any other functions which would do this work? Any suggestion would be a great help. Thank you.

Hiding Admin Page While Keeping Menu Expanded

I am creating a custom admin section. I have the following code: // Top level menu add_menu_page(‘Books’, ‘Books’, ‘publish_posts’, ‘books’, ‘render_books_page’, ”, 17); // Adding this function to make the first submenu have a different name than the main menu // Details: add_submenu_page(‘Books’, ‘Books’, ‘All Books’, ‘publish_posts’, ‘books’, ‘render_books_page’); // The Add Book menu […]

Remove value from array within post meta ajax admin

I have an array within the post meta for a post. I want to be able to list out each individual element of the array in the admin area and delete a value from that array. I currently loop over each of my array elements and attempt to use ajax to delete them, when I […]

Admin user lacks admin permissions after hack and can't reinstate

My site (4.5.3 on Apache/Linux) was hacked, I suspect something like the one described here. As best I can tell I’ve removed or at least disabled the hack, however admin users aren’t able to perform actions like updating WordPress, adding plugins, etc. So far, I have tried: Editing the existing admin user’s permissions via phpMyAdmin. […]

WordPress Admin Menu Order for 'admin.php' pages

I’m using following code to change menu order of WordPress admin panel. function reorder_admin_menu( $__return_true ) { return array( ‘index.php’, // Dashboard ‘separator1’, // –Space– ‘edit.php?post_type=page’, // Pages ‘edit.php’, // Posts ‘edit.php?post_type=portfolio’, // Portfolio ‘admin.php?page=wpcf7’, // Contact Form 7 ‘upload.php’, // Media ‘edit-comments.php’, // Comments ); } add_filter( ‘custom_menu_order’, ‘reorder_admin_menu’ ); add_filter( ‘menu_order’, ‘reorder_admin_menu’ ); […]

How do I set up a webhook?

I have a simple script that sends Slack messages, runs reports and does other things. I would like this script to run directly based after users purchase something on my site. I do NOT want to build this functionality using WordPress, my goal is to have loosely coupled systems. ENTER WEBHOOKS. Webhooks sound exactly like […]

Page can't hand request – HTTP ERROR 500 – when updating something

I have a wordpress website filled with lots of different content (news, posts, products in an online shop, etc.). I had some problems with the famous “Internal Server Error 500” yesterday, but after contacting my hosting provider they used a restore point from 5 days ago and the error was gone. But now, everytime a […]

Filter for when the post is updated

Is there a way to check in admin page if a post was just updated? It looks like WP shows a notification so there must be a hook but I can’t find it.. I want to trigger some js in the post.php in the admin screen if the post was just updated (post added to […]

List User order by ID in Descending order (Backend)

I’m trying to Show User List in WordPress Admin in Descending order by “ID” column. I tried below code add_action(‘pre_user_search’, ‘change_user_order’); function change_user_order($query) { $query->query_orderby = ‘ ORDER BY ID DESC’; } But its not working.