Send email with list of active plugins upon activation/deactivation

If you look here in /wp-admin/includes/plugin.php do_action( ‘deactivated_plugin’, $plugin, $network_deactivating ); } } if ( $do_blog ) update_option(‘active_plugins’, $current); if ( $do_network ) update_site_option( ‘active_sitewide_plugins’, $network_current ); The options aren’t updated until after the hook fires. You can get around this by using the first parameter to deactivated_plugin: function detect_plugin_change( $plugin, $network_activation ) { $url … Read more

load more button in plugin

If you want it to work like a true “load more” button, then you are going to have to let the posts load in groups without the user changing pages. This means you have to use an AJAX method. This is much more complicated than the WordPress loop you have right now. Overall it works … Read more

PHP if statement with German umlauts [closed]

This is probably because of your database collation. There are numerous questions on StackOverflow about this sort of thing. Your question may get closed or migrated as it’s not on-topic for wordpress.stackexchange.com; Take a look at this question, or perhaps ask there instead. Also, why are you not using the WordPress WP_Query class to return … Read more

jQuery Ajax PHP function call returning [object Object]

OK, so there are multiple problems with your code… 1. Incorrect localization of script Here’s your function that enqueues and localizes the scripts: function my_theme_enqueue_scripts() { wp_enqueue_script(‘jquery-ui’, ‘https://code.jquery.com/ui/1.12.1/jquery-ui.min.js’, array(‘jquery’), ‘1.12.1’); wp_register_script( ‘myjs’, get_stylesheet_directory_uri() . ‘/my.js’, array(‘jquery’),’1.0.0′); wp_enqueue_script(‘myjs’); wp_localize_script( ‘ajax-script’, ‘admin-ajax’, array( ‘ajax_url’ => admin_url( ‘admin-ajax.php’ ) ) ); } add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_scripts’ ); So you … Read more

My jQuery Ajax form submit is still refreshing page?

You use wrong js event. You register your callback with this code: $(‘#form-pm’).on(‘send’, function(e) { But there is no event called send on form. It should be submit. Here’s fixed version of that line: $(‘#form-pm’).on(‘submit’, function(e) {

When echo follow Ajax button inside Ajax pagination template not working?

I think, if you change your jQuery click action selector to handle event delegation the follow buttons should work after being added by ajax. // Change this $( ‘.follow-links a’ ).on(‘click’, function(e) { // to this $( ‘.some-parent-not-added-by-ajax’ ).on(‘click’, ‘.follow-links a’, function(e) { // or as last resort $( document ).on(‘click’, ‘.follow-links a’, function(e) {