Custom column for changing post status via ajax

here you go: <?php /* Plugin Name: ajaxed-status Plugin URI: http://en.bainternet.info Description: answer to : Custom column for changing post status via ajax http://wordpress.stackexchange.com/questions/33442/custom-column-for-changing-post-status-via-ajax Version: 1.0 Author: Bainternet Author URI: http://en.bainternet.info */ if ( !class_exists(‘ajaxed_status’)){ class ajaxed_status { //constarctor public function __construct() { global $pagenow,$typenow; //&& $typenow ==’page’ if (is_admin() && $pagenow==’edit.php’){ add_filter(‘admin_footer’,array($this,’insert_ajax_status_script’)); } add_filter( … Read more

sort child pages on admin

As I couldn’t find any filter to override the WP_Posts_List_Table class, I propose a quite hacky solution by doing this: Query only parents in pre_get_posts; Query their children on wp and change $wp_query->posts accordingly. This might need some more work as I’m probably breaking pagination numbers or so. // Use a query variable to control … Read more

WordPress 5.5 – ReferenceError: commonL10n is not defined error

This is Trac ticket 51223: commonL10n and other JS globals removed without backwards compatibility In WordPress 5.5, the localized translations under commonL10n were replaced by wp.i18n.__ without deprecation notice or backwards compatibility. Plugins using commonL10n now have JavaScript errors introduced by updating WordPress which can break site functionality. It was fixed in 5.5.1 by adding … Read more

WordPress Multisite allow site admin to add user without email confirmation

You will not be able to enable the checkbox for non-super-admins as the code for it shows: <?php if ( is_multisite() && is_super_admin() ) { ?> <tr> <th scope=”row”><label for=”noconfirmation”><?php _e(‘Skip Confirmation Email’) ?></label></th> <td><label for=”noconfirmation”><input type=”checkbox” name=”noconfirmation” id=”noconfirmation” value=”1″ <?php checked( $new_user_ignore_pass ); ?> /> <?php _e( ‘Add the user without sending them a … Read more

Notification that the admin is online

This should get you started. I’ve used a timeout of 5 minutes to allow for time sitting idle on the website. You could improve the accuracy with a script (if the current user is the admin) & pinging an AJAX request every few minutes to update the admin_last_seen timestamp. /** * Check if the admin … Read more

Any guides on creating custom admin pages?

I pretty much started in the same place as you a while back, and have created something similar. Here’s what I think you need to know. 1) Work out how to create your basic hello world first and foremost. A simple plugin will consist of a few comments at the top of a PHP file … Read more

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