Do extra plugin files get deleted during an upgrade?

Yes, the entire old directory will be deleted. So store files in the upload directory and other data in the database to keep all changes. From class Plugin_Upgrader: //Hooked to upgrade_clear_destination function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) { global $wp_filesystem; if ( is_wp_error($removed) ) return $removed; //Pass errors through. $plugin = isset($plugin[‘plugin’]) ? $plugin[‘plugin’] : ”; … Read more

WordPress plugin installation

Add this code and replace yourpagename with the your page slug on which u want this filter to execute function my_name( $content ) { global $post; if ( $post->post_name == ‘yourpagename’ ) { return $content; } } add_filter( ‘the_content’, ‘my_name’ );

how to show database content in wordpress post

For the sake of the example, I’ll assume you to have copied the relevant Table to the WordPress DB, to have named it wp_my_xtra_table and it to contain 3 columns (id,num_val,str_val). function wpse106832_shortcode_demo( $atts ) { global $wpdb; extract( shortcode_atts( array( ‘id’ => 1 ), $atts ) ); $table_row = $wpdb->get_row( ‘SELECT * ‘ . … Read more

WP-Members redirect if member ALREADY logged in

I assume because the function is not called until someone logs in. That is correct. wpmem_login_redirect is a filter that happens when a user is actually logging in. If they are coming to the site and, due to having a valid cookie, are in a logged in state, they will not be redirected. From a … Read more

How to find installed plugins

On the admin side, which I assume is where you want to run this, the get_plugins function will retrieve an array of plugins along with data about each. function dump_plugins() { var_dump(get_plugins()); } add_action(‘admin_init’,’dump_plugins’); Obviously, that code is illustrative only. It will make a big mess of your site.

How extend shortcode default values for a plugin?

You can hijack the shortcode and use your own additional logic. Sample code, not tested: add_action( ‘after_setup_theme’, function() { // Replace the plugin shortcode handler with your own. add_shortcode( ‘standout-css3-button’, function( $atts, $content = NULL ) { // Let the plugin make the button and store the result. $button = scss3button( $atts, $content ); // … Read more

Show a confirmation message on plugin deactivation

I have implemented a workaround with JavaScript. I’m loading my own JavaScript file: wp_enqueue_script(‘wp-deactivation-message’, plugins_url(‘js/message.js’, dirname(__FILE__)), array()); which contains a script that adds following Event Listener – when user clicks on our plugin deactivate button it prevent it from performing this action and display a JavaScript popup asking what you need, if user accepts it … Read more